I am publishing a random temperature with topic:Test/Temperature
.
I want a chart that displays this temperature using the topic.
I am getting this error: Function tried to send a message of type string
I tried to remove the function or change the code inside the function, but it wouldn’t work.
2
Answers
@hardillb Very Helpful! I want the publisher and the subscriber to see the following values "temp" , "id" , "status"
But could the chart show only the temperature value? python code , publish , chart
Function nodes must ALWAYS return and object.
By returning just the
msg.topic
you have returned a string, which the error is correctly pointing out.The correct version of the function would be:
(But you can remove the whole function node and just set the
topic
and thepayload
in the inject node)