# Info regarding check multiples switch's status

**URL:** <https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940>\
**Category:** General\
**Created:** [3 December 2020 10:52 UTC](https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940 "2020-12-03T10:52:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![elmarsiglia](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@elmarsiglia](https://discourse.nodered.org/u/elmarsiglia)\
**Post date:** [3 December 2020 10:52 UTC](https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940/1 "2020-12-03T10:52:22Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [3 December 2020 11:13 UTC](https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940/2 "2020-12-03T11:13:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![elmarsiglia](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@elmarsiglia](https://discourse.nodered.org/u/elmarsiglia)\
**Post date:** [5 December 2020 14:07 UTC](https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940/3 "2020-12-05T14:07:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 December 2020 14:26 UTC](https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940/4 "2020-12-05T14:26:28Z")

</div>

Did you read the docs at [https://flows.nodered.org/node/node-red-contrib-bool-gate](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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 December 2020 15:36 UTC](https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940/5 "2020-12-05T15:36:42Z")

</div>

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.

```auto
[{"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":[]}]

```

---

<div class="post-metadata">

**Author:** ![elmarsiglia](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@elmarsiglia](https://discourse.nodered.org/u/elmarsiglia)\
**Post date:** [16 December 2020 13:39 UTC](https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940/6 "2020-12-16T13:39:27Z")

</div>

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

thanks again!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 February 2021 13:39 UTC](https://discourse.nodered.org/t/info-regarding-check-multiples-switchs-status/36940/7 "2021-02-14T13:39:34Z")

</div>

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