Node Red timer that persists after HA restart

Node Red timer that will survive an HA restart, a Node Red deploy or restart. Timer goes on and it creates an entity in HA with the remaining time. The sensor does update the remaining time in lovelace.

Example for 15 minutes timer.

You will need: ‘node-red-contrib-stoptimer-varidelay’

[{"id":"eebfa303.35e34","type":"stoptimer-varidelay","z":"3ebeb767.8778f8","duration":"5","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"Timer in Node Red","reporting":"every_second","persist":true,"x":510,"y":240,"wires":[[],[],["b358ed04.66d79"]]},{"id":"b358ed04.66d79","type":"ha-entity","z":"3ebeb767.8778f8","name":"Timer entity in HA","server":"9405c3fe.d0a6c","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"your timer name"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":730,"y":240,"wires":[[]]},{"id":"7342425d.d702bc","type":"inject","z":"3ebeb767.8778f8","name":"Start","props":[{"p":"delay","v":"900","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":270,"y":220,"wires":[["eebfa303.35e34"]]},{"id":"3e3a6ffd.0306f","type":"inject","z":"3ebeb767.8778f8","name":"Stop","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"stop","payloadType":"str","x":270,"y":280,"wires":[["eebfa303.35e34"]]},{"id":"9405c3fe.d0a6c","type":"server","z":"","name":"Home Assistant","addon":true}]
2 Likes

Hey… this is great.

That is all.

1 Like