How to automate Solarbatteriecharging with these data? #71
Replies: 1 comment 2 replies
-
|
HI @volkergrabbe , I'm a little confused ... That what you are asking for is the main purpose of EOS_connect together with EOS.
and then -> https://github.com/ohAnd/EOS_connect?tab=readme-ov-file#how-it-works
means you can directly connect your inverter:
All the mentioned features
So, finally, what you're missing? ;-) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
EOS-connect is using the data from EOS to prdigt Solar Forecast, batterie SOC, Tibber rpices etc.
How this could be used to automate charging the batterie when solar forecasts are bad und the tibber price is cheap?
EOS connect has al the data from tibber etc. Bt the MQTT didn't show this parameters.
So where can i get these Datapoints to automate (with a little help of claude, i am not a programmer) all this?
This is an example from claude:
Optimale Batteriesteuerung basierend auf EOS-Connect Daten
In configuration.yaml oder automations.yaml
Template Sensoren für Entscheidungslogik
template:
name: "Battery Optimization Decision"
state: >
{% set current_price = states('sensor.eos_tibber_current_price') | float(0) %}
{% set avg_price_today = states('sensor.eos_tibber_average_price') | float(0) %}
{% set solar_forecast_next_4h = states('sensor.eos_solar_forecast_next_4h') | float(0) %}
{% set solar_forecast_today = states('sensor.eos_solar_forecast_today') | float(0) %}
{% set battery_soc = states('sensor.growatt_battery_soc') | float(0) %}
{% set current_hour = now().hour %}
{# Definiere Schwellenwerte #}
{% set low_price_threshold = avg_price_today * 0.75 %}
{% set very_low_price_threshold = avg_price_today * 0.6 %}
{% set high_soc_threshold = 85 %}
{% set low_soc_threshold = 30 %}
{# Entscheidungslogik #}
{% if battery_soc >= high_soc_threshold %}
idle
{% elif current_price <= very_low_price_threshold and battery_soc < 90 %}
force_charge_high
{% elif current_price <= low_price_threshold and solar_forecast_next_4h < 2 and battery_soc < 80 %}
force_charge_low
{% elif solar_forecast_today < 10 and current_price < avg_price_today and battery_soc < 60 and current_hour >= 22 %}
night_charge
{% elif battery_soc <= low_soc_threshold and current_price < avg_price_today * 1.2 %}
emergency_charge
{% else %}
auto
{% endif %}
attributes:
current_price: "{{ states('sensor.eos_tibber_current_price') }}"
avg_price: "{{ states('sensor.eos_tibber_average_price') }}"
solar_forecast: "{{ states('sensor.eos_solar_forecast_today') }}"
battery_soc: "{{ states('sensor.growatt_battery_soc') }}"
reason: >
{% set current_price = states('sensor.eos_tibber_current_price') | float(0) %}
{% set avg_price_today = states('sensor.eos_tibber_average_price') | float(0) %}
{% set solar_forecast_today = states('sensor.eos_solar_forecast_today') | float(0) %}
{% set battery_soc = states('sensor.growatt_battery_soc') | float(0) %}
name: "Next Cheap Hours"
state: >
{% set prices = states('sensor.eos_tibber_prices_today') %}
{% if prices != 'unknown' and prices != 'unavailable' %}
{% set price_list = prices.split(',') | map('float') | list %}
{% set current_hour = now().hour %}
{% set avg_price = price_list | average %}
{% set cheap_threshold = avg_price * 0.8 %}
{% else %}
unknown
{% endif %}
Automationen
automation:
alias: "Battery Control - Execute Decision"
description: "Führt die optimale Batteriesteuerung durch"
trigger:
platform: state
entity_id: sensor.battery_optimization_decision
platform: time_pattern
minutes: "/15" # Alle 15 Minuten prüfen
condition:
condition: template
value_template: "{{ states('sensor.battery_optimization_decision') != 'unknown' }}"
action:
choose:
Force Charge High Power (sehr günstige Preise)
entity_id: sensor.battery_optimization_decision
state: "force_charge_high"
sequence:
data:
topic: "solar_assistant/growatt_inverter1/charge_mode/set"
payload: "force_charge"
data:
topic: "solar_assistant/growatt_inverter1/charge_power/set"
payload: "3000" # Maximale Ladeleistung
data:
topic: "solar_assistant/growatt_inverter2/charge_mode/set"
payload: "force_charge"
data:
topic: "solar_assistant/growatt_inverter2/charge_power/set"
payload: "3000"
Force Charge Low Power (günstige Preise)
entity_id: sensor.battery_optimization_decision
state: "force_charge_low"
sequence:
data:
topic: "solar_assistant/growatt_inverter1/charge_mode/set"
payload: "force_charge"
data:
topic: "solar_assistant/growatt_inverter1/charge_power/set"
payload: "2000" # Reduzierte Ladeleistung
data:
topic: "solar_assistant/growatt_inverter2/charge_mode/set"
payload: "force_charge"
data:
topic: "solar_assistant/growatt_inverter2/charge_power/set"
payload: "2000"
Night Charge (Nachtladung bei schlechter Prognose)
entity_id: sensor.battery_optimization_decision
state: "night_charge"
sequence:
data:
topic: "solar_assistant/growatt_inverter1/charge_mode/set"
payload: "force_charge"
data:
topic: "solar_assistant/growatt_inverter1/charge_power/set"
payload: "1500" # Sanfte Nachtladung
data:
topic: "solar_assistant/growatt_inverter2/charge_mode/set"
payload: "force_charge"
data:
topic: "solar_assistant/growatt_inverter2/charge_power/set"
payload: "1500"
Emergency Charge (Akku sehr leer)
entity_id: sensor.battery_optimization_decision
state: "emergency_charge"
sequence:
data:
topic: "solar_assistant/growatt_inverter1/charge_mode/set"
payload: "force_charge"
data:
topic: "solar_assistant/growatt_inverter1/charge_power/set"
payload: "2500"
data:
topic: "solar_assistant/growatt_inverter2/charge_mode/set"
payload: "force_charge"
data:
topic: "solar_assistant/growatt_inverter2/charge_power/set"
payload: "2500"
Standard Auto Mode (PV-Überschuss)
default:
data:
topic: "solar_assistant/growatt_inverter1/charge_mode/set"
payload: "auto"
data:
topic: "solar_assistant/growatt_inverter2/charge_mode/set"
payload: "auto"
Logging der Entscheidung
data:
name: "Battery Optimization"
message: >
Decision: {{ states('sensor.battery_optimization_decision') }}
| Price: {{ states('sensor.eos_tibber_current_price') }}ct
| SOC: {{ states('sensor.growatt_battery_soc') }}%
| Reason: {{ state_attr('sensor.battery_optimization_decision', 'reason') }}
alias: "Battery Control - Morning Reset"
description: "Setzt am Morgen auf Auto-Modus zurück"
trigger:
at: "06:00:00"
action:
data:
topic: "solar_assistant/growatt_inverter1/charge_mode/set"
payload: "auto"
data:
topic: "solar_assistant/growatt_inverter2/charge_mode/set"
payload: "auto"
alias: "Battery Control - Price Alert"
description: "Benachrichtigung bei extremen Preisschwankungen"
trigger:
entity_id: sensor.eos_tibber_current_price
below: 5 # Unter 5ct/kWh
condition:
entity_id: sensor.growatt_battery_soc
below: 95
action:
data:
title: "Sehr günstiger Strom!"
message: >
Strompreis: {{ states('sensor.eos_tibber_current_price') }}ct/kWh
Akku: {{ states('sensor.growatt_battery_soc') }}%
Automatische Ladung aktiviert.
Utility Meter für Kostentracking
utility_meter:
monthly_grid_cost:
source: sensor.total_grid_cost
cycle: monthly
monthly_savings:
source: sensor.optimization_savings
cycle: monthly
Beta Was this translation helpful? Give feedback.
All reactions