question

mija avatar image

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 - Solar Charge ControllerCCGX Color ControlVenus OSBMS
1623931391233.png (133.5 KiB)
1623931715710.png (108.6 KiB)
2 |3000 characters needed characters left characters exceeded

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

3 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 characters needed characters left characters exceeded

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

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.

keiron avatar image
keiron answered ·

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

2 comments
2 |3000 characters needed characters left characters exceeded

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

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

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

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 characters needed characters left characters exceeded

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

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.

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 ;)

@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.