This project provides a lightweight and efficient Python script that acts as a bridge between the internal D-Bus system of a Victron device (like a Cerbo GX) and an MQTT broker.
It was created as a high-performance alternative to Node-RED to reduce resource consumption (especially RAM) and provide a stable, reboot-proof service.
- Automatic Discovery: Dynamically detects present devices, including:
- Battery Monitors (BMV, SmartShunt)
- Solar Chargers (MPPTs)
- Inverter/Chargers (MultiPlus, Quattro)
- Comprehensive Data Reading: Reads and publishes the most important data points, including:
- Battery: Voltage, Current, Power, State of Charge (SOC), Auxiliary Voltage, Consumed Ah.
- Solar: Total Power and Current, Daily Energy Yield (in Wh).
- MultiPlus: AC In/Out data (Voltage, Power, Frequency), Charge Current, and Operating State (Bulk, Inverting, Passthru, etc.).
- Dynamic MQTT Topics: Creates a main topic based on the device's unique serial number, making the script portable to any Cerbo GX.
- Stable and Lightweight: Designed for very low CPU and RAM consumption.
- Automatic Startup: Thanks to a robust startup system, the service starts automatically on every reboot.
Before you begin, ensure you have:
- SSH access to your Cerbo GX. You can enable it from the menu:
Settings -> Services -> SSH on LAN
. - The IP address of your Cerbo GX.
- A recent version of the Venus OS firmware (v2.80+ recommended).
- The "All modifications enabled" option turned ON if you are using a recent firmware version (v3.40+). This can be found under
Settings -> General
.
Installation has been made as simple as possible. You only need to run a single command on your Cerbo.
- Connect to your Cerbo GX via SSH.
- Copy the entire command below, paste it into the terminal, and press Enter. The script will handle everything else automatically.
curl -sSL https://raw.githubusercontent.com/spidgrou/venusos-dbus-mqtt-aggregator/main/install.sh | bash
The installation script will take care of everything:
- Installing necessary dependencies.
- Downloading the main program.
- Configuring it as a permanent, auto-starting service.
- Starting the service.
After the installation finishes, wait about 30 seconds to allow the service to start completely. Then, run the following commands to check its status.
This is the most important command. It tells you if the program is running.
svstat /service/dbus-mqtt-bridge
Expected output: You should see a message beginning with up
, like this:
/service/dbus-mqtt-bridge: up (pid 1234) 45 seconds
If you want to see the startup messages or diagnose any issues, you can view the logs:
tail -f /var/log/messages | grep dbus-mqtt-bridge
Out-of-the-box, the script is configured to connect to an MQTT broker running on the Cerbo itself (127.0.0.1
). If your broker is on a different machine, you can easily change the address.
- Open the script file with a text editor:
nano /data/dbus-mqtt-bridge/dbus_to_mqtt_bridge.py
- Find and modify the line
MQTT_BROKER_ADDRESS = "127.0.0.1"
. - Save the file (
Ctrl+O
, then Enter) and exit (Ctrl+X
). - Restart the service to apply the changes:
svc -t /service/dbus-mqtt-bridge
If you wish to completely remove the service from your device, you can do so with a single command. This will stop the service, delete all its files, and remove the auto-start configuration.
- Connect to your Cerbo GX via SSH.
- Copy and paste the entire command below and press Enter.
curl -sSL https://raw.githubusercontent.com/spidgrou/venusos-dbus-mqtt-aggregator/main/uninstall.sh | bash
The uninstallation is safe and will only remove the files created by this project.