meri-imperiumi / signalk-autostate

Automatic state setting for Signal K vessels
2 stars 3 forks source link

Feature request advice - Electric vs diesel for motoring #211

Closed martincaddick closed 5 months ago

martincaddick commented 6 months ago

I have a Greenline 33 which is a hybrid and I'd really like to log when I'm running on electric vs when I'm running on diesel. Really happy to ignore idle time.

The ask is, "What's the best way to accomplish this?"

At the moment I don't have an interface to the diesel engine so can't log engine hours. However, I do have the appropriate Victron gear and can use that to determine electric or diesel.

Using electrical.venus.dcPower I get the following.

Different states:

Normal usage pattern at the moment.

Maybe a new block in the StateMachine.js similar to switchMotoringSailing? Never written a signalk plugin, happy to give it a go. PS. Logging with autostate is fantastic!

Cheers, Martin

bergie commented 5 months ago

This plugin is purely concerned about populating navigation.state, and there the Signal K schema doesn't make a distinction with how you're motoring, only that you are either motoring or not.

However, what you could do is have two different engines with state set in Signal K, for example propulsion.diesel.state and propulsion.electric.state. The values can be either started or stopped.

I wrote a simple plugin to do this on our boat, so we can determine if the diesel engine is running based on the DC-DC converter producing power. See https://github.com/meri-imperiumi/signalk-alternator-engine-on

You could either do a similar plugin for your purposes, add more smarts as a PR to my plugin above, or implement this in Node-Red or NoFlo.