OpenMarine

Full Version: [CLOSED] Diagnostic Signal K Input Unit Settings Not Working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It appears the "Diagnostic Signal K Input" screen should list (Capture-2) the Signal K items received via MQTT (Capture-1) so that a data type and units can be assigned to the item. As you can see electrical.solar.SensorSourceVoltage has no unit assigned. It appears all items are being added to the Signal-K tree as strings rather than the relevant int or float. Does this describe the intention? Am I not understanding the desired functionality? Additionally it does not appear voltage is provided as an option when selecting the unit button. Thank you in advance. Anthony[Image: Capture-1.JPG][Image: Capture-2.JPG]
Not a bug.
SignalK does not work as you think. It uses only SI units. So there is no need to show the unit. Openplotter does use a file (keyswithmetadata.json) from SignalK which describes some SignalK values + some with the SI unit. You can add sentences to /usr/lib/node_modules/signalk-server/node_modules/@signalk/signalk-schema/dist/keyswithmetadata.json if you want to be able to use/see the private units in Diagnostic. But keep in mind the convertion to private unit is only for Diagnostic !!!

Temperatures in SignalK are always in SI unit Kelvin. Your value electrical.solar.Sensor.temperature seems to be wrong (-189,31 °C).
If you name the key according to the spec then in the diagnostic window it will have the correct suffix -
http://signalk.org/specification/1.0.4/d...expvoltage
/electrical/solar/<RegExp>/voltage

But that doesn't help that much, sending with MQTT the value will still be a string which can be limiting if using the  KIP app to view the data and most likely elsewhere.
One workaround would be to use signalk NodeRed app to grab the data coming in and change it to a float then send it on to signalk >
[Image: 905R4tm.png]


[Image: GeeDunE.png]

Code:
[
   {
       "id": "c0a37a24.2adf68",
       "type": "mqtt in",
       "z": "f792bbef.555918",
       "name": "MQTT topic",
       "topic": "test",
       "qos": "2",
       "broker": "bda9193b.205c18",
       "x": 200,
       "y": 240,
       "wires": [
           [
               "eaba93f9.b07d3"
           ]
       ]
   },
   {
       "id": "eaba93f9.b07d3",
       "type": "function",
       "z": "f792bbef.555918",
       "name": "change Str  to float",
       "func": "msg.topic = \"electrical.solar.SensorSource.voltage\";\n//msg.payload = parseFloat(msg.payload);\nreturn msg;",
       "outputs": 1,
       "noerr": 0,
       "x": 370,
       "y": 220,
       "wires": [
           [
               "aa8a5862.f22138",
               "a9e94ec.7d774b"
           ]
       ]
   },
   {
       "id": "aa8a5862.f22138",
       "type": "debug",
       "z": "f792bbef.555918",
       "name": "",
       "active": false,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "true",
       "x": 550,
       "y": 200,
       "wires": []
   },
   {
       "id": "a9e94ec.7d774b",
       "type": "signalk-send-pathvalue",
       "z": "f792bbef.555918",
       "name": "",
       "source": "",
       "x": 590,
       "y": 260,
       "wires": []
   },
   {
       "id": "bda9193b.205c18",
       "type": "mqtt-broker",
       "z": "",
       "name": "openplotter",
       "broker": "10.10.10.1",
       "port": "1883",
       "clientid": "",
       "usetls": false,
       "compatmode": true,
       "keepalive": "60",
       "cleansession": true,
       "birthTopic": "",
       "birthQos": "0",
       "birthPayload": "",
       "closeTopic": "",
       "closeQos": "0",
       "closePayload": "",
       "willTopic": "",
       "willQos": "0",
       "willPayload": ""
   }
]