Code:
[
{
"id": "cfb5e834.bcffe8",
"type": "websocket in",
"z": "81f31ab4.b5ae08",
"name": "",
"server": "e72c4f8c.f387b",
"client": "",
"x": 190,
"y": 156,
"wires": [
[
"61a24b8d.5cce74"
]
]
},
{
"id": "61a24b8d.5cce74",
"type": "json",
"z": "81f31ab4.b5ae08",
"name": "",
"x": 111.5,
"y": 325,
"wires": [
[
"c381a62.7d39058",
"e87a7cf0.8c573",
"dc7827ec.752098"
]
]
},
{
"id": "2da1de6a.adc842",
"type": "debug",
"z": "81f31ab4.b5ae08",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 1017,
"y": 400,
"wires": []
},
{
"id": "e87a7cf0.8c573",
"type": "jsonpath",
"z": "81f31ab4.b5ae08",
"expression": "$.updates..values[?(@.path==\"environment.outside.pressure\")]..value",
"split": true,
"name": "environment.outside.pressure",
"x": 334,
"y": 463,
"wires": [
[
"aa7f89f4.b82938"
]
]
},
{
"id": "aa7f89f4.b82938",
"type": "delay",
"z": "81f31ab4.b5ae08",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "5",
"rateUnits": "minute",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 586,
"y": 459,
"wires": [
[
"63e445c7.b275ac"
]
]
},
{
"id": "63e445c7.b275ac",
"type": "function",
"z": "81f31ab4.b5ae08",
"name": "Convert to hPa",
"func": "msg.payload = msg.payload /100 ;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 805,
"y": 465,
"wires": [
[
"2da1de6a.adc842",
"2ae5cf.64e1aa32",
"f9c49486.cb6a48",
"1e649d21.5ee2c3"
]
]
},
{
"id": "2ae5cf.64e1aa32",
"type": "ui_chart",
"z": "81f31ab4.b5ae08",
"name": "Pressure",
"group": "222ca4ec.fecbdc",
"order": 0,
"width": 0,
"height": 0,
"label": "Surface Pressure (hPa)",
"chartType": "line",
"legend": "false",
"xformat": "%H:%M",
"interpolate": "basis",
"nodata": "",
"ymin": "",
"ymax": "",
"removeOlder": "24",
"removeOlderUnit": "3600",
"x": 832,
"y": 600,
"wires": [
[
"a95eaa5d.c11a98"
],
[]
]
},
{
"id": "dc7827ec.752098",
"type": "debug",
"z": "81f31ab4.b5ae08",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 445,
"y": 292,
"wires": []
},
{
"id": "f9c49486.cb6a48",
"type": "ui_text",
"z": "81f31ab4.b5ae08",
"group": "222ca4ec.fecbdc",
"order": 0,
"width": 0,
"height": 0,
"name": "current pressure (hPa)",
"label": "Current Pressure",
"format": "{{msg.payload | number:0}}",
"layout": "row-spread",
"x": 1042,
"y": 478,
"wires": []
},
{
"id": "a95eaa5d.c11a98",
"type": "file",
"z": "81f31ab4.b5ae08",
"name": "Chart dump",
"filename": "/home/pi/ds-charts/pressure.dump",
"appendNewline": true,
"createDir": true,
"overwriteFile": "true",
"x": 1027,
"y": 592,
"wires": []
},
{
"id": "55be5b6f.98b964",
"type": "inject",
"z": "81f31ab4.b5ae08",
"name": "Startup",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": true,
"x": 274,
"y": 607,
"wires": [
[
"1de98e8.3039b72"
]
]
},
{
"id": "1de98e8.3039b72",
"type": "file in",
"z": "81f31ab4.b5ae08",
"name": "Chart dump",
"filename": "/home/pi/ds-charts/pressure.dump",
"format": "utf8",
"x": 455,
"y": 604,
"wires": [
[
"9a787c23.87eb9"
]
]
},
{
"id": "9a787c23.87eb9",
"type": "json",
"z": "81f31ab4.b5ae08",
"name": "",
"x": 654,
"y": 603,
"wires": [
[
"2ae5cf.64e1aa32"
]
]
},
{
"id": "e72c4f8c.f387b",
"type": "websocket-listener",
"z": "",
"path": "ws://localhost:3000/signalk/v1/stream",
"wholemsg": "false"
},
{
"id": "222ca4ec.fecbdc",
"type": "ui_group",
"z": "",
"name": "Environment",
"tab": "e01159e6.0f0f28",
"disp": true,
"width": "6"
},
{
"id": "e01159e6.0f0f28",
"type": "ui_tab",
"z": "",
"name": "Your_Boat_Name",
"icon": "dashboard"
}
]
a) (in node-red) the row with chart dump will take care of saving your data to a file and using this data after eg a reboot
Try to make the same objects to produce something for environment.outside.temperature (copy and paste) and change some parameters should do the job.
Hope this helps. If you want more examples let me know
G.