Victron Venus OS D-Bus Service: SmartShunt to Virtual BMS Converter
Convert Victron SmartShunts into virtual Battery Management Systems (BMS) with dynamic charge control for Cerbo GX, Venus GX, and other Venus OS devices.
THIS PROJECT IS RAGINGLY EXPERIMENTAL AND REALLY HASN'T BEEN TRIED OR RUN YET.
YOU SHOULD NOT USE THIS SOFTWARE. If you choose to use it anyway, it is DEFINITELY AT YOUR OWN RISK.
This service directly controls battery charging behavior and publishes CVL (Charge Voltage Limit) values to your Victron Energy system. Incorrect charge parameters can:
- β Damage your batteries
- β Cause fires or explosions
- β Void warranties
- β Destroy expensive equipment
By using this software, you accept full responsibility for any and all consequences, including but not limited to property damage, personal injury, or death.
A Venus OS service that converts Victron SmartShunt battery monitors into virtual Battery Management Systems (BMS) with DVCC charge control, dynamic CVL, and comprehensive battery protection.
For: Victron Energy systems (Cerbo GX, Venus GX, Raspberry Pi running Venus OS)
Monitors: SmartShunt 500A, SmartShunt IP65
Supports: LiFePO4, Lead-Acid, LTO batteries
Features: Dynamic CVL, MPPT integration, temperature protection, low voltage disconnect
Note: This project shares framework code with dbus-aggregate-smartshunts and is derived from dbus-aggregate-batteries by Anton Labanc PhD.
If you have "dumb" batteries (no built-in BMS communication) monitored by SmartShunts, this service adds BMS functionality to enable DVCC charge control. Each SmartShunt gets converted into a virtual BMS device that can control charging.
This is experimental software that directly controls your charging system. It may not work correctly and could damage your equipment.
Key Benefits:
- π― Virtual BMS - Converts Victron SmartShunt into BMS for DVCC control
- π‘οΈ Battery Protection - Temperature limits, low voltage disconnect, alarm monitoring
- β‘ DVCC Integration - Publishes CVL/CCL/DCL for Multi/Quattro/MPPT/Orion XS control
- π Dynamic CVL - Auto-discovers MPPT charge settings (absorption/float/re-bulk)
- π Full Passthrough - All SmartShunt data (voltage, current, SoC, alarms, history)
- π§ Per-Battery Control - One virtual BMS per SmartShunt (no aggregation)
- π Multi-Chemistry - LiFePO4, Lead-Acid, LTO support
Use this project if:
- β You have batteries WITHOUT built-in BMS communication
- β Each battery has a Victron SmartShunt for monitoring
- β You want DVCC to control Victron Multi/Quattro/MPPT/Orion XS charging
- β You need dynamic CVL with charge phase control (Bulk/Absorption/Float)
- β You want battery protection (temperature, voltage, current limits)
- β You need each battery to appear as a BMS device in Venus OS
Don't use this project if:
- β Your batteries already have BMS communication (use that instead)
- β You want to aggregate multiple SmartShunts (use dbus-aggregate-smartshunts)
- β You just need monitoring (SmartShunts already do that)
For each SmartShunt on your system, this service creates a virtual BMS that:
- Passes through all SmartShunt data - voltage, current, SoC, alarms, history, etc.
- Adds BMS-specific paths -
/Info/MaxChargeVoltage,/Info/MaxChargeCurrent,/Info/MaxDischargeCurrent - Adds charge control -
/Io/AllowToCharge,/Io/AllowToDischargebased on alarms and temperature - Appears as BMS - ProductId 0xBA77 so Venus OS treats it as a battery with BMS
- Dynamic CVL (optional) - Automatically discovers charge settings from MPPTs/Orion XS and dynamically adjusts CVL based on charge phase (bulk/absorption/float)
The service automatically discovers all charging devices on your system (MPPTs, Orion XS, SmartChargers) and reads their charge algorithm settings:
- Absorption Voltage - Bulk charging target
- Float Voltage - Maintenance charging voltage
- Tail Current - When to transition from absorption to float
- Re-bulk Offset - When to restart bulk charging from float
Using these parameters, the virtual BMS implements a charge phase controller that mimics the behavior of a real BMS:
- Bulk Phase: Publishes absorption voltage as CVL, allowing maximum charge current
- Absorption Phase: Maintains absorption voltage, monitors tail current
- Float Phase: Lowers CVL to float voltage for maintenance
- Re-bulk: Returns to bulk if voltage drops below re-bulk threshold
This creates a sophisticated charge control system that protects your batteries while maximizing charge efficiency.
Note: Dynamic CVL requires at least one MPPT or Orion XS on your system with readable charge settings. If no charge sources are found, the service falls back to static CVL from your config.
DO NOT INSTALL THIS ON A PRODUCTION SYSTEM.
This software is completely untested and may cause serious damage to your batteries and equipment. Install only on a test system where battery damage is acceptable.
YOU HAVE BEEN WARNED.
- Victron Cerbo GX or Venus GX running Venus OS
- 1+ SmartShunts connected and visible on D-Bus
- "Dumb" batteries (no built-in BMS communication)
- SSH into your Cerbo GX:
ssh root@<cerbo-ip>- Download and install:
cd /data/apps
git clone https://github.com/TechBlueprints/dbus-smartshunt-to-bms.git
cd dbus-smartshunt-to-bms
chmod +x *.sh
./install.sh- Configure (optional):
cp config.default.ini config.ini
nano config.ini # Edit your settings- Enable and start:
./enable.sh- Check logs:
./get-logs.shCopy config.default.ini to config.ini and customize:
[DEFAULT]
# Battery voltage limits
MAX_CHARGE_VOLTAGE = 14.6 # Safety ceiling for CVL (V)
MIN_BATTERY_VOLTAGE = 10.8 # Low voltage disconnect (V)
# Battery current limits (per SmartShunt)
MAX_CHARGE_CURRENT = 50 # Maximum charge current (A)
MAX_DISCHARGE_CURRENT = 100 # Maximum discharge current (A)
# Temperature thresholds
TEMP_COLD_DANGER = 5.0 # Disable charging below this (Β°C)
TEMP_HOT_DANGER = 45.0 # Disable charging above this (Β°C)Important Configuration Notes:
-
MAX_CHARGE_VOLTAGE: Safety ceiling for CVL. If you have MPPTs or Orion XS devices, the service will automatically read their absorption/float voltages and use those for dynamic CVL. This value acts as a safety ceiling - the published CVL will never exceed this value. -
MIN_BATTERY_VOLTAGE: Low Voltage Disconnect (LVD) protection. Discharging is disabled (/Io/AllowToDischarge = 0) when voltage drops to or below this value. Critical for preventing over-discharge damage.- LiFePO4 12V: 10.8V (11.0V for extra safety margin)
- LiFePO4 24V: 21.6V
- LiFePO4 48V: 43.2V
- Lead-Acid 12V: 11.5V
-
Current Limits: These are per SmartShunt. If a SmartShunt monitors multiple batteries, set these to the total for all batteries on that shunt.
-
Temperature Limits: Used to disable charging/discharging when temperatures are unsafe. Defaults are appropriate for LiFePO4.
# Device discovery
UPDATE_INTERVAL_FIND_DEVICES = 1 # Check for new devices every 1s (first 30s)
MAX_UPDATE_INTERVAL_FIND_DEVICES = 1800 # Max check interval: 30 minutes
# Exclusions (optional)
EXCLUDE_SHUNTS = com.victronenergy.battery.ttyUSB0 # Comma-separated listSee config.default.ini for all options.
Physical Setup:
Battery 1 + SmartShunt 1 βββ
Battery 2 + SmartShunt 2 βββΌββ> dbus-smartshunt-to-bms ββ> Virtual BMS 1 (for SmartShunt 1)
Battery 3 + SmartShunt 3 βββ βββ> Virtual BMS 2 (for SmartShunt 2)
βββ> Virtual BMS 3 (for SmartShunt 3)
Each SmartShunt becomes a separate BMS. If you want them combined, use dbus-aggregate-smartshunts instead.
Physical SmartShunts:
com.victronenergy.battery.ttyS5com.victronenergy.battery.ttyS6- etc.
Virtual BMS services created by this tool:
com.victronenergy.battery.smartshunt_bms_278(using device instance)com.victronenergy.battery.smartshunt_bms_277- etc.
These are companion projects with different purposes:
| Project | Purpose | Output | Use When |
|---|---|---|---|
| dbus-smartshunt-to-bms | Add BMS to each SmartShunt | One BMS per SmartShunt | Batteries need individual charge control |
| dbus-aggregate-smartshunts | Combine multiple SmartShunts | One aggregated monitor | Parallel batteries, unified monitoring |
Can I use both? Yes! Use this to convert SmartShunts to BMS, then use dbus-aggregate-smartshunts to combine them.
./get-logs.sh # Check for errors- Check that SmartShunts are visible:
dbus -y com.victronenergy.battery.ttyS5 - Verify service is running:
svstat /service/dbus-smartshunt-to-bms - Check ProductId is 0xBA77:
dbus -y com.victronenergy.battery.smartshunt_bms_278 /ProductId GetValue
- Enable DVCC in Venus OS settings
- Ensure virtual BMS has highest DeviceInstance priority
- Check
/Info/MaxChargeVoltageetc. are published
- Check logs for "Charge Source Discovery" output
- Verify at least one MPPT or Orion XS is detected
- Confirm charge parameters were read successfully
- Look for "CVL updated" messages in logs during charging
- If no charge sources found, service will use static MAX_CHARGE_VOLTAGE from config
- Check your MPPT/Orion XS charge settings in VictronConnect
- Verify all chargers have consistent settings (absorption/float voltages should match)
- Service uses consensus values from all discovered chargers
- MAX_CHARGE_VOLTAGE in config acts as safety ceiling
cd /data/apps/dbus-smartshunt-to-bms
./uninstall.shMIT License - See LICENSE file
- Based on dbus-aggregate-batteries by Anton Labanc PhD
- Inspired by dbus-serialbattery by mr-manuel (Louis van der Walt)
- Adapted and extended by Clinton Goudie-Nice
- Uses Victron's velib_python library
- GitHub Issues: https://github.com/TechBlueprints/dbus-smartshunt-to-bms/issues
- Related Project: dbus-aggregate-smartshunts
Use this software at your own risk. No warranties or guarantees of any kind are provided.