(2022-02-17, 08:47 AM)RKV Wrote: , I don't really want to deal with note red
Yes you do
Not that difficult to do some very useful tasks.
This strips out just the time from the gps datatime & adds it to signalk as "navigation.datetimestring"
In node-red, either menu import or ctrl-i , paste the code below & deploy... then navigation.datetimestring will be available as a text value in KIP
Code:
[
{
"id": "5135979d8b2792cb",
"type": "signalk-subscribe",
"z": "d6c01db7.8f1c",
"name": "navigation.datetime",
"mode": "sendAll",
"flatten": true,
"context": "vessels.self",
"path": "navigation.datetime",
"source": "",
"period": 1000,
"x": 210,
"y": 620,
"wires": [
[
"fc0fa0c71e18a827"
]
]
},
{
"id": "2bad0b37dcba4e8f",
"type": "signalk-send-pathvalue",
"z": "d6c01db7.8f1c",
"name": "navigation.datetimestring",
"source": "",
"meta": "",
"x": 710,
"y": 620,
"wires": []
},
{
"id": "fc0fa0c71e18a827",
"type": "function",
"z": "d6c01db7.8f1c",
"name": "Convert datetime to time",
"func": "//\"2022-02-17T09:30:01.000Z\"\n\nvar temptime = msg.payload;\ntemptime = temptime.slice(11, 19);\nmsg.topic = \"navigation.datetimestring\";\nmsg.payload = temptime;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 440,
"y": 620,
"wires": [
[
"fba25f82fe68abd7",
"2bad0b37dcba4e8f"
]
]
},
{
"id": "fba25f82fe68abd7",
"type": "debug",
"z": "d6c01db7.8f1c",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 590,
"y": 680,
"wires": []
}
]
------