Fetch color and brightness of RGBW Dimmer device (Philips Hue) via API
Posted: Sunday 25 June 2017 18:11
Hello,
I would like to get color and brightness values for a given Philips Hue (at least the last value Domoticz set it to) but this information is not returned by Domoticz API.
The "/json.htm?type=devices&rid=4242" request returns me:
Which indicates the brightness ("Level" and "LevelInt") but not the color 
Change color via Domoticz GUI performs API call to "/json.htm?type=command¶m=setcolbrightnessvalue&idx=4242&hue=222&brightness=50", but such values seems to be lost because they are not retrievable via the API.
Did I missed something ?
I would like to get color and brightness values for a given Philips Hue (at least the last value Domoticz set it to) but this information is not returned by Domoticz API.
The "/json.htm?type=devices&rid=4242" request returns me:
Code: Select all
{
"ActTime" : ...,
"ServerTime" : "...",
"Sunrise" : "...",
"Sunset" : "...",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 102,
"Data" : "Off",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 15,
"HardwareName" : "Philips Hue Bridge",
"HardwareType" : "Philips Hue Bridge",
"HardwareTypeVal" : 93,
"HaveDimmer" : true,
"HaveGroupCmd" : false,
"HaveTimeout" : false,
"ID" : "56",
"Image" : "LED",
"IsSubDevice" : false,
"LastUpdate" : "2017-06-25 16:18:17",
"Level" : 87,
"LevelInt" : 87,
"MaxDimLevel" : 100,
"Name" : "Hue A",
"Notifications" : "false",
"PlanID" : "6",
"PlanIDs" : [ 5, 9 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"Status" : "Off",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "RGBW",
"SwitchType" : "Dimmer",
"SwitchTypeVal" : 7,
"Timers" : "false",
"Type" : "Lighting Limitless/Applamp",
"TypeImg" : "dimmer",
"Unit" : 1,
"Used" : 1,
"UsedByCamera" : false,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "4242"
}
],
"status" : "OK",
"title" : "Devices"
}

Change color via Domoticz GUI performs API call to "/json.htm?type=command¶m=setcolbrightnessvalue&idx=4242&hue=222&brightness=50", but such values seems to be lost because they are not retrievable via the API.
Did I missed something ?