question

jastreet avatar image
jastreet asked

Where do I put a custom battery monitor in Venus.

Hi, I have written a udp parser for lithionics batteries in python and would like to put it somewhere on a cerbo to integrate accurate battery data straight from the BMS. I understand that Venus calculates the Watts, soc and other values using dbus-systemcalc-py. I don't want to simply overwrite the values in dbus because I think Venus would get confused, I'd like to write a battery monitor so that dbus-systemcalc-py can recognize my driver and you could select it from the settings menu in the gui.

I'm not sure if I don't understand how the system works or if there's something I'm missing, but where would I put a python script to create a custom battery monitor that could be recognized by dbus-systemcalc-py. If there are any examples or GitHubs that would help I'd appreciate it, but I'm a little confused as to how this system works.


Venus OS
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Matthias Lange - DE avatar image Matthias Lange - DE ♦ commented ·
@jastreet moved to modifications
0 Likes 0 ·
2 Answers
johanndo avatar image
johanndo answered ·

You are on the right track. Read this:

https://github.com/victronenergy/venus/wiki/dbus

https://github.com/victronenergy/venus/wiki/howto-add-a-driver-to-Venus

Your service can be registered to run automatically and be supervised along with the victron services. You have to name your service

com.victronenergy.battery.<something>,

so that systemcalc accepts it as a battery monitor, you have to provide all the path a BMV provides with the exact same names, structure and data types. Then you can choose it as BMS / battery monitor for all calculations. You can also look in the structures of the BMS products if you intend to integrate it in DVCC.

there are example services in python how to register a device on dbus and how to react on callbacks to change settings or return values / iterate through the paths. This is optional, but for a good integration I would implement this routines.

Here is a nice link collection of ressources and some examples too if you want to digg deeper:

https://www.facebook.com/groups/524345062390257/permalink/524469285711168/

I put my own services next to Victron in

/opt/victronenergy/...

If you want them survive firmware upgrades, you may consider putting them in

/data/...

this is the only place, that would survive an update.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

xychiux avatar image
xychiux answered ·

https://github.com/Louisvdw/dbus-serialbattery

have a look here for a very good example :)

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources