Node-red help with and gate

I'm having trouble setting up an AND gate. I am not sure what the input message topic needs to have in it.

As always. Thanks

the topic is the name of the device. then you want to make sure you use msg.payload.value for your payload.

Still not working.

I must not understand the topic in the header.

this is the definition in the help:
topic(mandatory) string
the topic of the message. This is mandatory because of the node configuration
string | number | object | bool
the property to test

Which node are you using? Bool gate?

Here you go - here's an example of configuring the Bool gate node for a Boolean AND test ....

  1. Here's what the sequence looks like - it has two contact sensors (Left Door and Right Door).

Screen Shot 2020-12-04 at 10.41.47 PM

  1. The AND gate is configured such that the only true condition is when Left Door is open and Right Door is closed:

  1. Left closed, Right open should be false. And Left open, Right open should also be false:

Screen Shot 2020-12-04 at 10.42.55 PM

Screen Shot 2020-12-04 at 10.43.11 PM

  1. OTOH, Left open, Right closed should return true:

Screen Shot 2020-12-04 at 10.43.28 PM

  1. Finally here's the sequence - if you want to copy and import it into your Node-RED installation.
Sequence
[{"id":"13f88029.b09e2","type":"hubitat device","z":"3943b86.98c64c8","deviceLabel":"Right Door","name":"Right Door","server":"a22e0ea9.276dc8","deviceId":"1921","attribute":"contact","sendEvent":true,"x":370,"y":1480,"wires":[["dbf53c6a.f04a88"]]},{"id":"dbf53c6a.f04a88","type":"rbe","z":"3943b86.98c64c8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload.value","x":530,"y":1440,"wires":[["5d46bba5.93707c"]]},{"id":"5416e560.e29be4","type":"hubitat device","z":"3943b86.98c64c8","deviceLabel":"Left Door","name":"","server":"a22e0ea9.276dc8","deviceId":"1920","attribute":"contact","sendEvent":true,"x":380,"y":1400,"wires":[["dbf53c6a.f04a88"]]},{"id":"5d46bba5.93707c","type":"and-gate","z":"3943b86.98c64c8","name":"","rules":[{"t":"eq","v":"open","vt":"str","propertyType":"msg","property":"payload.value","topic":"Left Door"},{"t":"eq","v":"closed","vt":"str","propertyType":"msg","property":"payload.value","topic":"Right Door"}],"outputTopic":"Status","gateType":"and","emitOnlyIfTrue":false,"x":680,"y":1440,"wires":[[]]},{"id":"a22e0ea9.276dc8","type":"hubitat config","name":"HubitatM","usetls":false,"host":"192.168.1.46","port":"80","appId":"1522","nodeRedServer":"http://192.168.1.4:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false}]

Hope this helps!

1 Like

Thanks. I appreciate the help

I just found, I think one of my headaches from last night.
image

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