In our previous posts, we’ve discussed various aspects of power management on a sailboat. Today, we’re diving deep into how we control our Victron Quattro inverter/charger using Home Assistant. This setup allows for easy Inverter and Charger control and seamless integration with our other boat systems.
The Challenge: Simplifying Complex Power Management
The Victron Quattro is a powerful and versatile device, capable of operating in multiple modes. However, directly interfacing with these modes isn’t super easy, especially when you want to integrate it with other home automation tasks. Our solution? Use simple on/off toggles in Home Assistant to control the Quattro’s mode.
So first thing first, install the Victron Integration from HACS and connect it to your CCGX/Cerbo/Ekrano
The Solution: Smart Synchronization
We’ve created an automation in Home Assistant that synchronizes two input booleans with the Victron VE.Bus mode. Here’s how it works:
- input_boolean.onduleur: Controls the inverter functionality
- input_boolean.chargeur: Controls the charger functionality
These booleans correspond to the following Victron modes:
onduleur | chargeur | Victron Mode |
ON | ON | ON (Both inverter and charger active) |
ON | OFF | INVERTER |
OFF | ON | CHARGER |
OFF | OFF | OFF |
The Automation Explained
Our automation, named “[Victron] Sync Ondul-Chargeur”, does two main things:
- Updates the input booleans when the Victron VE.Bus mode changes
- Changes the Victron VE.Bus mode when we toggle the input booleans
This two-way synchronization ensures that our Home Assistant interface always reflects the actual state of the Quattro, and allows us to control the Quattro using simple on/off switches.
Practical Applications
This setup offers several advantages:
- Simplified Control: Instead of using the preset modes, or the Ekrano, we can control our power system with simple on/off toggles.
- Integration with Other Systems: We can easily incorporate power management into other automations. For example, we could automatically switch to inverter mode when solar production is high.
- Remote Management: Through Home Assistant’s remote access features, we can monitor and control our power system from anywhere.
- Intuitive Interface: The boolean toggles provide an intuitive interface that anyone on board can understand and use.
The Code Behind the Magic
For those interested in the technical details, here’s a my franken-automation:
alias: "[Victron] Sync Ondul-Chargeur"
description: ""
trigger:
- platform: state
entity_id:
- input_boolean.onduleur
- input_boolean.chargeur
id: to_bus
- platform: state
entity_id:
- select.victron_vebus_mode_229
id: from_bus
condition: []
action:
- if:
- condition: trigger
id:
- from_bus
then:
- choose:
- conditions:
- condition: state
entity_id: select.victron_vebus_mode_229
state: "ON"
sequence:
- data: {}
target:
entity_id: input_boolean.onduleur
action: input_boolean.turn_on
- data: {}
target:
entity_id: input_boolean.chargeur
action: input_boolean.turn_on
- conditions:
- condition: state
entity_id: select.victron_vebus_mode_229
state: INVERTER
sequence:
- data: {}
target:
entity_id: input_boolean.onduleur
action: input_boolean.turn_on
- data: {}
target:
entity_id: input_boolean.chargeur
action: input_boolean.turn_off
- conditions:
- condition: state
entity_id: select.victron_vebus_mode_229
state: CHARGER
sequence:
- data: {}
target:
entity_id: input_boolean.chargeur
action: input_boolean.turn_on
- data: {}
target:
entity_id: input_boolean.onduleur
action: input_boolean.turn_off
- conditions:
- condition: state
entity_id: select.victron_vebus_mode_229
state: "OFF"
sequence:
- data: {}
target:
entity_id: input_boolean.onduleur
action: input_boolean.turn_off
- data: {}
target:
entity_id: input_boolean.chargeur
action: input_boolean.turn_off
- if:
- condition: trigger
id:
- to_bus
then:
- parallel:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.chargeur
state: "on"
- condition: state
entity_id: input_boolean.onduleur
state: "off"
sequence:
- data:
option: CHARGER
target:
entity_id: select.victron_vebus_mode_229
action: select.select_option
- conditions:
- condition: state
entity_id: input_boolean.chargeur
state: "off"
- condition: state
entity_id: input_boolean.onduleur
state: "off"
sequence:
- data:
option: "OFF"
target:
entity_id: select.victron_vebus_mode_229
action: select.select_option
- conditions:
- condition: state
entity_id: input_boolean.chargeur
state: "on"
- condition: state
entity_id: input_boolean.onduleur
state: "on"
sequence:
- data:
option: "ON"
target:
entity_id: select.victron_vebus_mode_229
action: select.select_option
- conditions:
- condition: state
entity_id: input_boolean.chargeur
state: "off"
- condition: state
entity_id: input_boolean.onduleur
state: "on"
sequence:
- data:
option: INVERTER
target:
entity_id: select.victron_vebus_mode_229
action: select.select_option
You can even use it with the Automatic-Water-Heater Automation to turn on inverter before trying to make hot water !
Remember, while this solution works well for our setup, always consult with a marine electrician before making significant changes to your boat’s electrical systems. Every boat is unique, and what works for us may need adjustments to work for you.
Happy sailing, and may your power management be ever smooth and efficient!