Try to implement this scenario through automation rules in Home Assistant:
I want the lights on if it is starting to get dark and it is Sun-Thu (workday the day after) between 6-22:30 OR Fri-Sat between 6-23. I also want the lights to be on if it is really dark and the TV is on. But if the TV is turned off I want the lights to stay on for another 15 mins. And if I wake up and need to go to the restroom during the night I want the lights to turn on for 10 mins.
So in summary:
- It is starting to get dark outside, keep lights on for min 30 mins to avoid frequent switch on/off actions AND
- Day is Fri-Sat
- OR Day is Sun-Mon
- OR it is really dark outside AND
- The TV is on
- OR The TV is turned off but keep the lights on for another 15 mins
- OR Motion is detected in the house and keep the lights on for 10 mins
It will probably take some work to build automation scripts in Home Assistant to accomplish but in Node-RED fairly simple to implement using node-red-contrib-norelite as illustrated below.

So, what’s the difference from using standard Node-RED nodes
In short I’d say it is the following main characteristics:
- state management is built into the norelite nodes
- Node-RED as a basis is very event driven with doesn’t normally keep states - this can of course be implemented using flow or context variables
- a ‘magic’ node - the switch node - keeps track on all messages recieved and from which sender and calculates if a light should be turned on or off
- It is a complex task to manage if a light or a switch should be turned on or off if there are many rules such as in the example above
- By default a light is off - can be set on by enabling msg.payload.enabled
- The higest dim value will set the strength of the lights - msg.payload.dim
- Values can be enforces by setting a priority. It can even be turned of if the incoming message is set with a higher priority - msg.payload.type
- built in simple rules management defined by sensors or really any values
- Uses simple comparison to check on the stored values with fixed values or even compare with other sensors
- plenty of ready to use utility nodes tailored for home automation
- Uses the same syntax as the core norelite nodes and enables traceability for receiver of sender
- Filter by day or time
- Change dim or light strength
- Change color (uses the node-red-contrib-norelite-color node)
- Override values or enforce on/off based on incoming enabled
- device nodes that converts the internal messaging to specific devices
Simplicity through visualization
Node-RED is simple and great at flow managment and home automation rules can be quite complex to define.
By example I’ve illustrated the scenario presented at Home Assistant Conference 2020 where a light bulb is to be controlled by sun state, time and if a door is opened or closed.
Check out the video explaining on how to do it in Home Assistant on Youtube
I built the same logic easily using node-red-contrib-norelite and it can easily be extended further. It is a good showcase on the simplicity of norelite.

Alright, how do I get started?
- Install the required dependencies into Node-RED based on what you want to do
- Import examples that comes with the installation
- Node-RED menU: Import > Examples > node-red-contrib-norelite
- Read the node descriptions in the Node-RED GUI. I’ve tried to document them fairly well..