Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent use of SignalK path names in the plugin #95

Open
nmbath opened this issue Sep 1, 2021 · 0 comments
Open

Inconsistent use of SignalK path names in the plugin #95

nmbath opened this issue Sep 1, 2021 · 0 comments

Comments

@nmbath
Copy link
Contributor

nmbath commented Sep 1, 2021

Having been looking at data associated with consumed amp hours, there seems to be an inconsistent use of path names.

The main SignalK Scheme defines the path "electrical.batteries.*.capacity.dischargeSinceFull" as "Cumulative discharge since battery was last full"

Therefore the data from the SignalK-venus-plugfin related to consumed amps (dbus path '/ConsumedAmphours') should be mapped to the above path, instead it is mapped at line 51 within venusToDeltas.js to electrical.batteries.${m.instanceName}.capacity.consumedCharge

The data mapped to "electrical.batteries.*.capacity.dischargeSinceFull" is actually dbus path '/History/LastDischarge', which is misleading to the SignalK path, as defined in the schema.

This seems to be in error and is misleading to the original SignalK schema (https://github.com/SignalK/specification/blob/master/schemas/groups/electrical.json lines 430-434).

Could we map as follows:

Dbus Path - SignalK Path
/ConsumedAmphours - electrical.batteries..capacity.dischargeSinceFull (NOTE 1)
//History/LastDischarge - electrical.batteries.
.capacity.history.lastDischargeSinceFull

NOTE1: CAN data from PGN127506 (Consumed AH) should be mapped to this SignalK path, and making this change would keep everything consistent.

I also note the there are several dbus /history/ paths and maybe history should be added to all these in SignalK, to make it clear they are historical data and not current, examples are

'/History/TotalAhDrawn': {
  path: m => `electrical.batteries.${m.instanceName}.lifetimeDischarge`,
  conversion: ahToCoulomb
},
'/History/DischargedEnergy' : {
  path: m => `electrical.batteries.${m.instanceName}.capacity.dischargedEnergy`,
  conversion: ahToCoulomb,
  units: 'C'
},

Happy to create a diff if required, but a fairly simple change to the venusToDeltas.js file.

Many Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant