Help with or gate

I cant get the or gate to output properly, with 2 trues coming in i still get a false out?

[{"id":"fe6acb18.1c8208","type":"change","z":"4f2cae6a.c5ec8","name":"","rules":[{"t":"set","p":"Topic","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":680,"wires":[["7eec938.9f9b96c"]]},{"id":"682a178.334cfe8","type":"change","z":"4f2cae6a.c5ec8","name":"","rules":[{"t":"set","p":"Topic","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":640,"wires":[["7eec938.9f9b96c"]]},{"id":"42bc4b0c.8406d4","type":"debug","z":"4f2cae6a.c5ec8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1070,"y":580,"wires":[]},{"id":"ebff4061.b6e0a","type":"change","z":"4f2cae6a.c5ec8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"bool","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1310,"y":620,"wires":[["9214a6c5.e035e8","f5eaf37a.8c857"]]},{"id":"7eec938.9f9b96c","type":"or-gate","z":"4f2cae6a.c5ec8","name":"OR Gate","rules":[{"t":"true","propertyType":"msg","property":"payload","topic":"1"},{"t":"true","propertyType":"msg","property":"payload","topic":"2"}],"outputTopic":"","gateType":"or","emitOnlyIfTrue":false,"x":1260,"y":680,"wires":[["1d588f66.a993d1","ebff4061.b6e0a"]]},{"id":"1d588f66.a993d1","type":"debug","z":"4f2cae6a.c5ec8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"bool","targetType":"msg","statusVal":"payload","statusType":"auto","x":1300,"y":760,"wires":[]},{"id":"9214a6c5.e035e8","type":"ui_led","z":"4f2cae6a.c5ec8","group":"4aff2917.bb1b98","order":6,"width":0,"height":0,"label":"Fan ON","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"false","valueType":"bool"},{"color":"green","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"name":"","x":1310,"y":560,"wires":[]},{"id":"f5eaf37a.8c857","type":"debug","z":"4f2cae6a.c5ec8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1360,"y":500,"wires":[]},{"id":"53548897.3f5438","type":"debug","z":"4f2cae6a.c5ec8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1040,"y":740,"wires":[]},{"id":"ddf3fcfd.1eb84","type":"debug","z":"4f2cae6a.c5ec8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":830,"y":740,"wires":[]},{"id":"d6911f5.5450ee","type":"function","z":"4f2cae6a.c5ec8","name":"on/off humidity","func":"if (msg.payload > 60) {\n    var msg1 = {payload:\"true\"};\n   return [ msg1];\n   } \n   if (msg.payload < 55) {\n    var msg2 = {payload:\"false\"};\n   return [ msg2];\n}\nelse {\n    var msg3 = {payload:\"true\"};\n   return [ msg3];\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":700,"wires":[["53548897.3f5438","fe6acb18.1c8208"]]},{"id":"1f29ca1e.f6d766","type":"debug","z":"4f2cae6a.c5ec8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":830,"y":640,"wires":[]},{"id":"3810fb1d.09a5b4","type":"function","z":"4f2cae6a.c5ec8","name":"on/off temp","func":"if (msg.payload > 75) {\n    var msg1 = {payload:\"true\"};\n   return [ msg1];\n   } \n   if (msg.payload < 72) {\n    var msg2 = {payload:\"false\"};\n   return [ msg2];\n}\nelse {\n    var msg3 = {payload:\"true\"};\n   return [ msg3];\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":600,"wires":[["42bc4b0c.8406d4","682a178.334cfe8"]]},{"id":"409407bd.a54dd8","type":"smooth","z":"4f2cae6a.c5ec8","name":"return max","property":"payload","action":"max","count":"6","round":"","mult":"single","reduce":false,"x":650,"y":600,"wires":[["3810fb1d.09a5b4","1f29ca1e.f6d766"]]},{"id":"7091e5a4.63340c","type":"smooth","z":"4f2cae6a.c5ec8","name":"return max","property":"payload","action":"max","count":"6","round":"","mult":"single","reduce":false,"x":650,"y":700,"wires":[["d6911f5.5450ee","ddf3fcfd.1eb84"]]},{"id":"992b3493.cc3e68","type":"function","z":"4f2cae6a.c5ec8","name":"humidity","func":"msg.payload = msg.humidity\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":700,"wires":[["7091e5a4.63340c"]]},{"id":"99a0089d.548a98","type":"function","z":"4f2cae6a.c5ec8","name":" c to f","func":"msg.payload = msg.payload *1.8 +32\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":600,"wires":[["409407bd.a54dd8"]]},{"id":"271eb428.1a9a1c","type":"rpi-dht22","z":"4f2cae6a.c5ec8","name":"#1 dht11","topic":"rpi-dht22","dht":22,"pintype":"0","pin":4,"x":300,"y":600,"wires":[["99a0089d.548a98","992b3493.cc3e68"]]},{"id":"81675de5.e45bf","type":"rpi-dht22","z":"4f2cae6a.c5ec8","name":"#2","topic":"rpi-dht22","dht":22,"pintype":"0","pin":"17","x":290,"y":640,"wires":[["99a0089d.548a98","992b3493.cc3e68"]]},{"id":"10659ac4.ea9d35","type":"rpi-dht22","z":"4f2cae6a.c5ec8","name":"#3","topic":"rpi-dht22","dht":22,"pintype":"0","pin":"27","x":290,"y":680,"wires":[["99a0089d.548a98","992b3493.cc3e68"]]},{"id":"24246dc7.65b072","type":"inject","z":"4f2cae6a.c5ec8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":true,"onceDelay":"1","topic":"fan","payload":"","payloadType":"date","x":120,"y":640,"wires":[["271eb428.1a9a1c","81675de5.e45bf","10659ac4.ea9d35"]]},{"id":"4aff2917.bb1b98","type":"ui_group","z":"","name":"Main","tab":"7dd97b74.960734","order":1,"disp":true,"width":"6","collapse":false},{"id":"7dd97b74.960734","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

The or-gate isn't a standard node, what have you installed to get that? node-red-contrib-something probably.

Bool node

Which bool node? There are several, that is why I asked for the full name

node-red-contrib-bool-gate 1.0.2

Note that in javascript and node-red names are case sensitive, therefore the property topic is not the same as the property Topic. So when the bool node says that it uses the incoming topic it is not useful to set msg.Topic.

changing the case did not fix it?

Add a debug node showing what is going into the or gate and another showing what is coming out, give the debug nodes names and paste a screenshot what you see here.

[Edit] In particular check that the type of the value in payload (string or number for example) matches the type that you have specified in the OR gate.

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