NodeRed thingspeak payload

#1

Hello People im trying to send data from TTN to things speak but my payload is something like that {"payload":"F1:0.000,F2:0.000,F3:0.000,F4:0.000,"} ,thethingsspeak42 didnt work for me in node Red
but i used somethings else but i get this data in one field in my thingspeak channel, i want a way for me to separate this payload before sending it where i can have (output:F1) ,(F2)..... separately .

0 Likes

#2

So to be able to help you it would be better to have a read example of your data rather than "it's something like"
because if it's slightly different from that the advice people give you will be wrong.

Are you sure your full message in node-RED is

msg.payload.payload="F1:0.000,F2:0.000,F3:0.000,F4:0.000," 

If that is the case, you will need to move msg.payload.payload to msg.payload (using a change node)
and then you can configure the split node to split on the comma and send the results as separate messages.
each of these messages will still have the output as a string.
eg msg.payload=""F1:0.000"

0 Likes

#3

yes this is my output data ,im sorry im new to node red ,how can i change this ? i want to spilt it to 4 ouputs
like F1
F2
F3
F4

0 Likes

#4

you mean like that

0 Likes

#5

No.

With that you are Searching and replacing in the change node.
As I said you need to move so change the Change to Move

0 Likes

#6

thanks but now i have the fifth one empty ,do u know how i can remove it

0 Likes

#7

You could try playing with the switch node

or click the checkbox in the split node "Handle as a stream of messages"

0 Likes

#8

Thank you i appreciate your help

0 Likes

#9

The 5th one is empty as you are sending an empty value - (caused by the extra comma at the end of your payload...

00," 

So really the sender should not send it...

0 Likes

#10

Pleasure, I would suggest now spend time going through one of the online tutorials for Node-RED to understand the build in capabilities of some of the nodes

0 Likes

#11

the things speak42 still didnt work i dont know why? the other one in node red works but it doesnt aggregate data ,

0 Likes