Better support for controlling Philips Hue in Lua?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
starfish
Posts: 1
Joined: Thursday 17 November 2016 11:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Netherlands
Contact:

Better support for controlling Philips Hue in Lua?

Post 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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest