-
I have the following flow in Node-RED: Click to view JSON...[
{
"id": "0cadd5ea4f5be27e",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "e644ddfbe936d292",
"type": "signalk-on-delta",
"z": "0cadd5ea4f5be27e",
"name": "[self] Location Data",
"context": "vessels.self",
"flatten": true,
"x": 130,
"y": 120,
"wires": [
[
"04409d7fef7f95b0",
"8e1d736d0ab5be67",
"25f83e73f72f52d3",
"d158c1fa4364385d"
]
]
},
{
"id": "6c35a75c863e0f70",
"type": "ui_text",
"z": "0cadd5ea4f5be27e",
"group": "cc3cbcae8a4cb332",
"order": 1,
"width": "0",
"height": "0",
"name": "",
"label": "latitude",
"format": "{{msg.payload}}",
"layout": "row-spread",
"className": "",
"x": 600,
"y": 60,
"wires": []
},
{
"id": "566fa65bf263a78e",
"type": "ui_text",
"z": "0cadd5ea4f5be27e",
"group": "cc3cbcae8a4cb332",
"order": 2,
"width": "0",
"height": "0",
"name": "",
"label": "longitude",
"format": "{{msg.payload}}",
"layout": "row-spread",
"className": "",
"x": 600,
"y": 100,
"wires": []
},
{
"id": "04409d7fef7f95b0",
"type": "change",
"z": "0cadd5ea4f5be27e",
"name": "latitude",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.latitude",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 340,
"y": 60,
"wires": [
[
"15a81e1eb1bb1be3"
]
]
},
{
"id": "8e1d736d0ab5be67",
"type": "change",
"z": "0cadd5ea4f5be27e",
"name": "longitude",
"rules": [
{
"t": "move",
"p": "payload.longitude",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 340,
"y": 100,
"wires": [
[
"4a32ae5ee87dcca0"
]
]
},
{
"id": "15a81e1eb1bb1be3",
"type": "function",
"z": "0cadd5ea4f5be27e",
"name": "5dp",
"func": "if (msg.payload != null) {\n msg.payload = msg.payload.toFixed(5);\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 470,
"y": 60,
"wires": [
[
"6c35a75c863e0f70"
]
]
},
{
"id": "4a32ae5ee87dcca0",
"type": "function",
"z": "0cadd5ea4f5be27e",
"name": "5dp",
"func": "if (msg.payload != null) {\n msg.payload = msg.payload.toFixed(5);\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 470,
"y": 100,
"wires": [
[
"566fa65bf263a78e"
]
]
},
{
"id": "25f83e73f72f52d3",
"type": "function",
"z": "0cadd5ea4f5be27e",
"name": "location (self)",
"func": "if (msg.payload != null) {\n msg.payload.name = \"self\";\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 180,
"wires": [
[
"e0ec963913cbf7a9",
"de5c4044.d4e0f"
]
]
},
{
"id": "de5c4044.d4e0f",
"type": "worldmap-tracks",
"z": "0cadd5ea4f5be27e",
"name": "Path (self)",
"depth": "5",
"layer": "combined",
"smooth": false,
"x": 540,
"y": 140,
"wires": [
[
"e0ec963913cbf7a9"
]
]
},
{
"id": "e0ec963913cbf7a9",
"type": "ui_worldmap",
"z": "0cadd5ea4f5be27e",
"group": "cc3cbcae8a4cb332",
"order": 4,
"width": "8",
"height": "8",
"name": "Map",
"lat": "",
"lon": "",
"zoom": "",
"layer": "OSMC",
"cluster": "",
"maxage": "",
"usermenu": "hide",
"layers": "hide",
"panit": "false",
"panlock": "false",
"zoomlock": "false",
"hiderightclick": "true",
"coords": "none",
"showgrid": "true",
"allowFileDrop": "false",
"path": "/worldmap",
"overlist": "DR,CO,RA,DN,SN,HM",
"maplist": "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop",
"mapname": "",
"mapurl": "",
"mapopt": "",
"mapwms": false,
"x": 750,
"y": 200,
"wires": []
},
{
"id": "d158c1fa4364385d",
"type": "function",
"z": "0cadd5ea4f5be27e",
"name": "location (audio)",
"func": "if (msg.payload != null) {\n msg.payload.name = \"audio\";\n msg.payload.latitude += 0.1;\n msg.payload.longitude += 0.1;\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 220,
"wires": [
[
"e0ec963913cbf7a9",
"617d1bd54133a094"
]
]
},
{
"id": "61eeee703dbe89fb",
"type": "comment",
"z": "0cadd5ea4f5be27e",
"name": "Location View",
"info": "",
"x": 130,
"y": 80,
"wires": []
},
{
"id": "617d1bd54133a094",
"type": "worldmap-tracks",
"z": "0cadd5ea4f5be27e",
"name": "Path (audio)",
"depth": "5",
"layer": "combined",
"smooth": false,
"x": 550,
"y": 260,
"wires": [
[
"e0ec963913cbf7a9"
]
]
},
{
"id": "cc3cbcae8a4cb332",
"type": "ui_group",
"name": "Location",
"tab": "0550edd77a3f3e78",
"order": 1,
"disp": true,
"width": "8",
"collapse": false,
"className": ""
},
{
"id": "0550edd77a3f3e78",
"type": "ui_tab",
"name": "Home",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
] However, if I flatten the An alternative would be to So, how can I get the value of paths like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
will result in one Node-RED message for each value.
|
Beta Was this translation helpful? Give feedback.
Flatten
does not only give you latitude and longitude, it "flattens" data so that a single Signal K Delta message with multiple values likewill result in one Node-RED message for each value.
signalk-on-delta
node will give …