Hello!
I am a beginner with Node-RED and I want to send sensor data to thingspeak.
I have already installed the thingspeak node and tested it with an injection node. Everything works fine.
But now I have the problem that I want to send data from a sensor (e.g. integer value or a string) via the right node (which also contains a field for a topic like the injection node).
I get the data (string) via the "Serial in" node
Which node can I use to also send the topic?
BR, Heimo
Hi and welcome to the world of Node-red
.
I think the node you need is the change
(yellow) node.
And when you open it, it defaults to the payload
.
Change payload
to topic
, then in the line below that you enter what you want the topic
to be.
Put the change
node anywhere you want between the serial in
node and the last node before the thingspeak
node.
Hi, im a little bit confused. I hope the pictures will help.
I get the payload via serial node and convert it from Sting To Integer. Then i set the change node (here Temperature) and from here to Thingspeak node.
I am not sure what i should write in the 2nd line because the topic should be the Temperature.
Are you trying to set the topic to a fixed value? If so then select String where your arrow is pointing and type in the string. If not a fixed string then what?
Hi,
now it works ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12)
![image](https://global.discourse-cdn.com/business6/uploads/nodered/original/3X/4/a/4a31bbcd295ccfe0046cd6f8237d5a7394538d70.png)
I set the payload to payload and the topic to the topic "Temperature" what i need as topic in the thinkspeak node.
You don't need the first Set, the payload is already the payload so you don't need to change it.
The change node only changes properties that you mention. If you don't mention it then it will be left as it is.
Yes, that sounds logical.
Thank you!