Chrome uHO6C3vFFr

Add your Victron system in Home Assistant

If you would like to add your Victron System into Home Assistant to get graphs, stats and be able to do some automations related to your system, this is the right place!

Requirements

In order to be able to get your data in Home Assistant, you need a Venus device:

  • Color Control GX, also known as CCGX, which is what I'm using for this blogpost.
  • Venux GX
  • Cerbo
  • Raspberry PI running Venus OS (you can find guides online)

You also need a functionning Home Assistant installation. It's preferred that both be in the same network and can communicate directly without going through routers or firewalls.

Enabling Modbus/TCP

You need to enable the Modbus/TCP service in Venus:

  • Go to the menu
  • Settings
  • Services
  • Modbus/TCP -> Enable

Enable Modbus/TCP

Get the IP address of your Venus device.

Find the IP address of your Victron System:

  • Go to the menu
  • Settings
  • Ethernet / or Wifi
  • The IP Address wil be shown.

Configure the Modbus integration in Home assistant

I recommend separating the configuration of Modbus entities in a separate file to keep the configuration clear. You need to enable and configure the Modbus integration in the root level of your configuration.yaml

modbus:
  - name: house
    host: 192.168.1.118 
    type: tcp
    port: 502
  • The name attribute here is important as it will be used as the hub name in the next step.
  • Obviously, use the proper IP Address in the host field for your setup.

Then you can add your sensors. In my configuration, I have a folder containing various yaml files to keep my sensors organized:

sensor: !include_dir_merge_list /config/sensors/

In my /config/sensors/ folder, I then have my config files. Here is an example you can use to add your Modbus Victron devices.

04-victron.yaml :

# -- HOME SYSTEM
# Modbus device (slave) IDs: /!\ Only for my system
# BMV 245
# MPPT Top 239
# Grid meter 30
# MPPT Top Panels 247
# MPPT Flat panels 238
# Multiplus 246
# Main System 100

- platform: modbus
  scan_interval: 5
  registers:
    # SYSTEM
    - name: "Victron Home AC Consumption"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 100
      register: 817
      scale: 1

    - name: "Victron Home Grid"
      hub: house
      data_type: int
      unit_of_measurement: "W"
      slave: 100
      register: 820
      scale: 1

    - name: "Victron Home Battery voltage"
      hub: house
      data_type: uint
      unit_of_measurement: "V"
      slave: 100
      register: 840
      scale: 0.1
    - name: "Victron Home Battery Current"
      hub: house
      data_type: int
      unit_of_measurement: "A"
      slave: 100
      register: 841
      scale: 0.1
    - name: "Victron Home Battery Power"
      hub: house
      data_type: int
      unit_of_measurement: "W"
      slave: 100
      register: 842
      scale: 1
    - name: "Victron Home PV Power"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 100
      register: 850
      scale: 1


      # BMV
    - name: "Victron Home Battery SOC"
      hub: house
      data_type: uint
      unit_of_measurement: "%"
      slave: 245
      register: 266
      scale: 0.1
    - name: "Victron Home Time to go"
      hub: house
      data_type: uint
      unit_of_measurement: "seconds"
      slave: 245
      register: 303
      scale: 100

      # MPPT Top Array
    - name: "Victron Top PV Voltage"
      hub: house
      data_type: uint
      unit_of_measurement: "V"
      slave: 247
      register: 776
      scale: 0.01
    - name: "Victron Top PV Current"
      hub: house
      data_type: int
      unit_of_measurement: "A"
      slave: 247
      register: 777
      scale: 0.1
    - name: "Victron Top PV Power"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 247
      register: 789
      scale: 0.1
    - name: "Victron Top MPP Operation mode"
      hub: house
      data_type: uint
      slave: 247
      register: 791
      scale: 1
    - name: "Victron Top Yield today"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 247
      register: 784
      scale: 0.1
      precision: 3
    - name: "Victron Top Max power today"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 247
      register: 785
      scale: 1
    - name: "Victron Top Yield yesterday"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 247
      register: 786
      scale: 0.1
      precision: 3
    - name: "Victron Top Max power yesterday"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 247
      register: 787
      scale: 1

      # MPPT Flat roof Array
    - name: "Victron Flat PV Voltage"
      hub: house
      data_type: uint
      unit_of_measurement: "V"
      slave: 238
      register: 776
      scale: 0.01
    - name: "Victron Flat PV Current"
      hub: house
      data_type: int
      unit_of_measurement: "A"
      slave: 238
      register: 777
      scale: 0.1
    - name: "Victron Flat PV Power"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 238
      register: 789
      scale: 0.1
    - name: "Victron Flat MPP Operation mode"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 238
      register: 791
      scale: 1
    - name: "Victron Flat Yield today"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 238
      register: 784
      scale: 0.1
      precision: 3
    - name: "Victron Flat Max power today"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 238
      register: 785
      scale: 1
    - name: "Victron Flat Yield yesterday"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 238
      register: 786
      scale: 0.1
      precision: 3
    - name: "Victron Flat Max power yesterday"
      hub: house
      data_type: uint
      unit_of_measurement: "W"
      slave: 238
      register: 787
      scale: 1

Here is the explanation of the settings:

  • name: The name the sensor will appear under in Home Assistant
  • hub: The name of the "Modbus hub" configured previously.
  • data_type: Can be unsigned integer (uint) or integer (int), depends on the register.
  • unit_of_measurement: is pretty self explanatory.
  • slave: Is the device ID of the device you will be querying. You can find all the device ID of your system in the Modbus menu.
  • register: The Register ID for the value you are requesting. An Excel file is available on the Website of Victron Energy with all the IDs.
  • scale: Refers to the scale of the value. Invert the value found in the Excel file. Ex: the file mentions 10, it needs to be 1/10 = 0.1.
  • precision: Mostly important for float values.

Once You have configured your system as you like it, you can make fancy dashboards in Home assistant or even Grafana:

chrome Z6j3OhHbkHchrome gT6iosoukYchrome uHO6C3vFFr

A very interesting feature is the ability to switch on/off loads when the batteries are full or/amd get a notification. I might create a new blog post in the future about these features.

Hope you will enjoy even more data in your Home assistant!

More ressources:

{{ message }}

{{ 'Comments are closed.' | trans }}