Setting a switch value dependent on multiple other switches

Would someone please provide some direction on where to start turning a switch off when ALL other switches are off. The switch should turn on if ANY of the other switches are turned on.
I am a relatively new user and got lost looking at all the options in the docs...
Thanks, Ron

@Ronsch Ron, welcome to the forum!

Are you talking about the switch node, some physical switches, dashboard switches?

Which version of node-red and node.js are you using? (You can get these from the start up log)
What device are you running it on?
Are you using Docker?
Are you using HA?
Can you provide a copy of your flow?

It would be useful to provide this information. Remember that none of us knows any of this information and without it, it’s kind of hard to give you any help.

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

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

1 Like

The switches are connected to a Pi4 sitting on top of an Electronics-Salon DIN Power 8-Relay board (SKU MD-D1332T-1). NodeRED is version 2.2.2, I am not sure where the startup log is for the node.js, but Node RED is running in Home Assistant Core 2022.6.4, Home Assistant OS 8.1.

I also attached a screenshot of he current code presently setup for a single switch. The configuration.yaml in HA has all 8 switches defined and working using platform: rpi_gpio. The NodeRED flow works, I am ready to duplicate the remaining switches but need help with the multiple switch logic addressed in the initial post.

Any direction is greatly appreciated, Ron

The NodeRED code is

[{"id":"2246ce62a3515bbd","type":"tab","label":"Irrigation","disabled":false,"info":"","env":},{"id":"ebf7ed1e1390c6d8","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone1_low_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":60,"wires":[["33494cd0b44481cf"]]},{"id":"b581c4b5b0497a36","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zone1_moisture","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":180,"wires":[["33494cd0b44481cf"]]},{"id":"33494cd0b44481cf","type":"join","z":"2246ce62a3515bbd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":120,"wires":[["ed187143e67b8397"]]},{"id":"ed187143e67b8397","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload["sensor.zone1_moisture"] < (msg.payload["input_number.zone1_low_moisture_target"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload["sensor.zone1_moisture"] > (msg.payload["input_number.zone1_high_moisture_target"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":,"x":120,"y":280,"wires":[["b710fb5eda28f96a"],["0df6e1095b2bad33"]]},{"id":"6c29899821c462b9","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":,"deviceId":,"entityId":["switch.zone1"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":,"queue":"none","x":560,"y":320,"wires":[]},{"id":"b710fb5eda28f96a","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":240,"wires":[,["c0b95712f16ed1bc"]]},{"id":"0df6e1095b2bad33","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":320,"wires":[["6c29899821c462b9"],]},{"id":"89595e79cde24e5c","type":"comment","z":"2246ce62a3515bbd","name":"Zone1","info":"","x":70,"y":20,"wires":},{"id":"0749aa9b21af1e69","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone1_high_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":120,"wires":[["33494cd0b44481cf"]]},{"id":"c0b95712f16ed1bc","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":,"deviceId":,"entityId":["switch.zone1","switch.zone8"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":,"queue":"none","x":560,"y":240,"wires":[]},{"id":"e0a3dc5e70ce3e6f","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone2_low_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":460,"wires":[["a04baea47fcf2376"]]},{"id":"1d42c26a56f3b4af","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zone2_moisture","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":580,"wires":[["a04baea47fcf2376"]]},{"id":"a04baea47fcf2376","type":"join","z":"2246ce62a3515bbd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":520,"wires":[["5c23113422d46034"]]},{"id":"5c23113422d46034","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload["sensor.zone1_moisture"] < (msg.payload["input_number.zone1_low_moisture_target"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload["sensor.zone1_moisture"] > (msg.payload["input_number.zone1_high_moisture_target"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":,"x":120,"y":680,"wires":[["589ab1fcb02e7de4"],["171bbd83d13f4b7f"]]},{"id":"aecaba9d383332aa","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":,"deviceId":,"entityId":["switch.zone2"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":,"queue":"none","x":560,"y":720,"wires":[]},{"id":"589ab1fcb02e7de4","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":640,"wires":[,["1b47670a55bc6853"]]},{"id":"171bbd83d13f4b7f","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":720,"wires":[["aecaba9d383332aa"],]},{"id":"ca2bb01af25b2cc0","type":"comment","z":"2246ce62a3515bbd","name":"Zone2","info":"","x":70,"y":420,"wires":},{"id":"dc3b68bba119de93","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone2_high_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":520,"wires":[["a04baea47fcf2376"]]},{"id":"1b47670a55bc6853","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":,"deviceId":,"entityId":["switch.zone2","switch.zone8"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":,"queue":"none","x":560,"y":640,"wires":[]},{"id":"08f5825ac8b827e1","type":"debug","z":"2246ce62a3515bbd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":860,"wires":},{"id":"fbc5384655615df7","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":["switch.zone1","switch.zone2"],"entityidfiltertype":"list","outputinitially":true,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":220,"y":860,"wires":[["08f5825ac8b827e1"],]},{"id":"6b4e489a.41f468","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

[{"id":"1439832f6cc52926","type":"tab","label":"Humidity Control","disabled":false,"info":"","env":[]},{"id":"841a9c4201088659","type":"server-state-changed","z":"1439832f6cc52926","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.low_temp_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":220,"y":100,"wires":[["50c9a65fb12d46c0"]]},{"id":"6905102bb5742d52","type":"server-state-changed","z":"1439832f6cc52926","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.temperature_tolerance","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":160,"wires":[["50c9a65fb12d46c0"]]},{"id":"0d80cfde21f48753","type":"server-state-changed","z":"1439832f6cc52926","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.inside_temperature","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":200,"y":220,"wires":[["50c9a65fb12d46c0"]]},{"id":"50c9a65fb12d46c0","type":"join","z":"1439832f6cc52926","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":550,"y":160,"wires":[["776ae6f06bb721c3"]]},{"id":"776ae6f06bb721c3","type":"function","z":"1439832f6cc52926","name":"","func":"if (msg.payload[\"sensor.inside_temperature\"] < (msg.payload[\"input_number.low_temp_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.inside_temperature\"] > (msg.payload[\"input_number.low_temp_target\"] + msg.payload[\"input_number.temperature_tolerance\"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":160,"y":340,"wires":[["fb3f737065a940c5"],["2ca64b64aff930a0"]]},{"id":"0916ef442f946fe8","type":"api-call-service","z":"1439832f6cc52926","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.heater"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":340,"wires":[[]]},{"id":"385ba0ac8a46f87d","type":"api-call-service","z":"1439832f6cc52926","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.heater"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":400,"wires":[[]]},{"id":"fb3f737065a940c5","type":"api-current-state","z":"1439832f6cc52926","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.heater","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":400,"y":340,"wires":[["0916ef442f946fe8"],[]]},{"id":"2ca64b64aff930a0","type":"api-current-state","z":"1439832f6cc52926","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.heater","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":400,"y":400,"wires":[["385ba0ac8a46f87d"],[]]},{"id":"6b4e489a.41f468","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

This sounds like a pretty straight forward boolean operation to me. If 1 and 2 and 3 ..... then do this. Have you searched for a boolean node?
[Edit] or are you comfortable with a function node which would require either saving to context or a flow save

I installed the Boolean Ultimate package and played around a little but without luck.

No, I am not knowledgeable on saving to a context or flow save. Is this to deal with the fact that the switch values need to be persistent since they change at different times? Also, do the values need to be converted to boolean or can they stay as on/off?
Thanks, Ron

1 Like

Node red events happen at different times. So yes you will need to save the switch states somehow so you can compare them. On/off really is boolean as there is only two states so using on/off or true/false makes no difference. I'll try to gin up a sample flow.

ok here is a quick and dirty way to do it using flow.set and not context only because I chose that way.

[{"id":"3d59a21f887d0d0e","type":"tab","label":"switch test flow","disabled":false,"info":"","env":[]},{"id":"585ca93e9f6b52ce","type":"inject","z":"3d59a21f887d0d0e","name":"switch one on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw1","payload":"on","payloadType":"str","x":150,"y":100,"wires":[["4da55e7a26d4d1bb"]]},{"id":"ca98565dd7f6aa93","type":"inject","z":"3d59a21f887d0d0e","name":"switch one off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw1","payload":"off","payloadType":"str","x":150,"y":140,"wires":[["4da55e7a26d4d1bb"]]},{"id":"d090996459b3be3e","type":"inject","z":"3d59a21f887d0d0e","name":"switch two on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw2","payload":"on","payloadType":"str","x":150,"y":200,"wires":[["7705a02e917ba7c8"]]},{"id":"ef863159e62f13a1","type":"inject","z":"3d59a21f887d0d0e","name":"switch two off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw2","payload":"off","payloadType":"str","x":150,"y":240,"wires":[["7705a02e917ba7c8"]]},{"id":"cc3d36f609079913","type":"inject","z":"3d59a21f887d0d0e","name":"switch three on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw3","payload":"on","payloadType":"str","x":160,"y":300,"wires":[["9e72f871f248e3b5"]]},{"id":"280a461781aa7d9e","type":"inject","z":"3d59a21f887d0d0e","name":"switch three off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw3","payload":"off","payloadType":"str","x":160,"y":340,"wires":[["9e72f871f248e3b5"]]},{"id":"d560c674c05335de","type":"inject","z":"3d59a21f887d0d0e","name":"switch four on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw4","payload":"on","payloadType":"str","x":150,"y":400,"wires":[["d52e5083f863ede4"]]},{"id":"e49e1883675165c0","type":"inject","z":"3d59a21f887d0d0e","name":"switch four off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw4","payload":"off","payloadType":"str","x":150,"y":440,"wires":[["d52e5083f863ede4"]]},{"id":"4da55e7a26d4d1bb","type":"function","z":"3d59a21f887d0d0e","name":"status 1","func":"flow.set(\"sw1\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":120,"wires":[["96da3fc6df914c49"]]},{"id":"7705a02e917ba7c8","type":"function","z":"3d59a21f887d0d0e","name":"status 2","func":"flow.set(\"sw2\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":220,"wires":[["96da3fc6df914c49"]]},{"id":"9e72f871f248e3b5","type":"function","z":"3d59a21f887d0d0e","name":"status 3","func":"flow.set(\"sw3\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":320,"wires":[["96da3fc6df914c49"]]},{"id":"d52e5083f863ede4","type":"function","z":"3d59a21f887d0d0e","name":"status 4","func":"flow.set(\"sw4\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":420,"wires":[["96da3fc6df914c49"]]},{"id":"96da3fc6df914c49","type":"function","z":"3d59a21f887d0d0e","name":"compare","func":"let Sw1 = flow.get(\"sw1\");\nlet Sw2 = flow.get(\"sw2\");\nlet Sw3 = flow.get(\"sw3\");\nlet Sw4 = flow.get(\"sw4\");\n\nif (Sw1 == \"on\" && Sw2 == \"on\" && Sw3 == \"on\" && Sw4 == \"on\"){\n    msg = {\n        payload: \"all on\",\n        topic: \"all switches\",\n    }\n    node.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n    return msg;\n}\n\nmsg = {\n    payload: \"some off\",\n    topic: \"all switches\",\n}\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":260,"wires":[[]]}]

note that each switch has it's own topic so you know which switch is pushed. Also, you either need to initialize each switch state or push each switch once upon flow deploy so the system knows what state the switch is in. This is neither optimized nor elegant as it's just a proof of concept.

re-read your first post and this isn't an "and" situation it's an "or" situation. If any one switch is on then output a 1 or however you want to phrase that.

[{"id":"3d59a21f887d0d0e","type":"tab","label":"switch test flow","disabled":false,"info":"","env":[]},{"id":"585ca93e9f6b52ce","type":"inject","z":"3d59a21f887d0d0e","name":"switch one on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw1","payload":"on","payloadType":"str","x":150,"y":100,"wires":[["4da55e7a26d4d1bb"]]},{"id":"ca98565dd7f6aa93","type":"inject","z":"3d59a21f887d0d0e","name":"switch one off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw1","payload":"off","payloadType":"str","x":150,"y":140,"wires":[["4da55e7a26d4d1bb"]]},{"id":"d090996459b3be3e","type":"inject","z":"3d59a21f887d0d0e","name":"switch two on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw2","payload":"on","payloadType":"str","x":150,"y":200,"wires":[["7705a02e917ba7c8"]]},{"id":"ef863159e62f13a1","type":"inject","z":"3d59a21f887d0d0e","name":"switch two off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw2","payload":"off","payloadType":"str","x":150,"y":240,"wires":[["7705a02e917ba7c8"]]},{"id":"cc3d36f609079913","type":"inject","z":"3d59a21f887d0d0e","name":"switch three on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw3","payload":"on","payloadType":"str","x":160,"y":300,"wires":[["9e72f871f248e3b5"]]},{"id":"280a461781aa7d9e","type":"inject","z":"3d59a21f887d0d0e","name":"switch three off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw3","payload":"off","payloadType":"str","x":160,"y":340,"wires":[["9e72f871f248e3b5"]]},{"id":"d560c674c05335de","type":"inject","z":"3d59a21f887d0d0e","name":"switch four on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw4","payload":"on","payloadType":"str","x":150,"y":400,"wires":[["d52e5083f863ede4"]]},{"id":"e49e1883675165c0","type":"inject","z":"3d59a21f887d0d0e","name":"switch four off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sw4","payload":"off","payloadType":"str","x":150,"y":440,"wires":[["d52e5083f863ede4"]]},{"id":"4da55e7a26d4d1bb","type":"function","z":"3d59a21f887d0d0e","name":"status 1","func":"flow.set(\"sw1\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":120,"wires":[["96da3fc6df914c49"]]},{"id":"7705a02e917ba7c8","type":"function","z":"3d59a21f887d0d0e","name":"status 2","func":"flow.set(\"sw2\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":220,"wires":[["96da3fc6df914c49"]]},{"id":"9e72f871f248e3b5","type":"function","z":"3d59a21f887d0d0e","name":"status 3","func":"flow.set(\"sw3\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":320,"wires":[["96da3fc6df914c49"]]},{"id":"d52e5083f863ede4","type":"function","z":"3d59a21f887d0d0e","name":"status 4","func":"flow.set(\"sw4\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":420,"wires":[["96da3fc6df914c49"]]},{"id":"96da3fc6df914c49","type":"function","z":"3d59a21f887d0d0e","name":"compare","func":"let Sw1 = flow.get(\"sw1\");\nlet Sw2 = flow.get(\"sw2\");\nlet Sw3 = flow.get(\"sw3\");\nlet Sw4 = flow.get(\"sw4\");\n\nif (typeof Sw1 == 'undefined'){\n    Sw1 = \"off\";\n    flow.set(\"sw1\",\"off\");\n}\nif (typeof Sw2 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw2\", \"off\");\n}\nif (typeof Sw3 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw3\", \"off\");\n}\nif (typeof Sw4 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw4\", \"off\");\n}\n\nif (Sw1 == \"on\" || Sw2 == \"on\" || Sw3 == \"on\" || Sw4 == \"on\"){\n    msg = {\n        payload: \"some on\",\n        topic: \"all switches\",\n    }\n    node.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n    return msg;\n}\n\nmsg = {\n    payload: \"all off\",\n    topic: \"all switches\",\n}\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":260,"wires":[[]]}]

new flow, and sorry about that

I almost have it working (see attached). Could you finally direct me on taking the output of the Compare and getting it to the Call Service function to turn off a switch?
Thanks! Ron

[{"id":"2246ce62a3515bbd","type":"tab","label":"Irrigation","disabled":false,"info":"","env":[]},{"id":"ebf7ed1e1390c6d8","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone1_low_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":60,"wires":[["33494cd0b44481cf"]]},{"id":"b581c4b5b0497a36","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zone1_moisture","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":180,"wires":[["33494cd0b44481cf"]]},{"id":"33494cd0b44481cf","type":"join","z":"2246ce62a3515bbd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":120,"wires":[["ed187143e67b8397"]]},{"id":"ed187143e67b8397","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload[\"sensor.zone1_moisture\"] < (msg.payload[\"input_number.zone1_low_moisture_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.zone1_moisture\"] > (msg.payload[\"input_number.zone1_high_moisture_target\"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":120,"y":280,"wires":[["b710fb5eda28f96a"],["0df6e1095b2bad33"]]},{"id":"6c29899821c462b9","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone1"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":300,"wires":[[]]},{"id":"b710fb5eda28f96a","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":240,"wires":[[],["c0b95712f16ed1bc"]]},{"id":"0df6e1095b2bad33","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":300,"wires":[["6c29899821c462b9"],[]]},{"id":"89595e79cde24e5c","type":"comment","z":"2246ce62a3515bbd","name":"Zone1","info":"","x":70,"y":20,"wires":[]},{"id":"0749aa9b21af1e69","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone1_high_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":120,"wires":[["33494cd0b44481cf"]]},{"id":"c0b95712f16ed1bc","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.zone1","switch.zone8"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":240,"wires":[[]]},{"id":"e0a3dc5e70ce3e6f","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone2_low_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":460,"wires":[["a04baea47fcf2376"]]},{"id":"1d42c26a56f3b4af","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zone2_moisture","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":580,"wires":[["a04baea47fcf2376"]]},{"id":"a04baea47fcf2376","type":"join","z":"2246ce62a3515bbd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":520,"wires":[["5c23113422d46034"]]},{"id":"5c23113422d46034","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload[\"sensor.zone2_moisture\"] < (msg.payload[\"input_number.zone2_low_moisture_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.zone2_moisture\"] > (msg.payload[\"input_number.zone2_high_moisture_target\"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":120,"y":680,"wires":[["589ab1fcb02e7de4"],["171bbd83d13f4b7f"]]},{"id":"aecaba9d383332aa","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone2"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":700,"wires":[[]]},{"id":"589ab1fcb02e7de4","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":640,"wires":[[],["1b47670a55bc6853"]]},{"id":"171bbd83d13f4b7f","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":700,"wires":[["aecaba9d383332aa"],[]]},{"id":"ca2bb01af25b2cc0","type":"comment","z":"2246ce62a3515bbd","name":"Zone2","info":"","x":70,"y":420,"wires":[]},{"id":"dc3b68bba119de93","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone2_high_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":520,"wires":[["a04baea47fcf2376"]]},{"id":"1b47670a55bc6853","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.zone2"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":640,"wires":[[]]},{"id":"d5ac7f52829ab1cf","type":"function","z":"2246ce62a3515bbd","name":"status 1","func":"flow.set(\"sw1\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn [msg, null];","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":840,"wires":[["a729280365a51ab3"]]},{"id":"a729280365a51ab3","type":"function","z":"2246ce62a3515bbd","name":"compare","func":"let Sw1 = flow.get(\"sw1\");\nlet Sw2 = flow.get(\"sw2\");\nlet Sw3 = flow.get(\"sw3\");\nlet Sw4 = flow.get(\"sw4\");\n\nif (typeof Sw1 == 'undefined'){\n    Sw1 = \"off\";\n    flow.set(\"sw1\",\"off\");\n}\nif (typeof Sw2 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw2\", \"off\");\n}\nif (typeof Sw3 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw3\", \"off\");\n}\nif (typeof Sw4 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw4\", \"off\");\n}\n\nif (Sw1 == \"on\" || Sw2 == \"on\" || Sw3 == \"on\" || Sw4 == \"on\"){\n    msg = {\n        payload: \"some on\",\n        topic: \"all switches\",\n    }\n    node.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n    return msg;\n}\n\nmsg = {\n    payload: \"all off\",\n    topic: \"all switches\",\n}\n\nif (payload = \"all off\" )\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":860,"wires":[["f4e9b3e16359e1c4"]]},{"id":"b2c8c8625869bf1d","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":840,"wires":[["d5ac7f52829ab1cf"]]},{"id":"dfdafe7e82d6d1db","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.zone1","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":840,"wires":[["b2c8c8625869bf1d"]]},{"id":"57eaa9c4addf5e49","type":"function","z":"2246ce62a3515bbd","name":"status 2","func":"flow.set(\"sw2\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn [msg, null];","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":900,"wires":[["a729280365a51ab3"]]},{"id":"5666174c764b81c2","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":900,"wires":[["57eaa9c4addf5e49"]]},{"id":"3676d1ce1be19416","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.zone2","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":900,"wires":[["5666174c764b81c2"]]},{"id":"06ec1c70b356d3e8","type":"api-call-service","z":"2246ce62a3515bbd","name":"Turn Off Pump","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone8"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":780,"y":1240,"wires":[[]]},{"id":"2a421c7351c41b73","type":"debug","z":"2246ce62a3515bbd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":810,"y":1120,"wires":[]},{"id":"81e1ed3cced93e69","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone8"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":820,"y":1020,"wires":[["2a421c7351c41b73"]]},{"id":"f4e9b3e16359e1c4","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload[\"sensor.zone2_moisture\"] < (msg.payload[\"input_number.zone2_low_moisture_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.zone2_moisture\"] > (msg.payload[\"input_number.zone2_high_moisture_target\"])) {\nreturn [null, msg];\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":960,"wires":[[]]},{"id":"24779dc195df15bb","type":"comment","z":"2246ce62a3515bbd","name":"Assistance from Gerry","info":"","x":140,"y":800,"wires":[]},{"id":"6b4e489a.41f468","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

I don't think the flow came through... See attached flow

[{"id":"2246ce62a3515bbd","type":"tab","label":"Irrigation","disabled":false,"info":"","env":[]},{"id":"ebf7ed1e1390c6d8","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone1_low_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":60,"wires":[["33494cd0b44481cf"]]},{"id":"b581c4b5b0497a36","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zone1_moisture","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":180,"wires":[["33494cd0b44481cf"]]},{"id":"33494cd0b44481cf","type":"join","z":"2246ce62a3515bbd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":120,"wires":[["ed187143e67b8397"]]},{"id":"ed187143e67b8397","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload[\"sensor.zone1_moisture\"] < (msg.payload[\"input_number.zone1_low_moisture_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.zone1_moisture\"] > (msg.payload[\"input_number.zone1_high_moisture_target\"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":120,"y":280,"wires":[["b710fb5eda28f96a"],["0df6e1095b2bad33"]]},{"id":"6c29899821c462b9","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone1"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":300,"wires":[[]]},{"id":"b710fb5eda28f96a","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":240,"wires":[[],["c0b95712f16ed1bc"]]},{"id":"0df6e1095b2bad33","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":300,"wires":[["6c29899821c462b9"],[]]},{"id":"89595e79cde24e5c","type":"comment","z":"2246ce62a3515bbd","name":"Zone1","info":"","x":70,"y":20,"wires":[]},{"id":"0749aa9b21af1e69","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone1_high_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":120,"wires":[["33494cd0b44481cf"]]},{"id":"c0b95712f16ed1bc","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.zone1","switch.zone8"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":240,"wires":[[]]},{"id":"e0a3dc5e70ce3e6f","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone2_low_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":460,"wires":[["a04baea47fcf2376"]]},{"id":"1d42c26a56f3b4af","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zone2_moisture","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":580,"wires":[["a04baea47fcf2376"]]},{"id":"a04baea47fcf2376","type":"join","z":"2246ce62a3515bbd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":520,"wires":[["5c23113422d46034"]]},{"id":"5c23113422d46034","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload[\"sensor.zone2_moisture\"] < (msg.payload[\"input_number.zone2_low_moisture_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.zone2_moisture\"] > (msg.payload[\"input_number.zone2_high_moisture_target\"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":120,"y":680,"wires":[["589ab1fcb02e7de4"],["171bbd83d13f4b7f"]]},{"id":"aecaba9d383332aa","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone2"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":700,"wires":[[]]},{"id":"589ab1fcb02e7de4","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":640,"wires":[[],["1b47670a55bc6853"]]},{"id":"171bbd83d13f4b7f","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":700,"wires":[["aecaba9d383332aa"],[]]},{"id":"ca2bb01af25b2cc0","type":"comment","z":"2246ce62a3515bbd","name":"Zone2","info":"","x":70,"y":420,"wires":[]},{"id":"dc3b68bba119de93","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone2_high_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":520,"wires":[["a04baea47fcf2376"]]},{"id":"1b47670a55bc6853","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.zone2"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":640,"wires":[[]]},{"id":"d5ac7f52829ab1cf","type":"function","z":"2246ce62a3515bbd","name":"status 1","func":"flow.set(\"sw1\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn [msg, null];","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":840,"wires":[["a729280365a51ab3"]]},{"id":"a729280365a51ab3","type":"function","z":"2246ce62a3515bbd","name":"compare","func":"let Sw1 = flow.get(\"sw1\");\nlet Sw2 = flow.get(\"sw2\");\nlet Sw3 = flow.get(\"sw3\");\nlet Sw4 = flow.get(\"sw4\");\n\nif (typeof Sw1 == 'undefined'){\n    Sw1 = \"off\";\n    flow.set(\"sw1\",\"off\");\n}\nif (typeof Sw2 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw2\", \"off\");\n}\nif (typeof Sw3 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw3\", \"off\");\n}\nif (typeof Sw4 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw4\", \"off\");\n}\n\nif (Sw1 == \"on\" || Sw2 == \"on\" || Sw3 == \"on\" || Sw4 == \"on\"){\n    msg = {\n        payload: \"some on\",\n        topic: \"all switches\",\n    }\n    node.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n    return msg;\n}\n\nmsg = {\n    payload: \"all off\",\n    topic: \"all switches\",\n}\n\nif (payload = \"all off\" )\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":860,"wires":[["f4e9b3e16359e1c4"]]},{"id":"b2c8c8625869bf1d","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":840,"wires":[["d5ac7f52829ab1cf"]]},{"id":"dfdafe7e82d6d1db","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.zone1","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":840,"wires":[["b2c8c8625869bf1d"]]},{"id":"57eaa9c4addf5e49","type":"function","z":"2246ce62a3515bbd","name":"status 2","func":"flow.set(\"sw2\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn [msg, null];","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":900,"wires":[["a729280365a51ab3"]]},{"id":"5666174c764b81c2","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":900,"wires":[["57eaa9c4addf5e49"]]},{"id":"3676d1ce1be19416","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.zone2","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":900,"wires":[["5666174c764b81c2"]]},{"id":"06ec1c70b356d3e8","type":"api-call-service","z":"2246ce62a3515bbd","name":"Turn Off Pump","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone8"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":780,"y":1240,"wires":[[]]},{"id":"2a421c7351c41b73","type":"debug","z":"2246ce62a3515bbd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":810,"y":1120,"wires":[]},{"id":"81e1ed3cced93e69","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone8"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":820,"y":1020,"wires":[["2a421c7351c41b73"]]},{"id":"f4e9b3e16359e1c4","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload[\"sensor.zone2_moisture\"] < (msg.payload[\"input_number.zone2_low_moisture_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.zone2_moisture\"] > (msg.payload[\"input_number.zone2_high_moisture_target\"])) {\nreturn [null, msg];\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":960,"wires":[[]]},{"id":"24779dc195df15bb","type":"comment","z":"2246ce62a3515bbd","name":"Assistance from Gerry","info":"","x":140,"y":800,"wires":[]},{"id":"6b4e489a.41f468","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

What output do you need? On/off? Sorry won't be near computer till later tomorrow. If you can describe what you need maybe I can explain.

Other parts of my flow successfully use a Current State node on the switch entity, which feeds a Call Service node. The Call Service node specifies a Domain of 'switch', a Service of 'turn on' or 'turn off', and specifies the entity such as 'switch.zone1' to be turned on/off. Your compare node does not specify the entity, so I am not sure how to pass the 'all off' text payload back to the switch entity.

Thanks, Ron

So in the node labeled compare (I think) look in the code and find where there is a line that says
msg = {
payload: "something"
topic: "something"
}
there are two places where that is, one is for on or true and one for off or false, and change the payload to what ever you need it to be. Also, you will have to expand the switch number to whatever you have in your system. You'll have to decide which one is the one that works for you. Play around to see what does what and make sure you understand what is happening If not ask questions.

1 Like

in the flow you sent there is a line
if (payload = "all off" )
two things. it's not payload it has to be msg.payload and there has to be two "=" like "==" , using just one equals sets the value not compares it. Look at the code above it.

I don't have the nodes loaded you have so I can't be sure what is going on. Put a debug node right before the status 1 node and show me what the payload's are. You aren't comparing correctly probably as the payload going in probably isn't what I have in my code to look for.

Just as an aside - i am sure that i saw the gpio node was going to be removed in the latest version of HA - you might want to investigate what the work around is

You will find that most of the people on this forum do not use the HA Webhooks add ons and hecne can not install and run your flows.

You are better off putting in inject nodes that send the message you expect at different locations.

Craig

I have installed the HACS Raspberry Pi GPIO custom integration and deleted the original GPIO node (which was just deprecated as you mentioned). The HACS solution works great with no modifications to .yaml files.

I am a relatively new user and am not sure what you mean by the HA webhooks. NodeRED is tied to HomeAssistant in my implementation. Is there some better method I can employ to facilitate support from the forum?
Thanks, Ron

I have the flow working! I have attached the flow below if you are interested.
Gerry, thanks for the assistance, Ron

[{"id":"2246ce62a3515bbd","type":"tab","label":"Irrigation","disabled":true,"info":"","env":[]},{"id":"ebf7ed1e1390c6d8","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone1_low_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":60,"wires":[["33494cd0b44481cf"]]},{"id":"b581c4b5b0497a36","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zone1_moisture","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":180,"wires":[["33494cd0b44481cf"]]},{"id":"33494cd0b44481cf","type":"join","z":"2246ce62a3515bbd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":120,"wires":[["ed187143e67b8397"]]},{"id":"ed187143e67b8397","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload[\"sensor.zone1_moisture\"] < (msg.payload[\"input_number.zone1_low_moisture_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.zone1_moisture\"] > (msg.payload[\"input_number.zone1_high_moisture_target\"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":120,"y":280,"wires":[["b710fb5eda28f96a"],["0df6e1095b2bad33"]]},{"id":"6c29899821c462b9","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone1"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":300,"wires":[[]]},{"id":"b710fb5eda28f96a","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":480,"y":240,"wires":[["c0b95712f16ed1bc"],[]]},{"id":"0df6e1095b2bad33","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":480,"y":300,"wires":[["6c29899821c462b9"],[]]},{"id":"89595e79cde24e5c","type":"comment","z":"2246ce62a3515bbd","name":"Zone1","info":"","x":70,"y":20,"wires":[]},{"id":"0749aa9b21af1e69","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone1_high_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":120,"wires":[["33494cd0b44481cf"]]},{"id":"c0b95712f16ed1bc","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.zone1","switch.zone8"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":240,"wires":[[]]},{"id":"e0a3dc5e70ce3e6f","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone2_low_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":460,"wires":[["a04baea47fcf2376"]]},{"id":"1d42c26a56f3b4af","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.zone2_moisture","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":580,"wires":[["a04baea47fcf2376"]]},{"id":"a04baea47fcf2376","type":"join","z":"2246ce62a3515bbd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":520,"wires":[["5c23113422d46034"]]},{"id":"5c23113422d46034","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload[\"sensor.zone2_moisture\"] < (msg.payload[\"input_number.zone2_low_moisture_target\"])) {\nreturn [msg, null];\n}\n\nelse if (msg.payload[\"sensor.zone2_moisture\"] > (msg.payload[\"input_number.zone2_high_moisture_target\"])) {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":120,"y":680,"wires":[["589ab1fcb02e7de4"],["171bbd83d13f4b7f"]]},{"id":"aecaba9d383332aa","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone2"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":580,"y":700,"wires":[[]]},{"id":"589ab1fcb02e7de4","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":640,"wires":[["1b47670a55bc6853"],[]]},{"id":"171bbd83d13f4b7f","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":700,"wires":[["aecaba9d383332aa"],[]]},{"id":"ca2bb01af25b2cc0","type":"comment","z":"2246ce62a3515bbd","name":"Zone2","info":"","x":70,"y":420,"wires":[]},{"id":"dc3b68bba119de93","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zone2_high_moisture_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":520,"wires":[["a04baea47fcf2376"]]},{"id":"1b47670a55bc6853","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.zone2","switch.zone8"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":580,"y":640,"wires":[[]]},{"id":"d5ac7f52829ab1cf","type":"function","z":"2246ce62a3515bbd","name":"status 1","func":"flow.set(\"sw1\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn [msg, null];","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":840,"wires":[["a729280365a51ab3"]]},{"id":"a729280365a51ab3","type":"function","z":"2246ce62a3515bbd","name":"compare","func":"let Sw1 = flow.get(\"sw1\");\nlet Sw2 = flow.get(\"sw2\");\nlet Sw3 = flow.get(\"sw3\");\nlet Sw4 = flow.get(\"sw4\");\n\nif (typeof Sw1 == 'undefined'){\n    Sw1 = \"off\";\n    flow.set(\"sw1\",\"off\");\n}\nif (typeof Sw2 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw2\", \"off\");\n}\nif (typeof Sw3 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw3\", \"off\");\n}\nif (typeof Sw4 == 'undefined') {\n    Sw1 = \"off\";\n    flow.set(\"sw4\", \"off\");\n}\n\nif (Sw1 == \"on\" || Sw2 == \"on\" || Sw3 == \"on\" || Sw4 == \"on\"){\n    msg = {\n        payload: \"some on\",\n        topic: \"all switches\",\n    }\n    node.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n    return msg;\n}\n\nmsg = {\n    payload: \"all off\",\n    topic: \"all switches\",\n}\n\nif (msg.payload == \"all off\" )\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.payload });\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":860,"wires":[["f4e9b3e16359e1c4"]]},{"id":"b2c8c8625869bf1d","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"switch.zone1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":400,"y":840,"wires":[["d5ac7f52829ab1cf"]]},{"id":"dfdafe7e82d6d1db","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.zone1","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":840,"wires":[["b2c8c8625869bf1d"]]},{"id":"57eaa9c4addf5e49","type":"function","z":"2246ce62a3515bbd","name":"status 2","func":"flow.set(\"sw2\",msg.payload);\n\nnode.status({ fill: \"blue\", shape: \"ring\", text: msg.topic + \"  \" + msg.payload });\n    \nreturn [msg, null];","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":900,"wires":[["a729280365a51ab3"]]},{"id":"5666174c764b81c2","type":"api-current-state","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"switch.zone2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":400,"y":900,"wires":[["57eaa9c4addf5e49"]]},{"id":"3676d1ce1be19416","type":"server-state-changed","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.zone2","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":900,"wires":[["5666174c764b81c2"]]},{"id":"81e1ed3cced93e69","type":"api-call-service","z":"2246ce62a3515bbd","name":"","server":"6b4e489a.41f468","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.zone8"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":1000,"wires":[[]]},{"id":"f4e9b3e16359e1c4","type":"function","z":"2246ce62a3515bbd","name":"","func":"if (msg.payload == \"all off\" ) {\nreturn [msg, null];\n}\n\nelse  {\nreturn [null, msg];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":940,"wires":[["81e1ed3cced93e69"],[]]},{"id":"24779dc195df15bb","type":"comment","z":"2246ce62a3515bbd","name":"Assistance from Gerry","info":"","x":120,"y":800,"wires":[]},{"id":"b2546ac78afa18da","type":"debug","z":"2246ce62a3515bbd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":350,"y":380,"wires":[]},{"id":"04e5f5cceda483e6","type":"gate","z":"2246ce62a3515bbd","name":"","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"memory","x":750,"y":180,"wires":[[]]},{"id":"6b4e489a.41f468","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
1 Like

the HA Webhooks are the collection of nodes that are installed into the NR pallette.

All of the ones you see on the left in light blue that allow you to access Services, states and the like in HA - these are not native NR nodes but are provided by the web developer here

Craig