I need to process the msg.consumototal that my function receives.
I read and process the msg.consumototal value and I want to send a different mqtt command depending on the value that msg has.
Firstly, you've taken out the bit that will actually send a message on to the next node.
Next, you need to understand that the "commands" you list are MQTT "topics". Node-RED makes using MQTT easy because it mostly follows the same conventions.
So you can set
msg.topic = 'shellies/shellyplug1/relay/0/command' and
msg.payload = 'on'.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.