hi All,
i am new to the luup programming. and having difficulty to figure below. is this possible???
during anytime, when motion sensor armed and tripped, triggered security alarm siren
during day time(8am to 6pm), not arm, if motion sensor tripped, do nothing
but when night time (7pm to 8am), not arm, if motion sensor tripped, then turn on the lights
help much appreciate. thanks
btw, how to put a comment in the code???this is so i can put some comment on what it does.
For this you only need a scene with no code.
[quote=“woodchild, post:1, topic:171982”]during day time(8am to 6pm), not arm, if motion sensor tripped, do nothing
but when night time (7pm to 8am), not arm, if motion sensor tripped, then turn on the lights[/quote]
For this you need another scene, that turns on the lights, and has this code:
return luup.is_night()
luup.is_night() return true when at night and lets the scene to run. At day it returns false and doesn’t let the scene to run.
In Lua comments are added with “–”. See here for more info.