I'm trying to use the "HTTP Device" app to control a remote device using GET and JSON.
I can easily turn the remote device On or Off by using the following URLs.
On: http://IP_ADDRESS/JSON?request=controldevicebyvalue&ref=58&value=255
Off: http://IP_ADDRESS/JSON?request=controldevicebyvalue&ref=58&value=0
But when it comes to the "URL to get value" option I'm having difficulties to parse the correct value from the url to the HTTP Device.
The URL I use for getting the device value is this : http://IP_ADDRESS/JSON?request=getstatus&ref=58
that gives me this information:
Code: Select all
// 20150621151221
// http://IP_ADDRESS/JSON?request=getstatus&ref=58
{
"Name": "HomeSeer Devices",
"Version": "1.0",
"Devices": [
{
"ref": 58,
"name": "Spotlights",
"location": "TV Stue",
"location2": "Lys",
"value": 0,
"status": "Off",
"device_type_string": "Z-Wave Switch Multilevel",
"last_change": "/Date(1434841201998)/",
"relationship": 3,
"hide_from_view": false,
"associated_devices": [
],
"device_type": {
"Device_API": 4,
"Device_API_Description": "Plug-In API",
"Device_Type": 999,
"Device_Type_Description": "Plug-In Root Device",
"Device_SubType": 17,
"Device_SubType_Description": ""
},
"device_image": ""
}
]
}
My next question will be on how to do the dimming devices (switchMultilevel), but first things first.
Thanks