How to create function on rpi node red with two gpio - if gpio1 == 1 && gpio2 ==0 then gpio3=1

Ah the joy of javascript....
your combined payloads look like this
image
all good so far
Then your function does this
if (msg.payload.pi/35 == 1 && msg.payload.pi/37 == 1) {

which is a natural thing to do... but javascript doesn't like / in property names so it will be treating it like a divide :-)... so instead you need to do

if (msg.payload["pi/35"] == 1 && msg.payload["pi/37"] == 1) {

1 Like