# or gate flow create

**URL:** <https://discourse.nodered.org/t/or-gate-flow-create/34036>\
**Category:** Developing Nodes\
**Created:** [10 October 2020 07:52 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036 "2020-10-10T07:52:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordirt](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jordirt](https://discourse.nodered.org/u/jordirt)\
**Post date:** [10 October 2020 07:52 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/1 "2020-10-10T07:52:25Z")

</div>

Hello guys. How to make a loggia door or. for example: I have three entities with two states each, true or false. I want to relate these three entities to a call service node. true + true + true = true  
false + true + true = true ...... false + false + false = false. How would the flow be? thank you very much

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 October 2020 08:06 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/2 "2020-10-10T08:06:42Z")

</div>

Hi @jordirt.

As a newbie, it is interesting you want to make a node from the get go.

Why not - to help you as much as anything - try to do what you want with the existing nodes?

That will help you get a better picture of how it is done. Or maybe explain to others how it is done.

All the same: good luck.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 October 2020 08:35 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/3 "2020-10-10T08:35:54Z")

</div>

> [@Trying\_to\_learn](#):
>
> As a newbie, it is interesting you want to make a node from the get go.

My guess is @jordirt has selected the wrong category in the forum.

@jordirt do you REALLY want to create a new node type (e.g. node-red-contrib-my-new-node-type) for others to install from the pallette?

Or - are you asking how to do true/false boolean logic with node-red?

Please clarify.

---

<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:** [10 October 2020 08:37 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/4 "2020-10-10T08:37:06Z")

</div>

Are all those values in one message or are they coming from different sources?

If coming from different sources in different messages then have a look at [node-red-contrib-bool-gate](https://flows.nodered.org/node/node-red-contrib-bool-gate) which may well do what you want.

---

<div class="post-metadata">

**Author:** ![jordirt](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jordirt](https://discourse.nodered.org/u/jordirt)\
**Post date:** [10 October 2020 10:23 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/5 "2020-10-10T10:23:29Z")

</div>

I already have it installed [node-red-contrib-bool-gate]  
what would be the flow of this diagram?  
plc diagran:

no:normally open.  
nc:normally closed

--(no)-----(out on)  
--(no)--

--(no)-----(out on)  
--(nc)--

--(nc)-----(out off)  
--(nc)--

---

<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:** [10 October 2020 10:34 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/6 "2020-10-10T10:34:29Z")

</div>

Show us what the messages that you wish to combine look like in a debug node.

---

<div class="post-metadata">

**Author:** ![jordirt](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jordirt](https://discourse.nodered.org/u/jordirt)\
**Post date:** [10 October 2020 14:16 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/7 "2020-10-10T14:16:13Z")

</div>

are status messages with 3 event nodes. on off or true false

---

<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:** [10 October 2020 14:50 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/8 "2020-10-10T14:50:05Z")

</div>

A description is not good enough.  
Show us what they look like in a debug node, you can paste an image here directly.

---

<div class="post-metadata">

**Author:** ![jordirt](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jordirt](https://discourse.nodered.org/u/jordirt)\
**Post date:** [10 October 2020 17:23 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/9 "2020-10-10T17:23:15Z")

</div>

sorry and thank you very much for your help. The library has found the node I need.  
`node-red-contrib-trigger-empty`

node-red-contrib-trigger-empty directly send an "On" on the given topic, when it receives an "On", on any topic. Stores the "On" per topic and if all topics that send an "On" have send an "Off", sends an "Off" on the given topic. So basically a dynamic OR gate for topics. The actual "On" and "Off" value can be entered in Config. The send value is (case-insensitive) checked against the on or off value. The entered value is send.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [10 October 2020 20:45 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/10 "2020-10-10T20:45:52Z")

</div>

You should be able to do it with an join node and a change node  
e.g.

```auto
[{"id":"5614d1b2.942f9","type":"inject","z":"7760f563.ea0324","name":"e1 true","props":[{"p":"payload.one","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":80,"wires":[["a4fb7373.782ed8"]]},{"id":"27a9f146.56ccc6","type":"inject","z":"7760f563.ea0324","name":"e1 false","props":[{"p":"payload.one","v":"false","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":120,"wires":[["a4fb7373.782ed8"]]},{"id":"c5fb5e15.d616f8","type":"inject","z":"7760f563.ea0324","name":"e2 true","props":[{"p":"payload.two","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":180,"wires":[["a4fb7373.782ed8"]]},{"id":"95fd83ff.133b58","type":"inject","z":"7760f563.ea0324","name":"e2 false","props":[{"p":"payload.two","v":"false","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":220,"wires":[["a4fb7373.782ed8"]]},{"id":"15975971.aabf07","type":"inject","z":"7760f563.ea0324","name":"e3 true","props":[{"p":"payload.three","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":280,"wires":[["a4fb7373.782ed8"]]},{"id":"d0852d7d.e52928","type":"inject","z":"7760f563.ea0324","name":"e3 false","props":[{"p":"payload.three","v":"false","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":220,"y":320,"wires":[["a4fb7373.782ed8"]]},{"id":"a4fb7373.782ed8","type":"join","z":"7760f563.ea0324","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":430,"y":140,"wires":[["5f44a725.3436b8","b7b75c67.b4beb"]]},{"id":"5f44a725.3436b8","type":"change","z":"7760f563.ea0324","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$filter(\t $each(payload, function($v){$v}),\t function($v){$v = true }\t) ? true : false","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":140,"wires":[["b7b75c67.b4beb"]]},{"id":"b7b75c67.b4beb","type":"debug","z":"7760f563.ea0324","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":480,"wires":[]}]

```

---

<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:** [9 December 2020 20:46 UTC](https://discourse.nodered.org/t/or-gate-flow-create/34036/11 "2020-12-09T20:46:08Z")

</div>

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