Hi everyone
I am playing with node-red in 3.17 and it's pretty cool so far. I am struggeling though, with combining the differend payloads from dpGet and dpGetUnit.
What I am trying to do is displaying a chart with the given unit from the datapoint. I do get the value and the unit from the datapoint, but I can't combine/join them, to display in the same chart.
Anyone an idea or expirience with node-red?
Best regards
Aleks
Node-RED combining value and unit in one object
Search
-
- Posts: 19
- Joined: Thu Sep 05, 2013 3:51 pm
-
- Posts: 8
- Joined: Wed Jun 12, 2019 4:19 pm
Re: Node-RED combining value and unit in one object
Use a function block and pass both objects to it.
Then access the objects in the function as following
if you look at the message object in the Debug window you can choose the right path to the object and paste it in the brakets.
If you have more questions regarding node Red just say so
Greetings
Then access the objects in the function as following
Code: Select all
var msg1 = {payload: msg.payload[1]};
var msg2 = {payload: msg.payload[2]};
var ret = msg1 + " " + msg2;
return ret;
If you have more questions regarding node Red just say so
Greetings