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
- Enable MQTT on your Venus OS
- Check the MQTT with MQTT Explorer
- Install MQTT Server on your HA
- Install Samba NAS on your HA
- Configure the bridge Venus - HA
- Check the Bridge with MQTT Explorer
- Create the keep-alive automation
- Check data coming in with MQTT Explorer (Topic will be venus-home/N/your-venus-id/#
- Create all needed sensors in your mqtt.yaml
- Smile
- 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"}