Adding Serial Driver to Own BMS #113
-
Hi Louis, I've been running my own BMS for a few years. I recently upgraded my electricals to Victron so I was delighted to find your repo! Thanks. I think I might as well write a serial output driver for it (currently MQTT over wifi) but I thought I'd ask what the simplest way might be - to save reverse engineering the work you have already done by reverse engineering each of the batteries. Or should I just emulate one of the existing batteries? Questions: I don't measure current - that is done by a smartshunt. Send a dummy value or don't send at all? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @JohnMacrae You will have to send the current, so best would be a dummy value if you do not have it. |
Beta Was this translation helpful? Give feedback.
Hi @JohnMacrae
The best way is to copy the battery_template.py file and rename that and it's class for your BMS. Then populate the stubs in there.
You will see it inherit from Battery which is the class that holds all the data for the battery, so your new class has all the properties inherited already and you just need to populate them. The rest the driver will do for you when you add your new BMS object to the battery_types to test in dbus-serialbattery.py
You can also look at some of the existing batteries (JBD is a simple one) as an example of what to do.
You will have to send the current, so best would be a dummy value if you do not have it.