# Confused about combine logic result

**URL:** <https://discourse.nodered.org/t/confused-about-combine-logic-result/27368>\
**Category:** General\
**Created:** [27 May 2020 11:44 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368 "2020-05-27T11:44:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benno](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Benno](https://discourse.nodered.org/u/Benno)\
**Post date:** [27 May 2020 11:44 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/1 "2020-05-27T11:44:50Z")

</div>

Hi,

Thanks in advance to everyone who can help me with this problem.

With the combine node I evaluate a few window sensors (OR-Node) and 2 motion sensors (OR-Node). So far all are fine.  
But why is the AND-combination of the OR-node-results "true" AND "false" equal to "true" ???  
Do I understand the logic nodes wrong?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/94199644a22bf8b3b6968951e8bfd4d5d0445e52.png)

---

<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:** [27 May 2020 12:38 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/2 "2020-05-27T12:38:26Z")

</div>

As shown in the image it does look wrong.  
Tell us which node you are using (node-red-contrib-something possibly) and if you can, post a mini flow with the ORs AND and some inject nodes so that we can see if we can replicate the problem.

---

<div class="post-metadata">

**Author:** ![Benno](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Benno](https://discourse.nodered.org/u/Benno)\
**Post date:** [27 May 2020 13:10 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/3 "2020-05-27T13:10:09Z")

</div>

Hi Colin,

thanks for the quick reply. I´m using

node-red-contrib-combine 1.8.1 - combine-logic

I´ll also tested it with a simplified flow (please find it below).  
I exchanged the windows sensors against injection nodes  
Same issue.

[{"id":"c8b402b.103ff","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"268bff60.82206","type":"inject","z":"c8b402b.103ff","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":60,"wires":[["99eb519d.61be4"]]},{"id":"9d37c733.34e798","type":"inject","z":"c8b402b.103ff","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":380,"wires":[["7b88fb15.e9a524"]]},{"id":"3022200a.7b054","type":"inject","z":"c8b402b.103ff","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":100,"wires":[["99eb519d.61be4"]]},{"id":"bde79660.65b108","type":"inject","z":"c8b402b.103ff","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":220,"wires":[["7b88fb15.e9a524"]]},{"id":"c80e348b.cf7a18","type":"inject","z":"c8b402b.103ff","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":260,"wires":[["7b88fb15.e9a524"]]},{"id":"b8f39d9a.7b17c","type":"inject","z":"c8b402b.103ff","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":300,"wires":[["7b88fb15.e9a524"]]},{"id":"ef65333f.41dfc","type":"inject","z":"c8b402b.103ff","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":340,"wires":[["7b88fb15.e9a524"]]},{"id":"99eb519d.61be4","type":"combine-logic","z":"c8b402b.103ff","name":"","topic":"","operator":"or","defer":250,"timeout":0,"distinction":"topic","x":700,"y":60,"wires":[["53929354.27255c"]]},{"id":"7b88fb15.e9a524","type":"combine-logic","z":"c8b402b.103ff","name":"","topic":"","operator":"or","defer":250,"timeout":0,"distinction":"topic","x":700,"y":220,"wires":[["53929354.27255c"]]},{"id":"53929354.27255c","type":"combine-logic","z":"c8b402b.103ff","name":"","topic":"","operator":"and","defer":250,"timeout":0,"distinction":"topic","x":980,"y":60,"wires":[["bf5b352e.c337a8"]]},{"id":"bf5b352e.c337a8","type":"debug","z":"c8b402b.103ff","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1200,"y":60,"wires":}]

---

<div class="post-metadata">

**Author:** ![Benno](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Benno](https://discourse.nodered.org/u/Benno)\
**Post date:** [27 May 2020 13:18 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/4 "2020-05-27T13:18:02Z")

</div>

In addition I also tested it on another Node-RED docker instance, with the same result:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5a3cd8fa5a438505d5f152dc6d8128bd13585584.png)

---

<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:** [27 May 2020 14:34 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/5 "2020-05-27T14:34:22Z")

</div>

Can you read this guide on how to post the flow so that it is importable (otherwise the forum messes with the format) and edit your previous post, then I will be able to try it.  
[https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506/4](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506/4)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [27 May 2020 15:33 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/6 "2020-05-27T15:33:31Z")

</div>

It would seem the node holds a message for the length of time you specify and then releases. In your case, you have it set to 250 ms so if a msg arrives and after 250ms no other msg has arrived, the msg is sent on.

As for how it works, I'm confused and can't figure out the logic it uses.

You might want to take a look at [node-red-contrib-boolean-logic](https://flows.nodered.org/node/node-red-contrib-boolean-logic) which seems to be understandable (at least to me)

---

<div class="post-metadata">

**Author:** ![Benno](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Benno](https://discourse.nodered.org/u/Benno)\
**Post date:** [27 May 2020 15:59 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/7 "2020-05-27T15:59:21Z")

</div>

Sorry Colin,

it was my first post here! 🙈

I hope it´s in the right format now. Thanks a lot for your help!

```auto
[{"id":"7ebdfe4c.5254a","type":"inject","z":"d5bbd0a3.e14e2","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":60,"wires":[["cbbdcdfe.65d8e"]]},{"id":"588b3ec.b1f68c","type":"inject","z":"d5bbd0a3.e14e2","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":380,"wires":[["271a5743.be0368"]]},{"id":"544f1e5f.a08da","type":"inject","z":"d5bbd0a3.e14e2","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":100,"wires":[["cbbdcdfe.65d8e"]]},{"id":"85e5a7a8.be6028","type":"inject","z":"d5bbd0a3.e14e2","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":220,"wires":[["271a5743.be0368"]]},{"id":"391f29d2.32d276","type":"inject","z":"d5bbd0a3.e14e2","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":260,"wires":[["271a5743.be0368"]]},{"id":"78ed2d88.b70dd4","type":"inject","z":"d5bbd0a3.e14e2","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":300,"wires":[["271a5743.be0368"]]},{"id":"a3172bc6.2707c8","type":"inject","z":"d5bbd0a3.e14e2","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":340,"wires":[["271a5743.be0368"]]},{"id":"8734d296.18bd6","type":"debug","z":"d5bbd0a3.e14e2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1200,"y":60,"wires":[]},{"id":"cbbdcdfe.65d8e","type":"combine-logic","z":"d5bbd0a3.e14e2","name":"","topic":"","operator":"or","defer":250,"timeout":0,"distinction":"topic","x":700,"y":60,"wires":[["eae11a0c.a30cb8"]]},{"id":"271a5743.be0368","type":"combine-logic","z":"d5bbd0a3.e14e2","name":"","topic":"","operator":"or","defer":250,"timeout":0,"distinction":"topic","x":700,"y":220,"wires":[["eae11a0c.a30cb8"]]},{"id":"eae11a0c.a30cb8","type":"combine-logic","z":"d5bbd0a3.e14e2","name":"","topic":"","operator":"and","defer":250,"timeout":0,"distinction":"topic","x":980,"y":60,"wires":[["8734d296.18bd6"]]}]

```

---

<div class="post-metadata">

**Author:** ![Benno](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Benno](https://discourse.nodered.org/u/Benno)\
**Post date:** [27 May 2020 16:03 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/8 "2020-05-27T16:03:16Z")

</div>

Thanks Zenofmud,

I will also give it a try with the [node-red-contrib-boolean-logic](https://flows.nodered.org/node/node-red-contrib-boolean-logic)

---

<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:** [26 July 2020 16:03 UTC](https://discourse.nodered.org/t/confused-about-combine-logic-result/27368/9 "2020-07-26T16:03:20Z")

</div>

Closed on 26 July 2020 16:03 UTC

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