EOS <-> Home Assistant -> Ladung des Akku steuern

Hallo zusammen,

ich brauche noch ein bisschen Unterstützung bei dem Thema.

Meine Infrastruktur:

  • PV-Anlage mit SMA Wechselrichter (Sunny Tripower) 10 kWp (Ost/West - Ausrichtung)
  • Wallbox SMA EV Charger
  • sonnenBatterie 10 (5,5 kWh)
  • Home Assistant auf Raspberry Pi 4
  • EOS auf proxmox VM mit Docker

Das Ziel:

  • die sonnenBatterie "netzdienlich" steuern

EOS habe ich, soweit wie ich das verstanden habe, konfiguriert. Dafür hat sich die API schon mal als sehr nützlich erwiesen. Meine Infrastruktur ist also soweit dort hinterlegt. Ich habe das Interval auf 600 gestellt, weil ein Optimierungsdurchlauf ca. 120 Sek. dauert und der Server sonst kaum noch Ruhe findet. :grinning_face:

Für die Integration in Home Assistant habe ich mich an dem Home Assistant EOS addons repository orientiert. Ich nutze das Addon nicht, weil sonst mein Raspi glühend von der Wand fällt. Die Daten werden in eine MariaDB-Datenbank auf einer anderen proxmox VM geschrieben.

Ich würde ja gerne meine Konfig für EOS, Payload für die Optimierung, oder Response von der Optimierung hier teilen, aber ich kann als Neuling noch keinen Dateien hochladen.

Für den Payload nutze ich, neben statischen Werten für preis_euro_pro_wh_akku und einspeiseverguetung_euro_pro_wh, die API vom EOS Server. Um die Werte abrufen zu können, habe ich command_line-sensoren definiert.

Bspw.:

command_line:
  - sensor:
      name: EOS Total Load Forecast
      unique_id: eos_total_load_forecast
      command: >
        today=$(date +%Y-%m-%d);
        after_tomorrow=$(date -d @$(($(date +%s) + 86400 + 86400)) +%Y-%m-%d)
        url="http://192.168.178.10:8503/v1/prediction/list?key=load_mean_adjusted&start_datetime=${today}T00:00&end_datetime=${after_tomorrow}T00:00";
        curl -s "$url" |
        jq -c '[.[] | if type == "number" then (. * 100 | round) / 100 else empty end | select(.)] | .[:48] | {gesamtlast: .}'
      scan_interval: 3600
      value_template: >
        {% set data = value | from_json %}
        {% if data.gesamtlast is iterable and data.gesamtlast | length > 0 %}
          {{ "%.2f"|format(data.gesamtlast[0]) }}
        {% else %}
          unavailable
        {% endif %}
      json_attributes:
        - gesamtlast

Für diesen Forecast wäre es gut, wenn man die Measurement-Daten einpflegen könnte. Und hier kommt ihr ins Spiel.

Das habe ich noch nicht hinbekommen.

Gibt es hier jemanden, der mir da auf die Sprünge helfen kann?

Des Weiteren habe ich in meinen Optimierungsdaten noch keinen Anhaltspunkt gefunden, wann ich den Akku denn nun "netzdienlich" laden soll.

Das hier sind die wesentlichen Werte:

ac_charge: 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0.625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
dc_charge: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
discharge_allowed: 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
eautocharge_hours_float: null
start_solution: 6, 20, 4, 14, 0, 14, 5, 5, 20, 13, 17, 12, 8, 13, 12, 7, 12, 9, 13, 13, 13, 10, 7, 11, 12, 7, 11, 11, 13, 9, 11, 9, 11, 10, 7, 13, 13, 7, 11, 7, 8, 9, 11, 13, 7, 12, 11, 13, 16
washingstart: 16

Also, ich stehe da etwas auf dem Schlauch...

Hallo, ich möchte ebenfalls die Sonnenbatterie von SONNEN “ lösen” über HA extern steuern können…( zuerst Tibber &co)

Bin aber bei weitem kein HA Spezialist.

Dein Beitrag ist für mich schon sehr speziell. Hast du eine Lösung gefunden? Oder hast du eine Art Anleitung für einen HA Neuling?

Das haben diversen Foren bisher kaum welche mal eben geschafft…

Gerne auch per pn.

Ansonsten wird die Spnnenbatterie 10 verkauft…oder der dynamische Zarif von Sonnen genutzt…

Danke Grüße Daniel

Moin,

in der Zwischenzeit hat sich ziemlich viel beim EOS geändert. EOS hat jetzt eine eigene HA - Integration, die ich aber nicht verwende. Ich traue meine Raspi einfach nicht zu auch noch Docker laufen zu lassen. Über die EOS - Api habe ich auch das Measurement inzwischen einpflegen können.

Die Optimierung läuft auch einigermaßen. Das Problem ist allerdings, die verwendeten Instructions vom EOS auf die Sonnen-Batterie anzuwenden. Es gibt eine Custom Integration für die Sonnen-Batterie. Dort sind auch einige Beispiele angegeben. Letztlich wird man die Instruction über Automatisierung umsetzen müssen.

Das habe ich mit copilot (github) gemacht. Dabei kommt dann so ein Optimierungsplan heraus:

{
  "id": "plan-genetic@2026-04-29T12:27:06.442871Z",
  "generated_at": "2026-04-29T12:27:06.442894Z",
  "valid_from": "2026-04-29T12:00:00Z",
  "valid_until": null,
  "instructions": [
    {
      "id": "sonnen@5125b652-bed7-46c0-b710-c2001b0d9d68",
      "execution_time": "2026-04-29T12:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "PEAK_SHAVING",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    },
    {
      "id": "Corsa-e@d0f92788-8473-47db-b25e-e1b026cffa31",
      "execution_time": "2026-04-29T12:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "Corsa-e",
      "operation_mode_id": "IDLE",
      "operation_mode_factor": 1,
      "resource_id": "Corsa-e"
    },
    {
      "id": "dishwasher@aff8b688-a038-4cdb-9cf1-ba8cd35f145e",
      "execution_time": "2026-04-29T12:00:00Z",
      "abnormal_condition": false,
      "type": "DDBCInstruction",
      "actuator_id": "dishwasher",
      "operation_mode_id": "OFF",
      "operation_mode_factor": 1,
      "resource_id": "dishwasher"
    },
    {
      "id": "sonnen@a3f4d45d-38f3-445e-a266-adf9e93b47e6",
      "execution_time": "2026-04-29T19:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "IDLE",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@a5c257fc-b8ba-4d71-9947-3378796e42d7",
      "execution_time": "2026-04-29T21:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "NON_EXPORT",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@a0146680-8882-4169-a3bc-884157348bbf",
      "execution_time": "2026-04-30T00:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "SELF_CONSUMPTION",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@a34b9797-e555-4088-b04a-3664b741f561",
      "execution_time": "2026-04-30T07:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "NON_EXPORT",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@fcb340d9-ffb7-42f4-9dab-548c5b9be02a",
      "execution_time": "2026-04-30T08:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "SELF_CONSUMPTION",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@7dc9779e-2d24-42e5-beaf-3b33016ad5d7",
      "execution_time": "2026-04-30T09:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "FORCED_CHARGE",
      "operation_mode_factor": 0.3,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@5a54e80d-0c09-44d3-bdbe-10d6ee4bc5b5",
      "execution_time": "2026-04-30T10:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "FORCED_CHARGE",
      "operation_mode_factor": 0.2,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@87fad9b1-d3c4-4018-a797-8747ab6e4945",
      "execution_time": "2026-04-30T11:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "SELF_CONSUMPTION",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@8de714f0-a469-4bcc-8e90-e28199a75adf",
      "execution_time": "2026-04-30T12:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "PEAK_SHAVING",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    },
    {
      "id": "sonnen@8363729c-4000-44a9-aa05-1770108f6de1",
      "execution_time": "2026-04-30T21:00:00Z",
      "abnormal_condition": false,
      "type": "FRBCInstruction",
      "actuator_id": "sonnen",
      "operation_mode_id": "SELF_CONSUMPTION",
      "operation_mode_factor": 1,
      "resource_id": "sonnen"
    }
  ],
  "comment": "Energy management plan derived from GeneticSolution."
}

Zunächst musst du diverse Messwerte erfassen und über eine Automatisierung in die Api einspeisen.

Aber eine netzdienliche Ladung der Sonnen-Batterie habe ich noch nicht hinbekommen. Die Frage ist also, ob sich der Aufwand lohnt.

Die Sonnen-Batterie hat auch einen Modus “Optimierung”, der aber bei mir über die Integration nicht verfügbar ist. Eigentlich kann die Sonnen-Batterie das von sich aus (siehe Blog-Beitrag). Zumindest früher war dafür ein Einspeiselimit notwendig. Dann sollte das auch funktionieren. Die Konfig der Sonnenbatterie hat einen Parameter, von dem ich denke, dass er für Optimierung zuständig ist:

{"EM_Prognosis_Charging":"1"}

Trotzdem macht die Sonnen-Batterie bei mir nichts in dieser Richtung.

Wenn du nur die Sonnen-Batterie im HA integrieren willst, reicht wahrscheinlich die custom integration.

Grüße Edgar