Repository navigation
Examples
-
Dynamic electricity prices: charge the battery from the grid in the
cheap hours (
Charge from GridwithGrid charge power) and keep it from discharging while the price is low (Block Discharging). -
Negative prices or an export cap: limit the inverter's output with
AC limit enableandAC limit rate, or, with the technician role, only the feed-in with the export soft limit. Setting the export soft limit also switches it on; switch it off in the inverter's web interface. -
Keeping energy for later: hold the battery for the evening or for backup
power with
Block Discharging, theModbus storage reserve(it applies in a Modbus storage mode, not inAuto), or theBackup reserveof the inverter's own battery management. - Monitoring: household load, grid power per phase, battery state of charge and state of health, module temperatures and fans, and why the inverter throttles, all without a cloud connection.
- Modbus only: read the inverter and steer the battery over Modbus without handing Home Assistant a web password (see Web API).
The automations below go into automations.yaml, as items of its list. The
entity IDs are examples; take yours from Settings → Devices & services →
Entities. The storage mode is set first, then the value it uses: a mode
change resets its rate (see Battery Control).
Charge the battery from the grid at night, and hand it back to the inverter in the morning:
- id: fronius_battery_grid_charge_night
alias: "Battery: charge from the grid at night"
triggers:
- trigger: time
at: "02:00:00"
actions:
- action: select.select_option
target:
entity_id: select.fronius_storage_control_mode
data:
option: charge_from_grid
- action: number.set_value
target:
entity_id: number.fronius_grid_charge_power
data:
value: 3000
- id: fronius_battery_back_to_auto
alias: "Battery: back to automatic"
triggers:
- trigger: time
at: "05:00:00"
actions:
- action: select.select_option
target:
entity_id: select.fronius_storage_control_mode
data:
option: autoSet the grid charge power to a multiple of 10 W (see Battery Control).
Keep the battery from discharging into the car while it charges:
- id: fronius_battery_hold_for_car
alias: "Battery: hold while the car charges"
triggers:
- trigger: state
entity_id: binary_sensor.car_charging
to: ["on", "off"]
actions:
- action: select.select_option
target:
entity_id: select.fronius_storage_control_mode
data:
option: "{{ 'block_discharging' if trigger.to_state.state == 'on' else 'auto' }}"Switch the inverter's output off while the price is negative. AC limit rate
limits everything the inverter puts out, not only the feed-in, so the house
then draws from the grid, which a negative price pays for. The automation
compares the price whenever it changes and again after a restart, a reload of
the automations or of the integration, so it never waits for the next
crossing of zero; an unavailable price restores the output. It owns the AC
limit: whenever the price is not negative it switches off an AC limit set by
other means.
- id: fronius_inverter_negative_price
alias: "Inverter: off at negative prices"
mode: restart
triggers:
# "to: null" leaves out changes of the price's attributes only.
- trigger: state
entity_id: sensor.electricity_price
to: null
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
- trigger: state
entity_id: select.fronius_ac_limit_enable
from: unavailable
actions:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.electricity_price
below: 0
sequence:
# The rate first: enabling first would apply the old limit for a moment.
- action: number.set_value
target:
entity_id: number.fronius_ac_limit_rate
data:
value: 0
- action: select.select_option
target:
entity_id: select.fronius_ac_limit_enable
data:
option: enabled
- conditions:
- condition: state
entity_id: select.fronius_ac_limit_enable
state: enabled
sequence:
- action: select.select_option
target:
entity_id: select.fronius_ac_limit_enable
data:
option: disabledSend a notification for every error or warning the inverter logs at the
customer level. For the technician and service levels, enable Service event
and add it to the target (see Events and Throttling).
- id: fronius_inverter_event_notify
alias: "Inverter: notify on errors and warnings"
triggers:
- trigger: event.received
target:
entity_id: event.fronius_inverter_event
options:
event_type:
- error
- warning
actions:
- action: notify.notify
data:
title: "Inverter {{ trigger.to_state.attributes.event_type }}"
message: >-
{{ trigger.to_state.attributes.code }}:
{{ trigger.to_state.attributes.text }}