Yes you can do this. First thing… you cant use a device. Only entities are supported. I point you to another blueprint of mine FAQ but it all the same. Click here
When setting it up you will need to use night lights and use the night lights time condition. In night light control make sure you select If lights are ON, adjust the lights when crossing over.
Enjoy
Blacky