I'm trying to work around this issue, by adding another switch command (on or off) when the switch is pressed, using the followin lua script:
Code: Select all
commandArray = {}
if (devicechanged['Lamp 1'] == 'On') then
commandArray[1]={['OpenURL']='192.168.2.201:8084/json.htm?type=command¶m=switchlight&idx=24&switchcmd=On' }
end
return commandArray
The issue is: running this command triggers an additional On command (it switches on the switch a second time), but it doesn't trigger an additional status change of the switch (so it does the exact opposite of what I want).
The strange thing is: when I run the command in a browser, it actually does exactly what I want: it sets the correct status of the switch.
Any other ideas on how to "trick" a switch to think it's On or Off, or any insights in what I'm doing wrong?