This is my first luup code attempt and was wondering if someone could push me in the right direction.
I use a bedtime virtual switch set through scenes or manually. I have three scenes that turn on the lights called day, night, and bedtime, with a trigger firing all 3 scenes. I then assumed that I use the luup code to filter only one scene to complete from the trigger.
However, I can’t get the day, night, or bedtime code to fire if the below luup code present in the scene (this is a bedtime specifically based on the return true or false) for virtual switch #267.
if (luup.is_night()) then
local lul_bedtime = luup.variable_get(“urn:upnp-org:serviceId:VSwitch1”, “Status”, 267)
if (lul_bedtime == “1”) then
return true
else
return false
end
else
return false
end
What is wrong with my code that it never returns true?
Hi,
Your code seems to good, the only problem could be with the “Status” variable from the virtual switch. But to sure where is the problem, can you show us all your code for the scene?
Tnx
I didn’t quite understand where to put that trigger code…still a work in progress.
I just want to “sub in” a scene during a specific time frame. For example, in the bathroom between midnight and 7am the lights only come on at 10% brightness vs the normal 100%.