Hello
I have a local MQTT mosquitto broker and a Node-RED server.
Simplified diagram below:
topics:
test/variable1
test/variable2
test/variable3
payloads:
1 or 0
I would like to achieve the following effect in Node-RED:
IF payload for test/variable1 = 1
THEN
set the payload for test/variable2 with the read value of payload test/variable3 .
.
My guess is to use a function and as INPUT to use 2 MQTT IN components - one for each topic.
Please help me with the construction of the IF conditional statement inside the function for the above example.
Greetings,
Marcin
I have a local MQTT mosquitto broker and a Node-RED server.
Simplified diagram below:
topics:
test/variable1
test/variable2
test/variable3
payloads:
1 or 0
I would like to achieve the following effect in Node-RED:
IF payload for test/variable1 = 1
THEN
set the payload for test/variable2 with the read value of payload test/variable3 .
.
My guess is to use a function and as INPUT to use 2 MQTT IN components - one for each topic.
Please help me with the construction of the IF conditional statement inside the function for the above example.
Greetings,
Marcin