Victron Energy
Victron Energy systems (inverters, battery storage, solar chargers) expose their data via MQTT on the local network or through the VRM (Victron Remote Management) cloud portal. energy2mqtt connects directly to the Victron GX device’s MQTT interface to retrieve comprehensive energy data.
Details
Victron GX devices include: Cerbo GX, Venus GX, Ekrano GX, and devices running Venus OS. These act as the central hub for your Victron system and provide the MQTT interface.
How It Works
Victron GX devices run Venus OS, which includes a built-in MQTT broker. energy2mqtt connects to this broker and automatically discovers all connected devices: grid meters, batteries, inverters (MultiPlus/Quattro), and solar chargers.
Typical Setup
Connection Options
| Method | Description | Use Case |
|---|---|---|
| Local MQTT | Connect to GX device on LAN | Home network, low latency |
| VRM MQTT | Connect via Victron cloud | Remote access, internet required |
Details
For the best performance and reliability, use the local MQTT connection when energy2mqtt runs on the same network as your Victron system.
Supported Devices
energy2mqtt automatically detects and reads data from:
Grid Meters
AC meters connected to the system (grid connection point):
| Measurement | Description | Unit |
|---|---|---|
energy_positive |
Total energy from grid | kWh |
energy_negative |
Total energy to grid (feed-in) | kWh |
power |
Current total power | W |
frequency |
Grid frequency | Hz |
voltage_l1/l2/l3 |
Per-phase voltage | V |
current_l1/l2/l3 |
Per-phase current | A |
power_l1/l2/l3 |
Per-phase power | W |
Batteries
Battery systems (including Pylontech, BYD, Victron batteries):
| Measurement | Description | Unit |
|---|---|---|
soc |
State of Charge | % |
soh |
State of Health | % |
voltage |
Battery voltage | V |
current |
Charge/discharge current | A |
power |
Battery power | W |
temperature |
Battery temperature | Β°C |
Pylontech-specific data:
| Measurement | Description | Unit |
|---|---|---|
min_cell_temperature |
Coldest cell | Β°C |
max_cell_temperature |
Hottest cell | Β°C |
min_cell_voltage |
Lowest cell voltage | V |
max_cell_voltage |
Highest cell voltage | V |
VEBus Devices (MultiPlus/Quattro)
Inverter/charger energy flow data:
| Measurement | Description | Unit |
|---|---|---|
energy_inv_acin1 |
Inverter to AC-IN1 | kWh |
energy_inv_acin2 |
Inverter to AC-IN2 | kWh |
energy_inv_out |
Inverter to AC-Out | kWh |
energy_out_inv |
AC-Out to Inverter | kWh |
energy_acin1_inv |
AC-IN1 to Inverter | kWh |
energy_acin2_inv |
AC-IN2 to Inverter | kWh |
energy_acin1_acout |
AC-IN1 to AC-Out (bypass) | kWh |
energy_acin2_acout |
AC-IN2 to AC-Out (bypass) | kWh |
energy_acout_acin1 |
AC-Out to AC-IN1 | kWh |
energy_acout_acin2 |
AC-Out to AC-IN2 | kWh |
Victron MQTT Protocol
Topic Structure
Victron uses a specific MQTT topic structure:
| Component | Description | Example |
|---|---|---|
N/ |
Notification prefix | N/ |
portal_id |
Unique system ID | c0619ab38650 |
service |
Device type | grid, battery, vebus |
device_instance |
Device number | 30, 276 |
path |
Data path | Ac/Power, Dc/0/Voltage |
Read Requests
To get current values, energy2mqtt publishes to R/ topics:
Message Format
Values are JSON-encoded:
Configuration
Basic Configuration
Add to your e2m.yaml:
Configuration Parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
name |
Yes | Friendly name for the system | - |
enabled |
Yes | Enable/disable this connection | - |
broker_host |
Yes | IP address or hostname of GX device | - |
broker_port |
Yes | MQTT port | 1883 |
client_name |
No | MQTT client identifier | energy2mqtt |
update_interval |
Yes | Seconds between data updates | - |
Multiple Systems
You can monitor multiple Victron systems:
Enabling MQTT on Your GX Device
By default, MQTT may not be enabled on your Victron GX device.
Via the GX Display/Touch
- Go to Settings β Services
- Enable MQTT on LAN
- Note the IP address shown
Via VRM Portal
- Log in to VRM Portal
- Select your installation
- Go to Settings β Remote Console
- Navigate to Services β MQTT on LAN
- Enable it
Via SSH (Advanced)
Details
The MQTT interface has no authentication by default. Only enable it on trusted networks. Consider using a VLAN or firewall rules to restrict access.
Auto-Discovery
energy2mqtt automatically discovers devices connected to the Victron system:
- Portal ID Detection - Subscribes to
N/+/system/0/Serialto find the system - AC Meter Detection - Reads number of AC inputs and their configuration
- Battery Detection - Reads the battery array from system data
- VEBus Detection - Finds MultiPlus/Quattro devices
All discovered devices are automatically registered with Home Assistant via MQTT auto-discovery.
Output Data
Home Assistant Entities
For each discovered device, energy2mqtt creates Home Assistant entities:
Grid Meter:
sensor.victron_home_system_meter_xxx_powersensor.victron_home_system_meter_xxx_energy_positivesensor.victron_home_system_meter_xxx_energy_negativesensor.victron_home_system_meter_xxx_voltage_l1(and L2, L3)sensor.victron_home_system_meter_xxx_frequency
Battery:
sensor.victron_home_system_battery_0_socsensor.victron_home_system_battery_0_sohsensor.victron_home_system_battery_0_powersensor.victron_home_system_battery_0_voltagesensor.victron_home_system_battery_0_temperature
Example Output JSON
Understanding Energy Flow
Victron systems track energy flow in multiple directions:
Energy counters explained:
| Counter | Flow Direction |
|---|---|
acin1_inv |
Grid β Inverter β Battery (charging) |
inv_acin1 |
Battery β Inverter β Grid (feed-in) |
acin1_acout |
Grid β AC-Out directly (bypass) |
inv_out |
Battery β Inverter β Loads |
out_inv |
AC-Out β Inverter β Battery (e.g., PV on AC-Out) |
Troubleshooting
Cannot Connect to MQTT
Check if MQTT is enabled:
You should see messages appearing. If not:
- Verify MQTT is enabled on the GX device
- Check firewall rules
- Verify IP address
No Devices Discovered
Check portal ID detection:
- Look in energy2mqtt logs for “Portal id found”
- If missing, the GX device might not be publishing system data
Verify system serial:
Missing Data Points
Some values show as 0 or missing:
- Not all Victron devices report all values
- Check if the device is physically connected
- Some values only appear when relevant (e.g., L2/L3 on single-phase systems)
Connection Drops
Frequent disconnections:
- Increase
update_intervalto reduce load - Check network stability
- Verify GX device isn’t overloaded with MQTT clients
Advanced: VRM Cloud MQTT
For remote access without local network connectivity, you can connect via VRM’s MQTT broker.
Details
TODO: Document VRM MQTT broker connection including:
- VRM MQTT broker address
- Authentication setup
- SSL/TLS configuration
- Topic structure differences