Hi,
I have been stuck on this problem for hours. It is probably an easy thing to solve, but the forum nor google resulted in a solution.
when i debug the node i get the following:
2018-11-17 22:28:18 node: msg.payload : undefined
undefined
when i look at full message i get the following:
2018-11-17 22:28:18[ ode: msg : Object
{ class: "sensor", protocol: "fineoffset", id: 247, model: "temperaturehumidity", humidity: 45 …}
If i expand it looks like this:
2018-11-17 22:28:18 node: msg : Object
object
class: "sensor"
protocol: "fineoffset"
id: 247
model: "temperaturehumidity"
humidity: 45
temp: 26.5
_msgid: "e1432419.b8f6f8"
All i want to do is to get the humidity and temp into msg.payload so i can use the values further in the flow.
Do you mean you are starting with the message that you have shown and you want to end up with the payload being an object containing just the temperature and humidity?
If so then you want something like
Slightly odd that the source provides the data like that... but...
simplest would be to use a change node to move msg.temp to msg.payload.temp and likewise humidity.
(or indeed a small function as per Colin's post above)
You haven't said what the problem is. Note that in the debug window if you click on object it will expand that so you can see what is there. If you don't know how to get the data out of the object (if that is what you need to do) have a read of the node-red docs page Working with Messages which will help you to do that. Also, if you are a beginner then watch the excellent Node red Essentials videos linked from the node red docs.
What I want at the end is to write the value of the variable that I get from Ubidots into a variable existing at PLC S7-1500.
The connection to PLC already works, but what I need is to format the Ubidots input message into boolean value that I can work with.
I just want to exclude the rest of the message that there is only the 0 (false) or 1 (true).
All in all I just want to convert "{ data_1: { value:0} }" into "0".