this post was submitted on 27 Jan 2024
15 points (89.5% liked)
homeassistant
12066 readers
3 users here now
Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
In NodeRED it would look like this:
The top row is triggered when the motion detector changes to "on". It turns the lights on without delay.
The second row only triggers if the motion detector has been "off" for 5 minutes. If it goes back to "on" within those 5 minutes, the timer starts over automatically.
You can try importing it using the following code:
NodeRED code dropdown
Do NodeRED timers survive a restart?
When I restart mine, I restart HA only, and all of the add-ons (including NodeRED) keep running. The problem is as soon as HA restarts, it blasts all of the states to NodeRED, and for the most part (I think), they all go from "unavailable" to "on/off". This restarts whatever timers NodeRED keeps track of. I don't know of a good way around this, but I restart HA so infrequently that it doesn't matter for me.
No, but you CAN use HA timers in NodeRED. You just have to trigger off the state of the timer itself. I did get it to work but it was quite a bit of spaghetti, I found it easier to use eventID triggers in the standard automation GUI for dealing with persistent timers.