Victron Venus OS with MQTT sensors, switches and numbers

Victron is cool, Home Assistant is cool but they don’t work together pretty well. Until now.
I’ve found other different ways of connecting them together, but, they didn’t work reliably for me.

With Modbus you have to poll the Venus OS every 5 seconds and sometimes you don’t get all the data. At least for me that was the case. Like this one here.

I also found the victron integration hass-victron but this is using modbus too and there were times I had to restart the integration to get data again.

There must be a better way doing this.

Venus OS has a built in MQTT Server, that should be usable.

With MQTT you get instant data, when the venus OS updates. And that is way better than 5 Second Modbus polling with missing data.

What you get, when you’re done:

What you need:

  • Home Assistant
  • MQTT Server (use the Add-on)
  • Samba NAS Add-on for access to the configuration files
  • Venus OS running on a GX device or raspberry
  • MQTT Explorer (find it here) can also be used as an Add-on

Venus OS and Home Assistant need to be on the same network!

Steps for a working setup

  1. Enable MQTT on your Venus OS
  2. Check the MQTT with MQTT Explorer
  3. Install MQTT Server on your HA
  4. Install Samba NAS on your HA
  5. Configure the bridge Venus - HA
  6. Check the Bridge with MQTT Explorer
  7. Create the keep-alive automation
  8. Check data coming in with MQTT Explorer (Topic will be venus-home/N/your-venus-id/#
  9. Create all needed sensors in your mqtt.yaml
  10. Smile :grinning:
  11. Maybe change your recorder settings so your HA database can keep up

Follow this guide for setting up the mqtt bridge connection between your HA and the Venus OS
Scroll down to Bridge your Victron Energy Venus device to your MQTT server in Home Assistant. (The internal and direct links on this page don’t work.)

Alternative guide for the initial setup.

After you manged that you need to configure all your sensors you want to see in your home assistant.

Be sure to change the device id (your-venus-id) to the id of your system.

Here are the sensors and switches I am using. this list is far from being complete and every solar setup is different. I have a cerbo, a Multiplus, a MPPT solar charger and an EM24 smart meter.

I did combine these sensors into devices, so I have all the sensors in 3 devices.

Please Add your sensors, switches and number inputs to this list.

Switches

switch:

    #Multiplus Entladeleistung Begrenzen !Number
      - unique_id: multiplus_switch_discharge_power
        name: Wechselrichterleistung begrenzen
        command_topic: "venus-home/W/your-victron-id/settings/0/Settings/CGwacs/MaxDischargePower"
        payload_on: '{"value": 1000}'
        payload_off: '{"value": -1}'
        state_topic: "venus-home/N/your-victron-id/settings/0/Settings/CGwacs/MaxDischargePower"
        value_template: >
          {% if value_json.value | int == -1 %}
            {% set state_limit = 'OFF' %}
          {% else %}
            {% set state_limit = 'ON' %}
          {% endif %}
          {{ state_limit }}
        state_on: 'ON'
        state_off: 'OFF'
        
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Multiplus AC PV-Überschuss einspeisen
      - unique_id: multiplus_allow_ac_feed_in
        name: Überschuss AC einspeisen
        command_topic: "venus-home/W/your-victron-id/settings/0/Settings/CGwacs/PreventFeedback"
        payload_on: '{"value": 0}'
        payload_off: '{"value": 1}'
        state_topic: "venus-home/N/your-victron-id/settings/0/Settings/CGwacs/PreventFeedback"
        value_template: "{{ value_json.value | int }}"
        state_on: '0'
        state_off: '1'
        
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Multiplus DC PV-Überschuss einspeisen
      - unique_id: multiplus_allow_dc_feed_in
        name: Überschuss DC einspeisen
        command_topic: "venus-home/W/your-victron-id/settings/0/Settings/CGwacs/OvervoltageFeedIn"
        payload_on: '{"value": 1}'
        payload_off: '{"value": 0}'
        state_topic: "venus-home/N/your-victron-id/settings/0/Settings/CGwacs/OvervoltageFeedIn"
        value_template: "{{ value_json.value | int }}"
        state_on: '1'
        state_off: '0'
        
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}

Numbers:

    number:
    
    #Multiplus Netzsollwert
      - unique_id: multiplus_grid_setpoint
        name: Netz Sollwert
        min: -4000
        max: 4000
        step: 10
        mode: box
        command_topic: "venus-home/W/your-victron-id/settings/0/Settings/CGwacs/AcPowerSetPoint"
        command_template: '{"value": {{ value }} }'
        state_topic: "venus-home/N/your-victron-id/settings/0/Settings/CGwacs/AcPowerSetPoint"
        value_template: "{{value_json.value | round(0) }}"
        device_class: power
        unit_of_measurement: W
        icon: mdi:meter-electric-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Multiplus Limit AC Stromstärke
      - unique_id: multiplus_ac_current_limit
        name: Netz Max Strom
        min: 0
        max: 25
        step: 1
        mode: box
        command_topic: "venus-home/W/your-victron-id/vebus/276/Ac/ActiveIn/CurrentLimit"
        command_template: '{"value": {{ value }} }'
        state_topic: "venus-home/N/your-victron-id/vebus/276/Ac/ActiveIn/CurrentLimit"
        value_template: "{{ value_json.value }}"
        device_class: current
        unit_of_measurement: A
        icon: mdi:current-ac
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    
    #Multiplus Minimum SOC
      - unique_id: multiplus_min_soc
        name: Akku Min SOC
        min: 20
        max: 100
        step: 5
        mode: box
        command_topic: "venus-home/W/your-victron-id/settings/0/Settings/CGwacs/BatteryLife/MinimumSocLimit"
        command_template: '{"value": {{ value }} }'
        state_topic: "venus-home/N/your-victron-id/settings/0/Settings/CGwacs/BatteryLife/MinimumSocLimit"
        value_template: "{{value_json.value | round(0) }}"
        device_class: battery
        icon: mdi:battery-20
        unit_of_measurement: '%'
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Multiplus Maximum SOC
      - unique_id: multiplus_max_soc
        name: Akku Max SOC
        min: 50
        max: 100
        step: 5
        mode: box
        command_topic: "venus-home/W/your-victron-id/settings/0/Settings/CGwacs/MaxChargePercentage"
        command_template: '{"value": {{ value }} }'
        state_topic: "venus-home/N/your-victron-id/settings/0/Settings/CGwacs/MaxChargePercentage"
        value_template: "{{value_json.value | round(0) }}"
        device_class: battery
        icon: mdi:battery-90
        unit_of_measurement: '%'
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Multiplus Aktives SOC Limit
      - unique_id: multiplus_soc_limit
        name: Akku SOC Limit
        min: 20
        max: 90
        step: 5
        mode: box
        command_topic: "venus-home/W/your-victron-id/settings/0/Settings/CGwacs/BatteryLife/SocLimit"
        command_template: '{"value": {{ value }} }'
        state_topic: "venus-home/N/your-victron-id/settings/0/Settings/CGwacs/BatteryLife/SocLimit"
        value_template: "{{value_json.value | round(0) }}"
        device_class: battery
        icon: mdi:battery-60
        unit_of_measurement: '%'
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Multiplus Maximale Entladeleistung
      - unique_id: multiplus_discharge_power
        name: Maximale Wechselrichterleistung
        min: 0
        max: 10000
        step: 50
        mode: box
        command_topic: "venus-home/W/your-victron-id/settings/0/Settings/CGwacs/MaxDischargePower"
        command_template: '{"value": {{ value }} }'
        state_topic: "venus-home/N/your-victron-id/settings/0/Settings/CGwacs/MaxDischargePower"
        value_template: >
          {% if value_json.value == -1 %}
            10000
          {% else %}
            {{value_json.value | round(0) }}
          {% endif %}
    
        device_class: power
        icon: mdi:battery-arrow-down-outline
        unit_of_measurement: W
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}

Binary sensors:

    binary_sensor:  
    
    # Victron MQTT Sensoren
    
    #Cerbo General Alarm
      - unique_id: victron_buzzer
        name: Systemstatus
        state_topic: "venus-home/N/your-victron-id/system/0/Buzzer/State"
        value_template: "{{ value_json.value }}"
        payload_on: "1"
        payload_off: "0"
        icon: mdi:information-outline
        device_class: problem
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Cerbo Laden erlaubt
      - unique_id: cerbo_allow_to_charge
        name: Akku Laden erlaubt
        state_topic: "venus-home/N/your-victron-id/battery/1/Io/AllowToCharge"
        value_template: "{{ value_json.value }}"
        payload_on: "1"
        payload_off: "0"
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
     
    #Cerbo Entaden erlaubt
      - unique_id: cerbo_allow_to_discharge
        name: Akku Entladen erlaubt
        state_topic: "venus-home/N/your-victron-id/battery/1/Io/AllowToDischarge"
        value_template: "{{ value_json.value }}"
        payload_on: "1"
        payload_off: "0"
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Solarlader Bus verbunden
      - unique_id: victron_solar_charger_connected
        name: MPPT250 VE.Can
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Connected"
        value_template: "{{ value_json.value }}"
        payload_on: "1"
        payload_off: "0"
        icon: mdi:cable-data
        device_class: plug
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    
    #Victron Solarlader BMS
      - unique_id: victron_solar_charger_bms_connected
        name: MPPT250 BMS
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Settings/BmsPresent"
        value_template: "{{ value_json.value }}"
        payload_on: "1"
        payload_off: "0"
        icon: mdi:cable-data
        device_class: plug
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
9 Likes

Sensors:

    sensor:
    
    #Victron Solarlader Ladestatus
      - unique_id: victron_solar_charger_state
        name: MPPT250 Status
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/State"
        value_template: >
          {% if value_json.value == 0 %}
            Aus
          {% elif value_json.value == 252 %}
            Charging
          {% elif value_json.value == 2 %}
            Fehler
          {% elif value_json.value == 3 %}
            Bulk
          {% elif value_json.value == 4 %}
            Absorption
          {% elif value_json.value == 5 %}
            Float
          {% elif value_json.value == 6 %}
            Storage
          {% elif value_json.value == 7 %}
            Equalize
          {% else %}
            Error - No Data
          {% endif %}    
        
        
        
        icon: mdi:sun-angle-outline
        
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Akku Typ
    
      - unique_id: victron_solar_charger_battery_voltage_set
        name: MPPT250 Akkueinstellung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Settings/BatteryVoltageSetting"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:alpha-v-box
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Stromstärke
    
      - unique_id: victron_solar_charger_current
        name: MPPT250 Ladestrom
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Dc/0/Current"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:current-dc
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Begrenzung Stromstärke
    
      - unique_id: victron_solar_max_charger_current
        name: MPPT250 Maximaler Ladestrom
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Settings/ChargeCurrentLimit"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:battery-charging-high
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Spannung Akku
    
      - unique_id: victron_solar_charger_voltage_battery
        name: MPPT250 Akkuspannung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Dc/0/Voltage"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:alpha-v-box
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Spannung Solarpanels
    
      - unique_id: victron_solar_charger_voltage
        name: MPPT250 PV Spannung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Pv/V"
        value_template: "{{ value_json.value | round (2)}}"
        icon: mdi:alpha-v-box
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Leistung
    
      - unique_id: victron_solar_charger_power
        name: MPPT250 PV Leistung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Yield/Power"
        value_template: "{{ value_json.value | round (2)}}"
        icon: mdi:solar-power
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Ertrag Heute
    
      - unique_id: victron_solar_charger_yield_today
        name: MPPT250 Ertrag heute
        device_class: energy
        unit_of_measurement: kWh
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/History/Daily/0/Yield"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:solar-power-variant-outline
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Ertrag Gestern
    
      - unique_id: victron_solar_charger_yield_yesterday
        name: MPPT250 Ertrag gestern
        device_class: energy
        unit_of_measurement: kWh
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/History/Daily/1/Yield"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:solar-power-variant-outline
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    #Victron Solarlader Ertrag Gesamt
    
      - unique_id: victron_solar_charger_yield_overall
        name: MPPT250 Ertrag gesamt
        state_class: total_increasing
        device_class: energy
        unit_of_measurement: kWh
        state_topic: "venus-home/N/your-victron-id/solarcharger/0/Yield/System"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:solar-power-variant-outline
        device: {
          identifiers: [
           "Victron MPPT 250/100"
          ],
          manufacturer: "Victron Energy",
          model: "MPPT 250/100",
          name: "MPPT 250/100 Dach Büro"}
    
    
    #Victron Cerbo Akku Einstellungen Mindestspannung
      - unique_id: cerbo_battery_low_voltage
        name: Akku Mindestspannung
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Info/BatteryLowVoltage"
        value_template: "{{ value_json.value | round (2)}}"
        icon: mdi:arrow-collapse-down
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Einstellungen Höchstspannung
      - unique_id: cerbo_battery_max_voltage
        name: Akku Höchstspannung
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Info/MaxChargeVoltage"
        value_template: "{{ value_json.value | round (2)}}"
        icon: mdi:arrow-collapse-up
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Einstellungen Maximaler Ladestrom
      - unique_id: cerbo_battery_max_charge_current
        name: Akku Maximaler Ladestrom
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/battery/1/Info/MaxChargeCurrent"
        value_template: "{{ value_json.value | round (2)}}"
        icon: mdi:battery-charging-high
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Gesamtkapazität
      - unique_id: cerbo_battery_full_capacity
        name: Akku Kapazität gesamt
        device_class: power
        unit_of_measurement: Ah
        state_topic: "venus-home/N/your-victron-id/battery/1/InstalledCapacity"
        value_template: "{{ value_json.value | round (2)}}"
        icon: mdi:battery-high
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Restkapazität
      - unique_id: cerbo_battery_actual_capacity
        name: Akku Kapazität verbleibend
        device_class: power
        unit_of_measurement: Ah
        state_topic: "venus-home/N/your-victron-id/battery/1/Capacity"
        value_template: "{{ value_json.value | round (2)}}"
        icon: mdi:battery-medium
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Stromstärke laden
      - unique_id: cerbo_battery_charge_current
        name: Akku Ladestrom
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/battery/1/Dc/0/Current"
        value_template: >
          {% if value_json.value | float > 0%}
            {% set battery_current_in = value_json.value | round(2) | abs  %}
          {% else %}
            {% set battery_current_in = 0 %}
          {% endif %}
          {{ battery_current_in | round (2) }}
        icon: mdi:battery-arrow-up-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Multiplus Aktive Einspeisung
      - unique_id: cerbo_multiplus_energy_to_grid
        name: Leistung Einspeisung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/vebus/276/Ac/ActiveIn/L1/P"
        value_template: >
          {% if value_json.value | float < 0%}
            {% set energy_level = value_json.value | round(2) | abs  %}
          {% else %}
            {% set energy_level = 0 %}
          {% endif %}
          {{ energy_level | round (2) }}
        icon: mdi:lightning-bolt-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    
    #Victron Cerbo Multiplus Aktive Entnahme
      - unique_id: cerbo_multiplus_energy_from_grid
        name: Leistung Entnahme
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/vebus/276/Ac/ActiveIn/L1/P"
        value_template: >
          {% if value_json.value | float > 0%}
            {% set energy_level_in = value_json.value | round(2) | abs  %}
          {% else %}
            {% set energy_level_in = 0 %}
          {% endif %}
          {{ energy_level_in | round (2) }}
        icon: mdi:lightning-bolt-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    
    #Victron Cerbo Akku Stromstärke entladen
      - unique_id: cerbo_battery_discharge_current
        name: Akku Entladestrom
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/battery/1/Dc/0/Current"
        value_template: >
          {% if value_json.value | float < 0%}
            {% set battery_current_out = value_json.value | round(2) | abs  %}
          {% else %}
            {% set battery_current_out = 0 %}
          {% endif %}
          {{ battery_current_out | round(2) }}
        icon: mdi:battery-arrow-down-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Stromstärke
      - unique_id: cerbo_battery_current
        name: Akku Strom
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/battery/1/Dc/0/Current"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:battery-charging-medium
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Leistung 
      - unique_id: cerbo_battery_power
        name: Akku Leistung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/battery/1/Dc/0/Power"
        value_template: "{{value_json.value | round(2) }}"
        icon: mdi:battery-charging-medium
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Leistung laden
      - unique_id: cerbo_battery_charge_power
        name: Akku Ladeleistung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/battery/1/Dc/0/Power"
        value_template: >
          {% if value_json.value | float > 0%}
            {% set battery_power_in = value_json.value | round(2) | abs  %}
          {% else %}
            {% set battery_power_in = 0 %}
          {% endif %}
          {{ battery_power_in | round(2) }}
        icon: mdi:battery-plus-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Leistung entladen
      - unique_id: cerbo_battery_discharge_power
        name: Akku Entladeleistung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/battery/1/Dc/0/Power"
        value_template: >
          {% if value_json.value | float < 0%}
            {% set battery_power_out = value_json.value | round(2) | abs  %}
          {% else %}
            {% set battery_power_out = 0 %}
          {% endif %}
          {{ battery_power_out | round(2) }}
        icon: mdi:battery-arrow-down-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku SOC 
      - unique_id: cerbo_battery_soc
        name: Akku SOC
        device_class: battery
        unit_of_measurement: '%'
        state_topic: "venus-home/N/your-victron-id/battery/1/Soc"
        value_template: "{{value_json.value | round(2) }}"
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku Temperatur 
      - unique_id: cerbo_battery_temperature
        name: Akku Temperatur
        device_class: temperature
        unit_of_measurement: '°C'
        state_topic: "venus-home/N/your-victron-id/battery/1/Dc/0/Temperature"
        value_template: "{{value_json.value | round(2) }}"
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku höchste Zelltemperatur 
      - unique_id: cerbo_battery_max_temperature
        name: Akku Max Zelltemperatur
        state_class: measurement
        device_class: temperature
        unit_of_measurement: '°C'
        state_topic: "venus-home/N/your-victron-id/battery/1/System/MaxCellTemperature"
        value_template: "{{value_json.value | round(2) }}"
        icon: mdi:thermometer-chevron-up
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku geringste Zelltemperatur 
      - unique_id: cerbo_battery_min_temperature
        name: Akku Min Zelltemperatur
        state_class: measurement
        device_class: temperature
        unit_of_measurement: '°C'
        state_topic: "venus-home/N/your-victron-id/battery/1/System/MinCellTemperature"
        value_template: "{{value_json.value | round(2) }}"
        icon: mdi:thermometer-chevron-down
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku höchste Zellspannung 
      - unique_id: cerbo_battery_max_cellvoltage
        name: Akku Max Zellspannung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/System/MaxCellVoltage"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku höchste Zellspannung Nr
      - unique_id: cerbo_battery_max_cellvoltage_number
        name: Akku Max Zellspannung Nummer
        state_topic: "venus-home/N/your-victron-id/battery/1/System/MaxVoltageCellId"
        value_template: "{{value_json.value }}"
        icon: mdi:counter
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku niedrigste Zellspannung  Nr
      - unique_id: cerbo_battery_min_cellvoltage_number
        name: Akku Min Zellspannung Nummer
        state_topic: "venus-home/N/your-victron-id/battery/1/System/MinVoltageCellId"
        value_template: "{{value_json.value }}"
        icon: mdi:counter
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akku niedrigste Zellspannung 
      - unique_id: cerbo_battery_min_cellvoltage
        name: Akku Min Zellspannung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/System/MinCellVoltage"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 1
      - unique_id: cerbo_battery_cellvoltage_1
        name: Akku Zellspannung 01
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell1"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 2
      - unique_id: cerbo_battery_cellvoltage_2
        name: Akku Zellspannung 02
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell2"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 3
      - unique_id: cerbo_battery_cellvoltage_3
        name: Akku Zellspannung 03
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell3"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 4
      - unique_id: cerbo_battery_cellvoltage_4
        name: Akku Zellspannung 04
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell4"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 5
      - unique_id: cerbo_battery_cellvoltage_5
        name: Akku Zellspannung 05
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell5"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 6
      - unique_id: cerbo_battery_cellvoltage_6
        name: Akku Zellspannung 06
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell6"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 7
      - unique_id: cerbo_battery_cellvoltage_7
        name: Akku Zellspannung 07
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell7"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 8
      - unique_id: cerbo_battery_cellvoltage_8
        name: Akku Zellspannung 08
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell8"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 9
      - unique_id: cerbo_battery_cellvoltage_9
        name: Akku Zellspannung 09
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell9"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 10
      - unique_id: cerbo_battery_cellvoltage_10
        name: Akku Zellspannung 10
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell10"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 11
      - unique_id: cerbo_battery_cellvoltage_11
        name: Akku Zellspannung 11
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell11"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 12
      - unique_id: cerbo_battery_cellvoltage_12
        name: Akku Zellspannung 12
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell12"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 13
      - unique_id: cerbo_battery_cellvoltage_13
        name: Akku Zellspannung 13
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell13"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 14
      - unique_id: cerbo_battery_cellvoltage_14
        name: Akku Zellspannung 14
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell14"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 15
      - unique_id: cerbo_battery_cellvoltage_15
        name: Akku Zellspannung 15
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell15"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung 16
      - unique_id: cerbo_battery_cellvoltage_16
        name: Akku Zellspannung 16
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Cell16"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Zellspannung Delta
      - unique_id: cerbo_battery_delta_cellvoltage
        name: Akku Zellendifferenz
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Diff"
        value_template: "{{value_json.value | round(3) }}"
        icon: mdi:delta
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
    
    #Victron Cerbo Akkuspannung
      - unique_id: cerbo_battery_voltage
        name: Akku Spannung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/battery/1/Voltages/Sum"
        value_template: "{{value_json.value | round(2) }}"
        icon: mdi:alpha-v-box-outline
        device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}
1 Like

    #EM24 Power / Current / Voltage / Import / Export
    
    #Gesamtbezug
    
      - unique_id: grid_forward
        name: EM24 Netz Gesamtbezug
        state_class: total_increasing
        device_class: energy
        unit_of_measurement: kWh
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/Energy/Forward"
        value_template: "{{ value_json.value | round(2) }}"
        icon: mdi:transmission-tower-export
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    #Gesamteinspeisung
    
      - unique_id: grid_reversed
        name: EM24 Netz Gesamteinspeisung
        state_class: total_increasing
        device_class: energy
        unit_of_measurement: kWh
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/Energy/Reverse"
        value_template: "{{ value_json.value | round(2)}}"
        icon: mdi:transmission-tower-import
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    #Gesamtleistung
      - unique_id: grid_power_combined
        name: EM24 Netz Gesamtleistung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/Power"
        value_template: "{{ value_json.value }}"
        icon: mdi:meter-electric-outline
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    #Netzfrequenz
      - unique_id: grid_frequency
        name: EM24 Netz Frequenz
        state_class: measurement
        device_class: frequency
        unit_of_measurement: Hz
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/Frequency"
        value_template: "{{ value_json.value }}"
        icon: mdi:cosine-wave
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    #Leistung L1
      - unique_id: grid_l1_power
        name: EM24 Netz L1 Leistung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L1/Power"
        value_template: "{{ value_json.value }}"
        icon: mdi:lightning-bolt
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    # Spannung L1
      - unique_id: grid_l1_voltage
        name: EM24 Netz L1 Spannung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L1/Voltage"
        value_template: "{{ value_json.value }}"
        icon: mdi:sine-wave
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    # Stromstärke L1
      - unique_id: grid_l1_current
        name: EM24 Netz L1 Strom
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L1/Current"
        value_template: "{{ value_json.value }}"
        icon: mdi:current-ac
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    #Leistung L2
      - unique_id: grid_l2_power
        name: EM24 Netz L2 Leistung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L2/Power"
        value_template: "{{ value_json.value }}"
        icon: mdi:lightning-bolt
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    # Spannung L2
      - unique_id: grid_l2_voltage
        name: EM24 Netz L2 Spannung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L2/Voltage"
        value_template: "{{ value_json.value }}"
        icon: mdi:sine-wave
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    # Stromstärke L2
      - unique_id: grid_l2_current
        name: EM24 Netz L2 Strom
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L2/Current"
        value_template: "{{ value_json.value }}"
        icon: mdi:current-ac
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    
    #Leistung L3
      - unique_id: grid_l3_power
        name: EM24 Netz L3 Leistung
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L3/Power"
        value_template: "{{ value_json.value }}"
        icon: mdi:lightning-bolt
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    # Spannung L3
      - unique_id: grid_l3_voltage
        name: EM24 Netz L3 Spannung
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L3/Voltage"
        value_template: "{{ value_json.value }}"
        icon: mdi:sine-wave
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}
    
    # Stromstärke L3
      - unique_id: grid_l3_current
        name: EM24 Netz L3 Strom
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        state_topic: "venus-home/N/your-victron-id/grid/40/Ac/L3/Current"
        value_template: "{{ value_json.value }}"
        icon: mdi:current-ac
        device: {
          identifiers: [
           "EM24"
          ],
          manufacturer: "Carlo Gavazzi",
          model: "EM24 ETH",
          name: "EM24 Ethernet"}

Change your recoder settings in your configuration.yaml:

    recorder:
      auto_purge: true
      commit_interval: 10
      exclude:
        entity_globs:
         - sensor.akku_max*
         - sensor.akku_min*
         - sensor.akku_zell*```
4 Likes

thanks! Works great!

Thank You! This is absolutely brilliant :slight_smile:

@262kqx If I customize the MQTT Mosquitto Addon as per the manuals. Can i still use the other MQTT devices on the network?

1 Like

Yes. it just connects to the victron mqtt and integrates it. All the other topics will still be there.

1 Like

This all works really great. I was wondering what the purpose of the code below is? Do I have to include that? What does it do?

device: {
          identifiers: [
           "Victron Cerbo GX"
          ],
          manufacturer: "Victron Energy",
          model: "Cerbo GX",
          name: "Cerbo GX"}

awesome … saved me tons of time!
Thanks

That is for home assistant to have it all in one device. not needed, but neater.

1 Like

Is their support for MQTT Discovery ? This would make this much easier, I think?

I’m having a few issues and not sure what steps to take next. My bridge works, I get MQTT data in and am able to setup sensors etc. Then after a random period of time I stop getting updates. I have the keepalive script running, the random amount of time is multiple hours of working correctly then it will break. One thing I’ve noticed was when I start Mosquitto broker I see it loading the config file, but I don’t have any “connecting bridge” or any further logs after that point.

What are you doing to resume getting MQTT Messages after they stop? I only set this up 4 days ago. It worked fine for the 4 days. Last night, Home Assistant stopped getting MQTT messages from Venus. In my case, Venus is running on a Raspberry Pi 3b+, using wired ethernet. I can browse the Venus UI fine from another device, and also browse the Home Assistant UI from another device, so all networking is fine. I restarted Home Assistant, and restarted the Pi running Venus, still no MQTT messages. The stayalive message is being sent every 30 seconds. I did update Home Assistant last night, so am unsure if that is likely to have caused this.

I can go in to Mosquitto config, and listen for venus-home/# mqtt messages, and the only message is the stayalive message every 30 seconds. In the Venus UI, MTQQ is still turned on. I noticed that there was a new update to Venus available, so I did that install (Large version), but still no MQTT messages from Venus since last night.

So, yea, I only lost MQTT messages once, and it has never come back.

I did get the MQTT communications back again. I chose to Shut down Home Assistant fully, left it off for a few minutes, and turned it back on. Suddenly, MQTT was working again. Here is my theory: I performed a Home Assistant update yesterday. I am relatively certain that caused the issue, due to that being about the time I lost the messages from Venus. In an attempt to get Venus messages again, I was restarting Home Assistant with the “Restart Home Assistant” option, but that is not enough. Only the Reboot, or shutdown options will clear this issue. It is possible that Mosquitto was stopped, but I do not believe this is the case, as Home Assistant has an unbroken history of data from other devices on my network that were sending data over MQTT over this entire period.

Anyway, I still do not know the exact issue, but I am fairly certain that the update to Home Assistant caused the issue, and that a full reboot of Home Assistant fixed it. And for some reason, it only negatively effects MQTT messages from Venus.

I also run Venus on a 3b+, but i’ve been able to get messages back either through restarting the add-on (I even tried to automate it but have been unsuccessful) or worst case restarting Venus and/or HA (running on 3b+ also). I started looking at alternatives to MQTT and installed Venus OS Large yesterday morning to potentially look at the node-red integration and since then it has not failed. This is the longest my MQTT bridge/listener/connector etc has continued to work without a failure. Im not confident I “solved” anything but so far much better. My home HA uses MQTT but not a bridge and its worked flawlessly for many years which leads me to believe its the bridge function that is the culprit here.

Spoke to soon. While I have had no data stoppage for 24 hours now, I am unable to make changes to Victron equipment with MQTT publish, this was working before.

Seems this was a problem with HA. Had this too after a reboot. Manually restarting mosquitto solved the issue. With the newest version of HA it works right after the update. In the log it was a problem connecting the bridge.

I too have this issue. Anytime I restart HA mqtt bridge breaks. I have to restart mosquito docker almost every time.
Other times it will stop seemingly randomly. I setup a notification to alert me after 2 minutes of not receiving notifications and it triggers the keep alive Automation to run again. That seems to fix it about 50% of the time.

I think the next step is to set it to automatically restart the mosquito add on if there is still not mqtt messages from victron after 7 minutes or so.

I have noticed 1 reproducible behavior. If I disconnect or connect shore power to my inverter, the AC Loads sensor stops reporting mqtt updates every time. After a few minutes it resumes on its own. Not sure why it does that. I’m thinking it’s a bug in the inverter/cerbo firmware because VRM portal also freezes for ac loads at the same time. This isn’t too big of a deal for me since it seems to always recover by itself.

Do you still have the log message? I’ve never seen any log about the bridge or its status but mine has been working solid now since I upgraded the OS to Large on Venus.

I have an automation setup to reload Mosquitto broker. Mine also seems to not work after HA reboot, and mosquitto broker restart fixes the issue.