Victron Venus OS (Zero Feed-In)¶
A Victron system with a Multiplus-II (or another inverter/charger with ESS) needs a grid meter for zero feed-in. The inverter then feeds only as much power into the house as keeps the electricity meter at roughly 0 W, so the battery is used for your own consumption. Instead of an additional meter behind the main fuse, the WattWächter WiFi/USB can take on this role: it reads your existing meter and sends the readings via MQTT to Venus OS. There the community driver dbus-mqtt-grid turns them into a grid meter that ESS uses for its control loop.
Tested setup
This guide is based on a customer's setup running Venus OS on a Raspberry Pi (community image). It should work the same way on a GX device (e.g. Cerbo GX), but that has not been tested.
Community software
dbus-mqtt-grid is not an official Victron product. Neither Victron nor SmartCircuits provide support for it. After setting it up, check that the control loop works reliably before you depend on it.
Prerequisites¶
- WattWächter WiFi/USB is set up: connected to WiFi, reading script active, and the meter readings appear on the main page of its web interface
- The meter provides the current power and reports it as negative while feeding in. Many meters only show it after PIN unlocking, see also FAQ → Current power.
- Venus OS (GX device or Raspberry Pi) on the same network as the WattWächter
- SSH access as root to Venus OS, see Victron → Root Access
- Inverter/charger with ESS configured, see the Victron ESS manual
Step 1 — Adapt the script on the WattWächter¶
dbus-mqtt-grid expects the values under fixed names. So that they arrive in exactly this format, change your reading script via Tools → Edit Script in four places:
| Where | Before (typical) | New |
|---|---|---|
JSON prefix at the end of the +1,… line |
e.g. MT681, DD3 |
grid |
| Import identifier | E_in |
energy_forward |
| Export identifier | E_out |
energy_reverse |
| Power identifier | Power |
power |
In addition, add 16 to the decimal-places value (the last number) of the power line. This makes the WattWächter send the power with every meter telegram straight away instead of only at the telemetry interval, which is essential for the control loop.
Example for an SML meter at 9600 baud:
>D
>B
=>sensor53 r
>M 1
+1,3,s,0,9600,grid
1,77070100010800ff@1000,Import,kWh,energy_forward,3
1,77070100020800ff@1000,Export,kWh,energy_reverse,3
1,77070100100700ff@1,Current power,W,power,16
1,77070100600100ff@#,Meter number,,Meter_Number,0
#
OBIS codes, baud rate and type (s/o) stay as they are in your script; only the prefix, the identifiers and the 16 change. Additional lines (voltages, meter number …) can stay.
Power per phase
If your meter provides power per phase, dbus-mqtt-grid can show it too. The identifiers are then power_L1, power_L2 and power_L3, again with +16 on the decimal places.
Shorten the telemetry interval: the meter totals (kWh) are still only sent at the telemetry interval, every 300 seconds by default. Set it to 10 seconds in the console (Tools → Console):
TelePeriod 10
After Save and the script restart, the main page should show the values as before, only with the new identifiers. The console now shows lines like:
MQT: tele/<topic>/SENSOR = {"Time":"…","grid":{"power":413}}
Home Assistant, ioBroker & co.
If you also use the values in a smart home system, the new identifiers change the sensor names there.
Step 2 — Enable MQTT in Venus OS¶
Venus OS comes with its own MQTT broker. Enable it in the Venus OS interface under Settings → Services → MQTT on LAN (Plaintext). Depending on the version, the setting is under Settings → Integrations instead.
Step 3 — Set up MQTT on the WattWächter¶
Open the WattWächter's web interface and go to Configuration → Configure MQTT:
| Field | Entry |
|---|---|
| Host | IP address of Venus OS (or venus.local) |
| Port | 1883 |
| Topic | leave unchanged and note it down, e.g. WattWaechter_39BCCA |
| Full Topic | leave unchanged (%prefix%/%topic%/) |
Save restarts the WattWächter. On the main page under Information, MQTT Connected must show Yes.
Already using another broker?
The WattWächter can only send to one broker. If it is already connected to one, for example Home Assistant's, you can leave it there and enter that broker's IP address (plus username/password) as broker_address in step 4 instead of localhost. Step 2 is then not needed.
Step 4 — Install dbus-mqtt-grid¶
Log in to Venus OS via SSH and download the driver:
ssh root@venus.local
wget -O /tmp/download_dbus-mqtt-grid.sh https://raw.githubusercontent.com/mr-manuel/venus-os_dbus-mqtt-grid/master/download.sh
bash /tmp/download_dbus-mqtt-grid.sh
Select the offered version and confirm the instance prompt with Enter.
Then edit the configuration:
nano /data/etc/dbus-mqtt-grid/config.ini
In the [MQTT] section, enter (<topic> from step 3):
broker_address = localhost
broker_port = 1883
topic = tele/<topic>/SENSOR
For example topic = tele/WattWaechter_39BCCA/SENSOR. Save with Ctrl+O and quit nano with Ctrl+X. Then install the driver as a service:
bash /data/etc/dbus-mqtt-grid/install.sh
After a few seconds the WattWächter appears in the Venus OS interface as an additional device MQTT Grid, showing the current grid power.
Step 5 — Point ESS at the grid meter¶
In the Venus OS interface under Settings → ESS:
- Grid metering: External meter
- Grid setpoint:
0 Wfor pure zero feed-in. A small positive value (e.g. 20–50 W) makes sure that during fast load changes the system tends to draw a little rather than feed in.
The remaining ESS settings (mode, minimum SOC, feeding in excess PV) depend on your installation, see the Victron ESS manual.
Troubleshooting¶
MQTT Grid does not appear or disappears after a minute
dbus-mqtt-grid drops the device when no message arrives for 60 seconds (timeout in config.ini).
- Does the
powerline of the script contain the+16(e.g.power,16)? Without it, power only arrives every 300 seconds. - Does the WattWächter show MQTT Connected Yes? If not: is MQTT enabled in Venus OS (step 2)? Are host and port correct?
- Does
topicinconfig.inimatch the WattWächter's topic exactly (case-sensitive)? -
Check the driver log:
tail -n 100 -F /data/log/dbus-mqtt-grid/current | tai64nlocal
MQTT Grid shows 0 W or no power
The JSON prefix must be exactly grid and the power identifier exactly power (lower case). Check in the WattWächter console that the message contains {"grid":{"power":…}}.
Power has the wrong sign
Venus OS expects positive values for import and negative values for export. If your meter shows both as positive, it cannot tell the direction and is not suitable for zero feed-in. Some meters only output the sign after PIN unlocking.
Changing the configuration
After changing config.ini, restart the driver:
bash /data/etc/dbus-mqtt-grid/restart.sh
Further reading: dbus-mqtt-grid on GitHub, Tasmota → Smart Meter Interface, Victron ESS manual.