Hello everyone !
I’ve been using Node Red for about a year now, but still I’m struggling on this easy problem.
Let’s assume I want to switch on a light when all of these conditions are met :
- Light is currently off or brightness is < 20%
- Motion is detected in the area
- Outdoor luminance < 500lux
…
How can I achieve this efficiently in Node Red ?
Currently I have 3 triggers, and then that I check that all conditions are met. But it does not seem efficient because doing so I recheck also the condition of the trigger itself.
Or I could have 3 lines, one for each trigger and then check the 2 other conditions for each line, but once again inefficient nad more difficult to maintain (when I want to change a luminance threshold for instance, I would have to change it in 3 nodes…).
I’ve tested the “AND” and “OR” nodes from a few custom packages but I always had issues, most of the time after HA or node Red restarts.
That seems very basic but I can not find an easy and efficient way to achieve this. How do you do this ?
Thanks !