Hi, Im trying to take 2 door stats (bools) and output a bool of if they are both open or both closed.
I have been through the boolean logic node but it outputs on 0+1 and 1+0 and i only want 0+0=0 or 1+1=1.
I have a function node trying to do an && on 2 parts of a message but i get only get null.
[{"id":"14bf1400.441aac","type":"debug","z":"aead4504.f4cd68","name":"JoinDBG","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":620,"y":180,"wires":[]},{"id":"599345c7.a9091c","type":"join","z":"aead4504.f4cd68","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":383.5,"y":260,"wires":[["247d14d3.7e4bbc","14bf1400.441aac"]]},{"id":"247d14d3.7e4bbc","type":"function","z":"aead4504.f4cd68","name":"Test","func":"if (msg.payload.coop1 === \"true\" && msg.payload.coop2 === \"true\" ) {\n msg.payload = \"open\";\n} else {\n msg.payload = \"null\";\n}\nif (msg.payload.coop1 === \"false\" && msg.payload.coop2 === \"false\" ) {\n msg.payload = \"closed\";\n} else {\n msg.payload = \"null\";\n}\nreturn msg;","outputs":1,"noerr":4,"x":530,"y":300,"wires":[["62de7928.409798"]]},{"id":"99271dc9.f9bd2","type":"inject","z":"aead4504.f4cd68","name":"","topic":"Coop1","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":200,"wires":[["599345c7.a9091c"]]},{"id":"87f10675.ceb2b8","type":"inject","z":"aead4504.f4cd68","name":"","topic":"Coop1","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":240,"wires":[["599345c7.a9091c"]]},{"id":"275aaa73.f22256","type":"inject","z":"aead4504.f4cd68","name":"","topic":"Coop2","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":280,"wires":[["599345c7.a9091c"]]},{"id":"d65510ee.27845","type":"inject","z":"aead4504.f4cd68","name":"","topic":"Coop2","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":320,"wires":[["599345c7.a9091c"]]},{"id":"62de7928.409798","type":"debug","z":"aead4504.f4cd68","name":"OutputDBG","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":300,"wires":[]}]
Any help much appreciated!