Node Red flow help - solar/temp pool pump timer

I’m trying to achieve a flow wherein solar generation exceeding 3000 watts triggers a weather temperature check, then starts a specific timer. I need only one payload to get to the timer, otherwise the timer resets and the pump only turns off when solar drops below 3000 watts.

Node settings:

Check solar - 30min interval
Smoothing - averaging last 4 inputs
Deadband - only passing if last input value change greater than 3000

I had hoped the deadband would receive 0 watts throughout the night, then during the ~hour that solar generation goes from 0 to 5000+ watts that it would essentially output 2 times per day, once during morning, and another in evening.

Right now it never triggers a timer. If I remove the deadband or the smoothing, it triggers too many resets of the time. Any advice?

Post your flow and an example of the output from the smooth node. Just post up to get current temp.

Thankyou, hopefully what I’m pasting below is what you’re looking for:

[{"id":"5b285dd39f164660","type":"smooth","z":"5474a5e4ed2754ef","name":"","property":"payload","action":"mean","count":"4","round":"","mult":"single","reduce":true,"x":340,"y":320,"wires":[["f2dad817582594cc","90c899fea6dff0ac"]]},{"id":"27f14d5cfe99a84f","type":"api-call-service","z":"5474a5e4ed2754ef","name":"Turn Off Pool Pump","server":"3d13cb11.d5e754","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.pool_pump_a, switch.pool_pump_b","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":910,"y":380,"wires":[["c7178e42da14b030"]]},{"id":"f2dad817582594cc","type":"rbe","z":"5474a5e4ed2754ef","name":"","func":"deadbandEq","gap":"5000","start":"","inout":"in","septopics":false,"property":"payload","topi":"topic","x":500,"y":320,"wires":[["4b34333b802435b0","5af05b9c8327a2a2"]]},{"id":"9fa1c0c46afc1cf1","type":"poll-state","z":"5474a5e4ed2754ef","name":"Check Solar Generation","server":"3d13cb11.d5e754","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"30","updateIntervalType":"num","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.solar_9_1min","state_type":"num","halt_if":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"x":140,"y":320,"wires":[["5b285dd39f164660"]]},{"id":"4b34333b802435b0","type":"switch","z":"5474a5e4ed2754ef","name":"Output Watts","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"3000","vt":"num"},{"t":"lt","v":"3000","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":320,"wires":[["ac2622eb46557eaa","ff28db877e4a9d69"],["ff28db877e4a9d69","27f14d5cfe99a84f"]]},{"id":"ac2622eb46557eaa","type":"api-current-state","z":"5474a5e4ed2754ef","name":"Get Current Temp","server":"3d13cb11.d5e754","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.kphx_temperature","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"data","propertyType":"msg","value":"","valueType":"entityState"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":910,"y":260,"wires":[["17c3d5119577ddbb","403ccd964fc1f7dd"]]},{"id":"90c899fea6dff0ac","type":"debug","z":"5474a5e4ed2754ef","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":490,"y":280,"wires":[]},{"id":"5af05b9c8327a2a2","type":"debug","z":"5474a5e4ed2754ef","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":280,"wires":[]},{"id":"ff28db877e4a9d69","type":"debug","z":"5474a5e4ed2754ef","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":440,"wires":[]},{"id":"e908bb0c08ca6634","type":"inject","z":"5474a5e4ed2754ef","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"4000","payloadType":"num","x":470,"y":380,"wires":[["4b34333b802435b0"]]},{"id":"3d13cb11.d5e754","type":"server","name":"Home Assistant","addon":true}]```

I surmise the deadband is where your hold up is. I am guessing that the value doesn’t drop instantly to 0 watts, or vice-versa, to get that difference value. It’s measuring against the last value and it never see a span as large as you defined.

I suggest just using 2 event state nodes for the triggers and separate on and off. On triggers at >5000 for x minutes and off <0 for x minutes

Wouldn’t that still result in my timer being triggered again at every polling update above 5000? I’m wanting the pump run until the end of a timer OR stop when solar drops below 5000 watts. Maybe I’m misunderstanding you, but I’ll try a new flow like you’re describing and see what I find. Thank you for helping!

I feel like the Gate node may be the answer if I can figure out how to use it. The message payload/topics thing is confusing to me.

Set the output to on/off, delete other output options

Put them both to a filter node.

image

Not only is this WORKING perfectly, but you’ve helped me learn a few key things I wasn’t understanding. Thank you so much for taking the time to help me!!

In case anyone else finds this, here was my final solution:

In the near future, I will update this flow to include polling a chlorine sensor (salt water pool), and will either replace the times with chlorination targets, or use the “range” node to map chlorine levels to pump times.

@ccaldron please post your final flow - I’d love to test

1 Like