Hi All,
I am kind of new to NODE RED and JS.
I am trying to create a flow for the following:
When a button is pressed on my RF remote, the flow must add 10 to brightness and sent MQTT message with the new value. (Button pressed is input from MQTT but emulated by a inject node at the moment), current brightness is input from MQTT WLED).
Ive created the following flow to add 10 to current value, the output is correct (10 more then current value input):
Contents of the function are:
var amount = 10;
var newmsg;
newmsg = parseInt(msg.payload, 10)
msg.payload = newmsg + amount
return msg;
Now I'd like to create a flow which verify's if a button is pressed, if yes this functions should be executed.
I've tried many solutions but do not seems to find a solution.
Can anyone help me?