MQTT Subscription


My device takes the value in the JSON format like {Flow:65} where Flow is the Tag name and 65 is the set value when i use inject to MQTT out its working fine but i want to send this by using slider and MQTT out .

Please guide how to use it i tried to insert function in between to add value from slider like
return D;

but its not working as output is coming value is not defined

Welcome to the forum.

It isn't at all clear where you are putting that code. Is that in a function node? If so, you need to go back and look again how data is passed into a function node and how it is passed out again.

I am using a slider to pass data to function node. And i want the output of function node to be in this format {"Flow":value} where value should come from slider.

maybe try

msg.payload = { Flow : msg.payload };
return msg

Thanks for your support , its working now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.