Hi,
I’m not new to programming but new to LUA. I’ve successfully used the luup.is_night function to have lights turn on when a door is opened only at night which was a pretty simple task. Now I’m moving toward more complex conditional functions and would like a light to turn on only if another light is off when a door is opened. I have a simple if statement but no matter what values I use, the if statement never resolves to true, only executing the else code. Here is an example:
local switch = luup.variable_get(“urn:schemas-upnp-org:device:BinaryLight:1”, “Status”, 17)
if (switch==“0”) then
return true
else
return false
end
The device above is a GE/Jasco wall switch 45609.
I have tried the comparator as a value and “text” and neither resolve to a 1 or a 0. Is looks like there is some other data that is coming back from the luup.variable_get function that I am not checking for. All the reading I have done indicates this should work but I’m just not having any success. Any help would be greatly appreciated.
Thanks!