Switch device on during certain timeperiod

I have 2 scenes running, day and night. Night starts at 0:00 and day at 6:00. I have one device which should turn on at sunset and turn off at sunrise. In both scenes i added luup code to check luup.is night = true, then switch device on, but I am not sure if this is the correct way.

when creating a scene, and setting a schedule, there’s an option to run it at sunset or sunrise. No need to use “is_night” at all…

Ok, i will check this. However, my night scene should start at noon. And i dont think you can run 2 scenes at once.

Solved via the day or night plugin