Page 1 of 1

Better support for controlling Philips Hue in Lua?

Posted: Thursday 17 November 2016 11:53
by starfish
I wonder if there's any better support for controlling Philips Hue than described in wiki. What the page proposes is:

Code: Select all

commandArray = {}
if (devicechanged['Hue dimmer switch 2 Button Up'] == 'On') then
  brightness = 80
  iswhite = "false"
  hue = "0" -- red
  idx = otherdevices_idx["Bol Lamp"] -- name lamp
  url = 'http://10.0.0.1:8090/json.htm?type=command&param=setcolbrightnessvalue&idx=' .. idx .. '&hue=' .. hue .. '&brightness=' .. brightness ..'&iswhite=' .. iswhite
  commandArray['OpenURL']= url
end
return commandArray
This involves Domoticz sending REST commands to itself, which isn't very elegant in my view. Is there a way I can turn Hue on/off or change colour directly using commandArray?

Also, I noticed that after upgrade to v3.5877, the state of a Hue device that was set up this way, is now reported as On, whereas previously it was Set Level. At the same time, if I set it up using the color slider dialog, the status is again set to Set Level, which is a bit inconsistent and complicates its handling in scripts. Was it a deliberate change or is it a glitch?