I have heard about Node-RED several times. But until now I tried to do everything in Home Assistant and yaml.
Today I decided to try it out, I watched a couple of youtube videos and decided to try it out with a motion sensor and a light.
I only want it to turn on if we're home, and if the sun is down. And then to turn off when there's no motion detected.
Below is a picture of the flow. The names are in norwegian. So I'll explain.
First box is a state node of the motion sensor wich is connected to a switch.
The switch have two outputs on and off. If on is detected it goes through the "ute?" and "borte" which checks the current state of two input boolean switches I made. One for out and one for away. If one of those are on the flow stops. If not it goes on to the "Sol nede?" which checks if the sun is below the horizon.
If it's not below the horizon the flow stops. If it is it continues to "Lys av?" which checks if the light is off. If the light is off it turns it on. If not the flow stops.
If the motion detector goes to off, it turns the light off "Slå av lys"
A bit hard to explain only in words. But I hope you get the Idea.
Today I decided to try it out, I watched a couple of youtube videos and decided to try it out with a motion sensor and a light.
I only want it to turn on if we're home, and if the sun is down. And then to turn off when there's no motion detected.
Below is a picture of the flow. The names are in norwegian. So I'll explain.
First box is a state node of the motion sensor wich is connected to a switch.
The switch have two outputs on and off. If on is detected it goes through the "ute?" and "borte" which checks the current state of two input boolean switches I made. One for out and one for away. If one of those are on the flow stops. If not it goes on to the "Sol nede?" which checks if the sun is below the horizon.
If it's not below the horizon the flow stops. If it is it continues to "Lys av?" which checks if the light is off. If the light is off it turns it on. If not the flow stops.
If the motion detector goes to off, it turns the light off "Slå av lys"
A bit hard to explain only in words. But I hope you get the Idea.