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¶m=setcolbrightnessvalue&idx=' .. idx .. '&hex=' .. hex .. '&brightness=' .. brightness ..'&iswhite=' .. iswhite
commandArray['OpenURL']= url
commandArray['HUE Emilie']='On'
else
end
return commandArray