2022-02-01, 11:56 AM
Lots can be done inside function nodes as well >>
More info in here > https://githubhelp.com/SignalK/node-red-embedded
Code:
[
{
"id": "407fe70a51278625",
"type": "debug",
"z": "3f463f63dad2fe3c",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 790,
"y": 100,
"wires": []
},
{
"id": "a5f386c3edce3e40",
"type": "rpi-sensehatsim in",
"z": "3f463f63dad2fe3c",
"name": "",
"motion": false,
"env": true,
"stick": false,
"x": 220,
"y": 120,
"wires": [
[
"f74e9fbc25b41660"
]
]
},
{
"id": "f74e9fbc25b41660",
"type": "function",
"z": "3f463f63dad2fe3c",
"name": "",
"func": "msg1 = {payload: msg.payload.temperature, topic: \"env.outside.temperature\"};\nmsg2 = {payload: msg.payload.humidity, topic: \"env.outside.humidity\"};\nmsg3 = {payload: msg.payload.pressure, topic: \"env.outside.pressure\"};\n\nreturn [[msg1,msg2, msg3]];",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 600,
"y": 120,
"wires": [
[
"407fe70a51278625",
"7ef4965869c94839"
]
]
},
{
"id": "7ef4965869c94839",
"type": "signalk-send-pathvalue",
"z": "3f463f63dad2fe3c",
"name": "",
"source": "temp",
"meta": "",
"x": 850,
"y": 140,
"wires": []
}
]
More info in here > https://githubhelp.com/SignalK/node-red-embedded