Victron VRM API Integration for Home Assistant (hacs)

Victron VRM API

Victron VRM API Integration for Home Assistant

I’d like to present my first custom integration for the Victron VRM API. It’s perfect for mobile systems like motorhomes, caravans and boats where there is no local access to the Victron system. Of course, it can also be used in homes or other projects.

This integration use the Victron VRM Portal to get Data from the API. All you need for Setup are some Numbers from your VRM Portal.

At this Time you can read the Data from Battery, MultiPlus, PV Inverter, Tank and Solar Charger. Also you get the Overall Stats for the Day, Week, Month and Year and a List of connected Devices. I’m working on it, to get some more Data from the victron API.

If you like the Integration, I would appreciate a Star rating :star: from you. :hugs:

VRM API supported Devices and Sensors

Overview Devices

Device Type Number of Sensors
Battery 33
MultiPlus 11
PV Inverter 16
Tank 6
Solar Charger 7
Overall Stats 16
Total 89

Sensor Details

Device Type Sensor Name VRM ID / Key Unit Description
Battery State of charge 51 % State of Charge (SOC)
Battery Voltage 47 V Battery Voltage
Battery Current 49 A Battery Current
Battery Consumed Amphours 50 Ah Consumed Amphours
Battery Time to go 52 h Time to go until empty
Battery Battery Temperature 115 °C Battery Temperature
Battery Minimum Cell Voltage 173 V Minimum Cell Voltage (BMS)
Battery Maximum Cell Voltage 174 V Maximum Cell Voltage (BMS)
Battery Battery Power (Calculated) W Current Power (V*A)
Battery Battery Charge Cycles 58 - Full Charge Cycles
Battery Battery to Consumers (Today) Bc kWh Energy to Load (Today)
Battery Battery to Grid (Today) Bg kWh Energy to Grid (Today)
Battery Low voltage alarm 119 - Low voltage alarm
Battery High voltage alarm 120 - High voltage alarm
Battery Low starter-voltage alarm 121 - Low starter-voltage alarm
Battery High starter-voltage alarm 122 - High starter-voltage alarm
Battery Low state-of-charge alarm 123 - Low state of charge
Battery Low battery temperature alarm 124 - Battery temperature too low
Battery High battery temperature alarm 125 - Battery temperature too high
Battery Mid-voltage alarm 126 - Mid-voltage anomaly
Battery Low fused-voltage alarm 155 - Low fused voltage
Battery High fused-voltage alarm 156 - High fused voltage
Battery Fuse blown alarm 157 - Fuse blown
Battery High internal-temperature alarm 158 - Internal temperature alarm
Battery Cell imbalance alarm 286 - Cell imbalance detected
Battery High charge current alarm 287 - Charge current too high
Battery High discharge current alarm 288 - Discharge current too high
Battery Internal failure 289 - Internal failure detected
Battery High charge temperature alarm 459 - Charge temperature too high
Battery Low charge temperature alarm 460 - Charge temperature too low
Battery Low cell voltage 522 - Low cell voltage
Battery Charge blocked 739 - Charging blocked (BMS)
Battery Discharge blocked 740 - Discharging blocked (BMS)
MultiPlus AC Input Voltage L1 8 V AC Input Voltage Phase 1
MultiPlus AC Input Power L1 17 W AC Input Power Phase 1
MultiPlus AC Output Voltage L1 20 V AC Output Voltage Phase 1
MultiPlus AC Output Power L1 29 W AC Output Power Phase 1
MultiPlus DC Bus Voltage 32 V DC Bus Voltage
MultiPlus DC Bus Current 33 A DC Bus Current
MultiPlus VE.Bus State 40 - Operating State (e.g., Inverting)
MultiPlus MultiPlus Temperature 521 °C Device Temperature
MultiPlus DC Bus Power (Calculated) W Current DC Power (V*A)
MultiPlus Grid to Consumers (Today) Gc kWh Energy from Grid to Load (Today)
MultiPlus Grid to Battery (Today) Gb kWh Energy from Grid to Battery (Today)
PV Inverter L1 Voltage 203 V Voltage Phase 1
PV Inverter L1 Current 204 A Current Phase 1
PV Inverter L1 Power 205 W Power Phase 1
PV Inverter L1 Energy 206 kWh Energy Yield Phase 1 (Total)
PV Inverter L2 Voltage 207 V Voltage Phase 2
PV Inverter L2 Current 208 A Current Phase 2
PV Inverter L2 Power 209 W Power Phase 2
PV Inverter L2 Energy 210 kWh Energy Yield Phase 2 (Total)
PV Inverter L3 Voltage 211 V Voltage Phase 3
PV Inverter L3 Current 212 A Current Phase 3
PV Inverter L3 Power 213 W Power Phase 3
PV Inverter L3 Energy 214 kWh Energy Yield Phase 3 (Total)
PV Inverter Status 246 - Status Code
PV Inverter PV to Consumers (Today) Pc kWh Energy from PV to Load (Today)
PV Inverter PV to Battery (Today) Pb kWh Energy from PV to Battery (Today)
PV Inverter PV to Grid (Today) Pg kWh Energy from PV to Grid (Today)
PV Inverter PV Total Today (Calculated) kWh Total PV Yield Today (Pc+Pb+Pg)
Tank Capacity 328 Tank Capacity
Tank Type 329 - Fluid Type
Tank Level 330 % Fluid Level in Percent
Tank Remaining 331 Remaining Fluid Volume
Tank Status 443 - Tank Status (e.g., OK)
Tank Custom Name 638 - User Defined Name
Solar Charger Battery Watts 107 W Charging Power to Battery
Solar Charger Battery Voltage 81 V Battery Voltage
Solar Charger Charge State 85 - Charger State (e.g., Bulk, Float)
Solar Charger Battery Temperature 83 °C Battery Temperature (external)
Solar Charger Yield Today 94 kWh Energy Yield Today
Solar Charger Yield Yesterday 96 kWh Energy Yield Yesterday
Solar Charger Relay Status 90 - Relay State
Overall Stats * Total Solar Yield total_solar_yield kWh Total PV Yield (for selected period)
Overall Stats * Total Consumption total_consumption kWh Total Consumption (for selected period)
Overall Stats * Grid Energy In grid_history_from kWh Energy from Grid (for selected period)
Overall Stats * Grid Energy Out grid_history_to kWh Energy to Grid (for selected period)

(The Overall Stats Entities are build for Periods Today, Week, Month and Year.)

:heavy_check_mark: Prerequisites

  • VRM access token (keep this secret!). Create one in the VRM Portal under Preferences > Integrations > Access tokens or use this link.

  • your SiteID (VRM-Installations-ID)

  • Instance Number from Battery, Multiplus and PV Inverter

    "How to" - Site_ID, Instance Number, Token

:inbox_tray: Installing the Integration

:arrow_right: HACS

  • Simply follow the Link to integrate this repository to HACS

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

  • go to Settings -> Devices and Services -> Integration
  • click on Add Integration
  • search for victron vrm api or short vrm
  • fill in your Side_ID, Token and Instance_ID for Battery, Multiplus and PV Inverter

:arrow_right: Manual

  • dowonload the latetest Release
  • copy the folder “victron-vrm-api” inside your custom_components of Home Assistant
  • restart home assistant
  • go to Settings -> Devices and Services -> Integration
  • click on Add Integration
  • search for victron vrm api or short vrm
  • fill in your Side_ID, Token and Instance_ID for Battery, Multiplus and PV Inverter

:white_check_mark: How it looks in HA

hacs_badge GitHub release GH-code-size HACS validation
Pictures of Devices inside the Ingration





Q&A
  • Configuration Menu, if the instance number for Battery, Multiplus or PV Inverter is set to 0 or is blank, then no device will be added!
    (Example, if you have no Battery, then you don`t need the empty Device in HA.)
  • You get the Temperature value with a 1PH Multiplus Setup. With 3Ph Multiplus Setup you dont get this Sensor.
  • You can add more instance ids separated by comma (100, 101, 102)
  • You get Data from your 1Ph or 3Ph PV-Inverter. With 3Ph you get some more Sensors.

Perfect — this is exactly what I’ve been looking for. All my Victron equipment is remote on my boat, so this lets me finally move away from all those sensor YAML files.

1 Like

My integration has been officially added to the Hacs today. You can now find, download, and install it directly from the Hacs Store. :slight_smile:

https://github.com/hacs/default/pull/4968

Hi, I finally managed to release a new update (v_1.6). Now two new sensors are integrated: Battery Total Sensor and Cell Voltage Difference Sensor. Additionally, Instance IDs can now be set to 0, which was not possible before. Furthermore, all voltages are now displayed with two decimal places by default, and cell voltages with three.

Hi, the new update is out. I hope the DC load calculation is correct. Also, the System State of Charge for all connected batteries should now be displayed as a percentage under MultiPlus Device. V_1.7 adds a total of 19 new sensors, and the smart meter (grid) can now be read via integration.

A few ESS sensors are also included. Furthermore, the Batteries-, PV-Inverters-, and Solar Chargers-Power are now combined under Overall Stats, providing a total value for all connected devices.

The warnings in the log for HA have been fixed.

Hi, i love your work and i find this integration perfect! Any chance of adding GPS! Would be wounderful.
Thx for your work!

Hello,

really like your Work - good Job! :ok_hand:

I get all my sensors like shown in your pics, everything fine - except one thing:
if i use 3ph ESS, i only get 1 Multiplus out of 3. If searching in VRM for the other instance-ID there is only one for Multiplus MP2 5000, but installed are 3 of them.
In my opinion its from 3ph ESS configuration - but how can i find the other values?

House Load for example:
Victron TCP IP integration has “vebus 227” to get power values for L1, L2, L3.

In the new API config, i only have one MP2 5000 found, so i only get L1 values. L2/L3 are missing, but i need them to show House Load on AC Out 1.

Thanks for your ideas,
best regards

Reply tom myself: i got the GPS working by fetching it via your integration! Perfect :+1::dart::star_struck:

1 Like

What does is look like now? Can you show a screenshot?

Not sure you mean me but here goes…
To get the GPS data from the Cerbo GX into Home Assistant, I used the VRM API (installations endpoint). The tricky part was finding the correct instance ID for the GPS hardware, as it’s often nested deep in the JSON response.

I ended up ‘sniffing’ the data by looking at the raw API output from https://vrmapi.victronenergy.com/v2/installations/{{vrm_id}}/diagnostics. By searching for ‘latitude’ and ‘longitude’ in that huge JSON blob, I found the specific ID for my GPS puck.

I then created a REST sensor in HA that polls the API and uses a template to extract the coordinates. This way, I get a native device_tracker without needing any extra hardware or complex MQTT bridges for the GPS specifically.


1 Like

The way you described, should be easy for me to implement it in the integration. I think I’ll get back to it this weekend.

1 Like

That would be wounderful, thankyou so much :slight_smile: