HUE Color change before switch on lamp

Moderator: leecollings

Post Reply
Lachris
Posts: 7
Joined: Tuesday 31 May 2016 12:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

HUE Color change before switch on lamp

Post by Lachris »

Hi,

I have a problem with my LUA script when I want to change color from a "switch off" state on the bulb.
Ex. Red to white and reverse.

If last know state was white, and I want to switch on red, i start out white and change to Red.

Is it possible to get it to turn on with the right color before the lamp goes on?

Code: Select all

commandArray = {}
if devicechanged['Emilies Værelse | Døren | Tryk (øverst venstre)'] == 'Open' then

  brightness = 255
  iswhite = "false"
  hex = "fffd8e"
  idx = otherdevices_idx["HUE Emilie"] -- name lamp
  url = 'http://11.0.0.98:8080/json.htm?type=command&param=setcolbrightnessvalue&idx=' .. idx .. '&hex=' .. hex .. '&brightness=' .. brightness ..'&iswhite=' .. iswhite
    commandArray['OpenURL']= url
    commandArray['HUE Emilie']='On'
else

end

return commandArray
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest