Timer for Lights

There was a time when you had analog timers in your house. You managed it by pulling the plastic in or out and could have it turn on and off during the day. Noways they still sell these but many of the timers are now smart. I have found out that using Node Red for all my timers is the most easy and best solution. It just works. However it can be difficult to know what nodes to use.  In general I had some things I wanted to solve and for a beginner it can be confusing.

  • I want to be able to manually override the time and turn on and off
  • I wanted it to start at sunset
  • I wanted it to turn off when it is dark
  • I wanted to be able to control what time it should be running. Manual override,
  • It should work with Home Assistant

This is nothing complicated but still I wanted to share this.

You will need the following nodes.



The node


The node looks like this. Lets go trough it. The first pink node is the light scheduler node. You can see the details in the image below the flow. This node is most likely the most advanced light node. The fisrt thing I wanted to do is to turn in on on sunset. I also ticked only when dark. The second thing I wanted to do is schedule the time. I want it to turn on when it is dark but only be on until midnight. So it is not on the whole night. Same in the morning. Turn on at 06:00 but only until 09:00. In the winter it get dark here at 15:00 but in the summer 23:00.

The second node is the timers mode from Home Assistant. This is a input boolean dummy switch. It makes me able to bypass the timer node if I want to control it manually. If it is on it will stop.

The third is the switch. It just takes the ON and OFF.

the last node is the entety from  Home Assistant for my plugs.






If you have another light later on just copy the node and replace it with new lights.