Help 8 paralel switch one relay

I have a problem that I can't solve. I have in each room a thermostat that controls the opening or closing of the electric valve depending on the temperature set for the radiator.I have an automation that with the opening of the valve in each room gives the order of a relay attached to the gas boiler to start the heat. In my example I have 8 relay heated rooms and 8 relays placed in parallel for the control of the boiler depending on the need.Everything is going very well but I would like to give up the order of the 8 relays boiler gas and to do an automation with Node Red, something like 8 switches connected in parallel which if a contact is closed to close the circuit and if all the contacts are open then open the circuit.Something like if one of the 8 parallel switches is closed then the boiler relay is Normal Close and only if all the 8 switches are open only then it is Normal Open. Sorry for my English.

If I understand you correctly, this flow may give you a start.


The first inject sets up an flow variable with 3 entries all set to zero. When a Relay ''n' ON inject is pushed, it sets one of the parts of the flow variable to 1 and sends a signal to turn on the furnace.

when a Relay 'n' OFF is pressed it sums up the values in the flow variable. It then checks to see if it is zero and if so, turns of the furnace.

You should be able to expane it to the number of relays you need.

[{"id":"c2ed68a0.b21268","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"560bc2f8.2f7154","type":"inject","z":"c2ed68a0.b21268","name":"Relay 1 - ON","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":120,"wires":[["f2209410.fb6148"]]},{"id":"e0b7742a.f123a","type":"inject","z":"c2ed68a0.b21268","name":"Relay 2 - ON","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":160,"wires":[["71980329.a7161c"]]},{"id":"e0c1bc1.cfa5ac","type":"inject","z":"c2ed68a0.b21268","name":"Relay 3 - ON","topic":"","payload":"4","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":200,"wires":[["32efb0e.ae0c3d"]]},{"id":"cee35378.9ce2b8","type":"inject","z":"c2ed68a0.b21268","name":"Relay 1 - close","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":300,"wires":[["31539938.261606"]]},{"id":"121b0359.ff1d25","type":"inject","z":"c2ed68a0.b21268","name":"Relay 2 - close","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":340,"wires":[["1db1469c.407d21"]]},{"id":"7f0fa7f6.7e0e38","type":"inject","z":"c2ed68a0.b21268","name":"Relay 3 - close","topic":"","payload":"4","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":380,"wires":[["ef772a57.fdb5b"]]},{"id":"f6074d0e.04b688","type":"change","z":"c2ed68a0.b21268","name":"","rules":[{"t":"set","p":"switch","pt":"flow","to":"{\"1\":0,\"2\":0,\"3\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":60,"wires":[[]]},{"id":"c234efb5.06a1a8","type":"inject","z":"c2ed68a0.b21268","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":60,"wires":[["f6074d0e.04b688"]]},{"id":"c8abc5d9.f82358","type":"switch","z":"c2ed68a0.b21268","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"0","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":650,"y":340,"wires":[["c7ad2ce3.9741c"],["8f40afb0.2a91b8"],[]]},{"id":"9976b709.7133b8","type":"debug","z":"c2ed68a0.b21268","name":"ACTION","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":960,"y":240,"wires":[]},{"id":"c7ad2ce3.9741c","type":"change","z":"c2ed68a0.b21268","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Turn furnace ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":140,"wires":[["9976b709.7133b8"]]},{"id":"8f40afb0.2a91b8","type":"change","z":"c2ed68a0.b21268","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Turn furnace OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":340,"wires":[["9976b709.7133b8"]]},{"id":"f2209410.fb6148","type":"change","z":"c2ed68a0.b21268","name":"switch 1 ON","rules":[{"t":"set","p":"switch[1]","pt":"flow","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":120,"wires":[["c7ad2ce3.9741c"]]},{"id":"31539938.261606","type":"change","z":"c2ed68a0.b21268","name":"switch 1 OFF","rules":[{"t":"set","p":"switch[1]","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":300,"wires":[["5a0eb578.da1074"]]},{"id":"71980329.a7161c","type":"change","z":"c2ed68a0.b21268","name":"switch 2 ON","rules":[{"t":"set","p":"switch[2]","pt":"flow","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":160,"wires":[["c7ad2ce3.9741c"]]},{"id":"32efb0e.ae0c3d","type":"change","z":"c2ed68a0.b21268","name":"switch 3 ON","rules":[{"t":"set","p":"switch[3]","pt":"flow","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":200,"wires":[["c7ad2ce3.9741c"]]},{"id":"1db1469c.407d21","type":"change","z":"c2ed68a0.b21268","name":"switch 2 OFF","rules":[{"t":"set","p":"switch[2]","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":340,"wires":[["5a0eb578.da1074"]]},{"id":"ef772a57.fdb5b","type":"change","z":"c2ed68a0.b21268","name":"switch 3 OFF","rules":[{"t":"set","p":"switch[3]","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":380,"wires":[["5a0eb578.da1074"]]},{"id":"5a0eb578.da1074","type":"change","z":"c2ed68a0.b21268","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"switch","tot":"flow"},{"t":"set","p":"payload","pt":"msg","to":"$sum(payload.[*])\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":340,"wires":[["c8abc5d9.f82358"]]}]

This was an interesting logic challenge and I'm know there are other ways to solve it too.

Thanks I have adapted to my wishes

2 Likes

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