question

mija avatar image
mija asked

ElectroDacus SBMS0 integration with CCGX to control SmartSolar charging

I have built an electrical system for a van to campervan conversion. Sinopoly LiFePO4 cells with ElectroDacus SBMS0, CCGX, MultiPlus 24/5000/120, SmartSolar 150/35, BatteryProtect BP65. The SBMS0 can write status parameters via UART (USB-RS232 interface). I have written a Venus driver to consume these parameters via serial and feed them into the com.victronenergy.battery.ttyUSB0 dbus service. I am writing the following dbus values:

'/Dc/0/Voltage': round(data['battery_voltage'], 2)
'/Dc/0/Current': round(data['battery_current'], 2)
'/Dc/0/Power': round(data['battery_voltage'] * data['battery_current'], 2)
'/Dc/0/Temperature': data['ext_temp']
'/Soc': data['soc']
'/Alarms/LowVoltage': victron_alarm(data['status_uvlk'])
'/Alarms/HighVoltage': victron_alarm(data['status_ovlk'])
'/Alarms/LowSoc': victron_alarm(data['battery_voltage'] <= BATTERY_SOC_LOW_ALARM)
'/Alarms/LowTemperature': victron_alarm(data['ext_temp'] < BATTERY_TEMP_LOW_ALARM)
'/Alarms/HighTemperature': victron_alarm(data['ext_temp'] > BATTERY_TEMP_HIGH_ALARM)
'/Alarms/HighInternalTemperature': victron_alarm(data['status_iot'])
'/Info/MaxChargeVoltage': BATTERY_VOLTAGE_MAX
'/Info/BatteryLowVoltage': BATTERY_VOLTAGE_MIN
'/Info/MaxChargeCurrent': BATTERY_CURRENT_CHARGE_MAX
'/Info/MaxDischargeCurrent': BATTERY_CURRENT_DISCHARGE_MAX
'/Capacity': BATTERY_CAPACITY
'/Alarms/HighChargeCurrent': victron_alarm(data['status_coc'])
'/Alarms/HighDischargeCurrent': victron_alarm(data['status_doc'])
'/Alarms/CellImbalance': victron_alarm(data['cell_voltage_delta'] > 20)
'/Alarms/InternalFailure': victron_alarm(data['status_eccf'] or data['status_open'])
'/Alarms/HighChargeTemperature': victron_alarm(data['battery_current'] > 0.0 and data['ext_temp'] > BATTERY_TEMP_HIGH_ALARM)
'/Alarms/LowChargeTemperature': victron_alarm(data['battery_current'] > 0.0 and data['ext_temp'] < BATTERY_TEMP_LOW_ALARM)
'/Alarms/LowCellVoltage': victron_alarm(data['status_lvc'])
'/System/MinCellVoltage': min(data['cell_voltages'])
'/System/MinVoltageCellId': ','.join(str(cell) for cell, voltage in enumerate(data['cell_voltages']) if voltage == min(data['cell_voltages']))
'/System/MaxCellVoltage': max(data['cell_voltages'])
'/System/MaxVoltageCellId': ','.join(str(cell) for cell, voltage in enumerate(data['cell_voltages']) if voltage == max(data['cell_voltages']))
'/Io/AllowToCharge': victron_bool(data['status_cfet'])
'/Io/AllowToDischarge': victron_bool(data['status_dfet'])

The data appears in the expected places on the CCGX display:

1623931391233.png

The SBMS0 signals low/high voltage disconnect via optocouplers (as well as via UART) when the battery is empty/full respectively. I am using this to control the MultiPlus using the Two-Signal BMS assistant as described in the "Connecting other lithium systems to Multis and Quattros" document. I also plan to use the SBMS0 to control loads connected via the BP65 by way of the remote pins.

Ideally I would also use the SBMS0 to control the SmartSolar using the VE.Direct non-inverting remote on/off cable. However, the SmartSolar has a single VE.Direct port, which is in use to connect to the CCGX. I therefore need to use the CCGX to control the SmartSolar.

I have confirmed that remote control of the SmartSolar is possible from the CCGX via dbus:

dbus -y com.victronenergy.solarcharger.ttyO0 /Mode SetValue 1  # on
dbus -y com.victronenergy.solarcharger.ttyO0 /Mode SetValue 4  # off
I am having trouble using the data from the SBMS0, injected via com.victronenergy.battery.ttyUSB0, to control this automatically. With my custom driver installed, the SmartSolar does know that it is supposed to be controlled by the BMS:

1623931715710.png

However, even with this configuration, the SmartSolar does not stop charging when the SBMS0 signals battery full/over voltage. I had thought that setting /Io/AllowToCharge would provide this control, but it doesn't seem to.

Which dbus values in com.victronenergy.battery.ttyUSB0 do I need to write so that the SmartSolar will stop charging when the SBMS0 determines that charging is complete?

MPPT ControllersVenus OSBMSCCGX Color Control
1623931391233.png (133.5 KiB)
1623931715710.png (108.6 KiB)
2 |3000

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

7 Answers
bathnm avatar image
bathnm answered ·

As you have probably found there is a lot going on inside the VenusOS and dbus. You have created a driver, and it is not necessarily the driver and its dbus storage area that controls other parts of the system. I would take a look at dbus-systemcalc-py, as I suspect that has a lot of involvement in controlling other devices within the system, based on data and rules from other dbus paths. One solution, and you already have it is to use your driver to control the solar chargers. You know what commands will switch it on and off. Note however you are switching it on and off, not setting it to be externally controlled and able to maintain a float charge. That is yet another mode you would need to work out.

It is probably also worth pointing out that your on your own. You will need to work it all out yourself, you will not get help from Victron. There are few people within the community that will be able to support you on your endeavours, due to having the required knowledge level on how Victron has implemented things, or time.

You are much better off getting a BMS that is already supported by VenusOS

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.

mija avatar image mija commented ·
Thanks for your reply. I have come to many of the same conclusions as you. But this wouldn’t be the modifications space if I settled for buying a pre-integrated BMS! :)


Thanks for the pointer to dbus-systemcalc-py. I’ll take a look at that.

0 Likes 0 ·
keiron avatar image
keiron answered ·

Would you mind sharing your driver so others can learn from it?

2 comments
2 |3000

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

mija avatar image mija commented ·

Absolutely! I intend to publish it once I can get it working with the SmartSolar.

0 Likes 0 ·
keiron avatar image keiron mija commented ·
Okay, I use MQTT and NMEA2000 to control my infrastructure and as much as I'd like to rewrite Louis' driver code to work with my Electrodacus so I can help you I really don't have the time. Best of luck.


If you change your mind, then let me know

0 Likes 0 ·
nebulight avatar image
nebulight answered ·

This is awesome!! You might want to check this out: https://community.victronenergy.com/questions/76159/victron-venusos-driver-for-serial-connected-bms-av.html

Maybe you can take some of that work an apply it to the SBMS0. The SBMS is by far a superior BMS for applications like this since you don't actually pass current through the BMS; you simply tell the devices to either stop charging or discharging.

I would love to have a copy of this once the driver is complete as I plan to use an SBMS0 is my next van build.

3 comments
2 |3000

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

mija avatar image mija commented ·

I’m certainly very impressed with the engineering behind the SBMS and Venus. I recently found the dbus-serialbattery project; the difference there is it uses DVCC. I’m going to do some more reading into that.

0 Likes 0 ·
nebulight avatar image nebulight mija commented ·
Maybe you could merge the project so it could be one driver. Maybe if it gets refined enough Victron might build it into the image ;)
0 Likes 0 ·
Louis van der Walt avatar image Louis van der Walt mija commented ·

@mija DVCC is the key to what you want to do with the MPPTs. From what I see it seems your publish the same set of data that my driver does, so it should be easy to add SBMS0 integration to my driver if you want to share what you have done. Get in contact if you are intrested.

0 Likes 0 ·
vassilis-bourdakis avatar image
vassilis-bourdakis answered ·

hi,

about to order a lifepo4 pack (8S) and a BMS for my system which includes a fully Victron oriented setup with a multiplus II 3000/24, a 4yo MPPT 100/30, a BMV700 all connected to a rpi running Venus2.80 large. I see the problem in switching on and off the MPPT (dont want to loose the data from the connection to the rpi) and I guess DVCC is the only solution.

Wondering if there's any news in your driver getting DVCC support, or joining forces with Louis va der Valt work for a common driver.

Want to make a final decisino and order either an Electrodacus SBMS0 (if things go ahead) or a chargery if not.


cheers

V.

3 comments
2 |3000

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

Mike Dorsett avatar image Mike Dorsett commented ·
Working with Lois's code is probably the easiest way to go, as this handles most of the interface with Venus, and you only need to code the specific serial protocol for your BMS. I designed a BMS which interfaces with the Broadcom chip using SPI, and got this working with Louis's code quite quickly. So now my BMS runs Venus, and the VE direct and Mk3 etc just plug into the USB ports.
0 Likes 0 ·
Louis van der Walt avatar image Louis van der Walt commented ·

I would suggest you chat with @nebulight

He is trying to get a SBMS0 to me so I can look at integrating it into my driver.
https://diysolarforum.com/threads/victron-venusos-driver-for-serial-connected-bms-available-llt-jbd-daly-smart-ant-jkbms-heltec.17847/post-354251

0 Likes 0 ·
mija avatar image mija commented ·

It's been tricky for me to work on this lately. We went back into COVID-19 lockdown in mid-August, and the van is my father's. However, I've got something ready to test with DVCC when I can see him next weekend.

@Louis van der Walt happy to work with you to get the SBMS0 integrated into dbus-serialbattery. Might save @nebulight needing to ship you one. The SBMS0 looks to be a little different to the other BMSes you have already written drivers for, in that it sends data on a regular schedule (interval configurable on the BMS itself) rather than responding to commands received via serial.

I'm using GLib.io_add_watch() with a callback function to trigger pushing the data into D-Bus. Do you think something like this can work with the dbus-serialbattery API as-is?

0 Likes 0 ·
Louis van der Walt avatar image
Louis van der Walt answered ·

@mija we should be able to make that work. The driver currently use a GLib mainloop to poll and publish the battery, but for the SBMS0 the watch callback can be used to populate the battery object only and the mainloop will then publish that results to dbus just like any of the other BMS it currently does.

Send me a PM on one of the forums listes at the bottom of this page and we can see how we can share the code.

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.

nebulight avatar image nebulight commented ·
Sorry all, I've been delayed in sending this out to Louis. I can get this sent out this week as it kind of fell off my radar.
0 Likes 0 ·
member040 avatar image
member040 answered ·

Hi all!

Any news on the topic?

2 |3000

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

mmccall55 avatar image
mmccall55 answered ·

Hi @mija and all - I don't think @Louis van der Walt is continuing and work on this BMS. Considering that, would you be willing to share what you got working with yours? I think there are several folks that would benefit from your code and physical connection knowledge. Thanks!

2 |3000

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