Timer function with Node-Red in Home assistance

I would like to control my pool pump in Node red. To do this, I want to use a loop that first switches the pump on for 3 minutes, then wait 15 minutes (until the sun has heated the water on a heating mat on the roof) and then switch the pump on again for 3 minutes.

As you can see in the flow, it works to switch the pump on for a time x and stop it again. But for some reason the second timer does not start to wait for the switch off time.
Any ideas what the problem could be?

Hi and Welcome.

I, like most here am not a HA user, but there are some. HA offer support for Node-red on their forum also, which may help you.

Your image is not a great help. Best to share an export of your flow and supply the data your HA nodes output. You can do this by adding debug node after the nodes.
How to import/export a flow

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path/value for any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

Saying that here is an example of a looping timer that may help you.

[{"id":"6fde01759560007d","type":"inject","z":"d1395164b4eec73e","name":"reset timer","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":240,"y":4440,"wires":[["a135ed34968e7cae","66b36d2c2aa3ceb0","afa8fb0f6d8553ca"]]},{"id":"a135ed34968e7cae","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":600,"y":4480,"wires":[["f77de1d4c17236b8"],["66b36d2c2aa3ceb0","f77de1d4c17236b8"]]},{"id":"66b36d2c2aa3ceb0","type":"delay","z":"d1395164b4eec73e","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":440,"y":4480,"wires":[["a135ed34968e7cae"]]},{"id":"afa8fb0f6d8553ca","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"delete","p":"reset","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4440,"wires":[["f77de1d4c17236b8"]]},{"id":"86bc12e84d5250d1","type":"inject","z":"d1395164b4eec73e","name":"start timer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":4540,"wires":[["a135ed34968e7cae"]]},{"id":"f77de1d4c17236b8","type":"rbe","z":"d1395164b4eec73e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":790,"y":4480,"wires":[["56f5433b2017df73"]]},{"id":"56f5433b2017df73","type":"debug","z":"d1395164b4eec73e","name":"debug 2492","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":4520,"wires":[]}][{"id":"6fde01759560007d","type":"inject","z":"d1395164b4eec73e","name":"reset timer","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":240,"y":4440,"wires":[["a135ed34968e7cae","66b36d2c2aa3ceb0","afa8fb0f6d8553ca"]]},{"id":"a135ed34968e7cae","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":600,"y":4480,"wires":[["f77de1d4c17236b8"],["66b36d2c2aa3ceb0","f77de1d4c17236b8"]]},{"id":"66b36d2c2aa3ceb0","type":"delay","z":"d1395164b4eec73e","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":440,"y":4480,"wires":[["a135ed34968e7cae"]]},{"id":"afa8fb0f6d8553ca","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"delete","p":"reset","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4440,"wires":[["f77de1d4c17236b8"]]},{"id":"86bc12e84d5250d1","type":"inject","z":"d1395164b4eec73e","name":"start timer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":4540,"wires":[["a135ed34968e7cae"]]},{"id":"f77de1d4c17236b8","type":"rbe","z":"d1395164b4eec73e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":790,"y":4480,"wires":[["56f5433b2017df73"]]},{"id":"56f5433b2017df73","type":"debug","z":"d1395164b4eec73e","name":"debug 2492","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":4520,"wires":[]}][{"id":"6fde01759560007d","type":"inject","z":"d1395164b4eec73e","name":"reset timer","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":240,"y":4440,"wires":[["a135ed34968e7cae","66b36d2c2aa3ceb0","afa8fb0f6d8553ca"]]},{"id":"a135ed34968e7cae","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":600,"y":4480,"wires":[["f77de1d4c17236b8"],["66b36d2c2aa3ceb0","f77de1d4c17236b8"]]},{"id":"66b36d2c2aa3ceb0","type":"delay","z":"d1395164b4eec73e","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":440,"y":4480,"wires":[["a135ed34968e7cae"]]},{"id":"afa8fb0f6d8553ca","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"delete","p":"reset","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4440,"wires":[["f77de1d4c17236b8"]]},{"id":"86bc12e84d5250d1","type":"inject","z":"d1395164b4eec73e","name":"start timer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":4540,"wires":[["a135ed34968e7cae"]]},{"id":"f77de1d4c17236b8","type":"rbe","z":"d1395164b4eec73e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":790,"y":4480,"wires":[["56f5433b2017df73"]]},{"id":"56f5433b2017df73","type":"debug","z":"d1395164b4eec73e","name":"debug 2492","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":4520,"wires":[]}][{"id":"6fde01759560007d","type":"inject","z":"d1395164b4eec73e","name":"reset timer","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":240,"y":4440,"wires":[["a135ed34968e7cae","66b36d2c2aa3ceb0","afa8fb0f6d8553ca"]]},{"id":"a135ed34968e7cae","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":600,"y":4480,"wires":[["f77de1d4c17236b8"],["66b36d2c2aa3ceb0","f77de1d4c17236b8"]]},{"id":"66b36d2c2aa3ceb0","type":"delay","z":"d1395164b4eec73e","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":440,"y":4480,"wires":[["a135ed34968e7cae"]]},{"id":"afa8fb0f6d8553ca","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"delete","p":"reset","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4440,"wires":[["f77de1d4c17236b8"]]},{"id":"86bc12e84d5250d1","type":"inject","z":"d1395164b4eec73e","name":"start timer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":4540,"wires":[["a135ed34968e7cae"]]},{"id":"f77de1d4c17236b8","type":"rbe","z":"d1395164b4eec73e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":790,"y":4480,"wires":[["56f5433b2017df73"]]},{"id":"56f5433b2017df73","type":"debug","z":"d1395164b4eec73e","name":"debug 2492","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":4520,"wires":[]}][{"id":"6fde01759560007d","type":"inject","z":"d1395164b4eec73e","name":"reset timer","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":240,"y":4440,"wires":[["a135ed34968e7cae","66b36d2c2aa3ceb0","afa8fb0f6d8553ca"]]},{"id":"a135ed34968e7cae","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":600,"y":4480,"wires":[["f77de1d4c17236b8"],["66b36d2c2aa3ceb0","f77de1d4c17236b8"]]},{"id":"66b36d2c2aa3ceb0","type":"delay","z":"d1395164b4eec73e","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":440,"y":4480,"wires":[["a135ed34968e7cae"]]},{"id":"afa8fb0f6d8553ca","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"delete","p":"reset","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4440,"wires":[["f77de1d4c17236b8"]]},{"id":"86bc12e84d5250d1","type":"inject","z":"d1395164b4eec73e","name":"start timer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":4540,"wires":[["a135ed34968e7cae"]]},{"id":"f77de1d4c17236b8","type":"rbe","z":"d1395164b4eec73e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":790,"y":4480,"wires":[["56f5433b2017df73"]]},{"id":"56f5433b2017df73","type":"debug","z":"d1395164b4eec73e","name":"debug 2492","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":4520,"wires":[]}][{"id":"6fde01759560007d","type":"inject","z":"d1395164b4eec73e","name":"reset timer","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":240,"y":4440,"wires":[["a135ed34968e7cae","66b36d2c2aa3ceb0","afa8fb0f6d8553ca"]]},{"id":"a135ed34968e7cae","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":600,"y":4480,"wires":[["f77de1d4c17236b8"],["66b36d2c2aa3ceb0","f77de1d4c17236b8"]]},{"id":"66b36d2c2aa3ceb0","type":"delay","z":"d1395164b4eec73e","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":440,"y":4480,"wires":[["a135ed34968e7cae"]]},{"id":"afa8fb0f6d8553ca","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"delete","p":"reset","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4440,"wires":[["f77de1d4c17236b8"]]},{"id":"86bc12e84d5250d1","type":"inject","z":"d1395164b4eec73e","name":"start timer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":4540,"wires":[["a135ed34968e7cae"]]},{"id":"f77de1d4c17236b8","type":"rbe","z":"d1395164b4eec73e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":790,"y":4480,"wires":[["56f5433b2017df73"]]},{"id":"56f5433b2017df73","type":"debug","z":"d1395164b4eec73e","name":"debug 2492","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":4520,"wires":[]}]

As noted - not many people have the Home Assistant Webhooks modules installed and hence will not be able to download and install your flow (if you do post it correctly)

On the Home Assistant forums they have a dedicated sub forum for Node Red.

However i would make a couple of points

  1. It is not good for the life of a pump to turn it on briefly and turn it back off repeatedly - and will use more energy than you might imagine - you will also find that unless you include a reverse flow blocking valve in your system that you will end up with continual air locks in the system

  2. Generally these types of pool systems are designed to run continously (monitoring the input and output temperatures and pulling from the middle level of the input (usually a pool) and expelling the water from the roof in the deepest part (so there is always a high differential temperature and the most heat can be extracted.)

Craig

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.