Slowly starting to get things working nicely, Today i decluttered my automation for controlling inverter modes.
I have created a template sensor that decides what “Mode” emhass is in, Chargine, Discharging, Exporting Solar or General (Self consumption)
This means now i dont need to touch my complicated automation for inverter control, only the relativly simple template sensor.
- sensor:
- unique_id: emhass_mode
name: "EMHASS Mode"
state: >-
{%set bat_power = states('sensor.p_batt_forecast') | float %}
{%set load = states('sensor.p_load_forecast') | float%}
{%set grid = states('sensor.p_grid_forecast') | float%}
{%set solar = states('sensor.p_pv_forecast') | float %}
{% if bat_power + load < 0 and grid > 0 %}
charge
{% elif bat_power - load > 0 and grid < 0 and solar <= 0%}
discharge
{% elif bat_power == 0 and grid < 0 %}
exporting_solar
{%elif bat_power <= 0 and grid > 0%}
backup
{%else %}
general
{%- endif %}
@davidusb A toggle i would love to see added to EMHASS is no discharging to the grid while the sun is shinning