SignalK / n2k-signalk

NMEA 2000 to Signal K transformer
Apache License 2.0
25 stars 29 forks source link

PGN 65016 - Utility Total AC Power (Apparent Power Conversion) #259

Open philbegg opened 1 year ago

philbegg commented 1 year ago

Should the apparent power be multiplied by the power factor or are the values that come from the device be the ones that are displayed.

Example: canboatjs converts the data to :

{
  canId: 217970880,
  prio: 3,
  src: 192,
  dst: 255,
  pgn: 65016,
  timestamp: '2023-07-19T22:40:19.000Z',
  fields: { 'Real Power': -5616, 'Apparent Power': 5733 },
  description: 'Utility Total AC Power'
}

n2k-signalk - toDelta returns:

{
    "updates": [
        {
            "source": {
                "label": "",
                "type": "NMEA2000",
                "pgn": 65016,
                "src": "192",
                "deviceInstance": 0
            },
            "timestamp": "2023-07-19T22:40:19.000Z",
            "values": [
                {
                    "path": "electrical.ac.0.total.realPower",
                    "value": -5616
                },
                {
                    "path": "electrical.ac.0.total.apparentPower",
                    "value": 4402944
                }
            ]
        }
    ]
}

at the current point in time my state looks like this:

{
    "2": {},
    "3": {},
    "9": {},
    "42": {},
    "43": {},
    "75": {},
    "77": {},
    "83": {},
    "88": {},
    "89": {},
    "104": {},
    "106": {},
    "121": {},
    "144": {},
    "145": {},
    "177": {},
    "178": {},
    "192": {
        "deviceInstance": 0,
        "maretron": {
            "electrical": {
                "ac": [
                    {
                        "total": {
                            "powerFactor": 768
                        }
                    }
                ]
            }
        }
    },
    "219": {}
}