2020-11-11, 07:38 PM
Niklun, this might be what you are looking for, the derived data plugin calculates ground wind speed & direction based on sog & cog and sends it as environment.wind.angleTrueGround and environment.wind.speedOverGround. Then I have some node red which takes the values of thos and sends them as environment.wind.speedTrue and environment.wind.angleTrueWater.
Then set signalk to nmea plugin to create VWT sentence and opencpn recognizes that.
Code:
[
{
"id": "566b4bb6.eac0a4",
"type": "signalk-subscribe",
"z": "750594de.8e494c",
"name": "environment.wind.speedOverGround",
"mode": "sendAll",
"flatten": true,
"context": "vessels.self",
"path": "environment.wind.speedOverGround",
"source": "",
"period": 1000,
"x": 240,
"y": 1040,
"wires": [
[
"f784a4c3.41c338"
]
]
},
{
"id": "8334969e.d3b278",
"type": "signalk-send-pathvalue",
"z": "750594de.8e494c",
"name": "",
"source": "",
"x": 990,
"y": 1020,
"wires": []
},
{
"id": "f784a4c3.41c338",
"type": "function",
"z": "750594de.8e494c",
"name": "environment.wind.speedTrue",
"func": "msg.topic = \"environment.wind.speedTrue\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 620,
"y": 1060,
"wires": [
[
"8334969e.d3b278"
]
]
},
{
"id": "76df8946.05b5e8",
"type": "signalk-subscribe",
"z": "750594de.8e494c",
"name": "environment.wind.angleTrueGround",
"mode": "sendAll",
"flatten": true,
"context": "vessels.self",
"path": "environment.wind.angleTrueGround",
"source": "",
"period": 1000,
"x": 240,
"y": 1100,
"wires": [
[
"c10abcac.64d97"
]
]
},
{
"id": "c10abcac.64d97",
"type": "function",
"z": "750594de.8e494c",
"name": "environment.wind.angleTrueWater",
"func": "msg.topic = \"environment.wind.angleTrueWater\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 640,
"y": 1100,
"wires": [
[
"cd2581b1.513c6"
]
]
},
{
"id": "cd2581b1.513c6",
"type": "signalk-send-pathvalue",
"z": "750594de.8e494c",
"name": "",
"source": "",
"x": 990,
"y": 1080,
"wires": []
}
]
Then set signalk to nmea plugin to create VWT sentence and opencpn recognizes that.