Info regarding check multiples switch's status

Hi guys, i am trying to build a node (if all of them off do something) and i could find a way to check in only one "events-state" multiple switches. i tried from homeassisant to aggregate in a group but from nodered i couldnt see them. any help? thanks!

Welcome to the forum @elmarsiglia.

Have a look at node-red-contrib-bool-gate which can be used to build an OR gate which will output true when any of its inputs (which are passed in multiple messages identified by topic) is true. Or to put it the other way round it will output false when all of the inputs are false, which you can use to trigger your flow.

thanks colin, i tried to understand how it works but i couldnt... do you know where i can found any examples? especially controlling switches/sensors

thanks again

Did you read the docs at https://flows.nodered.org/node/node-red-contrib-bool-gate?

If you are a complete beginner with node-red then I suggest watching the Node red Essentials videos which are linked from the node red docs. Also read the docs page Working with Messages. Having done all that tell us what you don't understand if necessary.
In use you just feed the inputs in, making sure they all have unique topics, and set the rule up in the node.

Here is an example of what you want, it uses the node as a NOR gate which will give msg.bool true when both inputs are Off and false otherwise which I think is what you wanted.

[{"id":"42e6c82f.11dd98","type":"inject","z":"8d186557.30e068","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ip1","payload":"On","payloadType":"str","x":110,"y":1060,"wires":[["24b7d81c.8c87"]]},{"id":"5830057c.139964","type":"inject","z":"8d186557.30e068","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ip1","payload":"Off","payloadType":"str","x":110,"y":1100,"wires":[["24b7d81c.8c87"]]},{"id":"efceae9a.4cce3","type":"inject","z":"8d186557.30e068","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ip2","payload":"On","payloadType":"str","x":110,"y":1200,"wires":[["24b7d81c.8c87"]]},{"id":"288e5cdd.1dc2cc","type":"inject","z":"8d186557.30e068","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ip2","payload":"Off","payloadType":"str","x":110,"y":1240,"wires":[["24b7d81c.8c87"]]},{"id":"24b7d81c.8c87","type":"or-gate","z":"8d186557.30e068","name":"ip1 NOR ip2","rules":[{"t":"eq","v":"On","vt":"str","propertyType":"msg","property":"payload","topic":"ip1"},{"t":"eq","v":"On","vt":"str","propertyType":"msg","property":"payload","topic":"ip2"}],"outputTopic":"","gateType":"nor","emitOnlyIfTrue":false,"x":310,"y":1140,"wires":[["3e29cd4a.f973e2"]]},{"id":"3e29cd4a.f973e2","type":"debug","z":"8d186557.30e068","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":410,"y":1200,"wires":[]}]

Thanks so much, took me a while but at the end i did it!

thanks again!

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