Skip to content

Commit

Permalink
SonnenBatterie: implement grid charging (#15956)
Browse files Browse the repository at this point in the history
  • Loading branch information
rivengh authored Sep 8, 2024
1 parent efc7412 commit ede3cec
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions templates/definition/meter/sonnenbatterie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ requirements:
description:
de: |
Für die aktive Batteriesteuerung muss über das Webinterface der sonnenBatterie (unter Software-Integration) das "JSON Write API" aktiviert und das dort generierte API-Token in der Batteriekonfiguration unter `token` eingetragen werden.
Netzladen ist nicht implementiert.
Die Leistung für das Netzladen kann an die Wechselrichterleistung der sonnenBatterie über den Parameter `chargepower` angepasst werden.
en: |
For active battery control, the "JSON Write API" must be activated via the sonnenBatterie web interface (under Software-Integration) and the API token generated there must be entered in the battery configuration under `token`.
Grid charging is not implemented.
The power for grid charging can be adapted to the inverter power of the sonnenBatterie via the `chargepower` parameter.
params:
- name: usage
choice: ["grid", "pv", "battery"]
Expand All @@ -28,6 +28,13 @@ params:
de: API Token (benötigt für aktive Batteriesteuerung)
en: API Token (required for active battery control)
usages: ["battery"]
- name: chargepower
default: 3300
advanced: true
help:
de: Ladeleistung für Netzladen in W
en: Charging power for grid charging in W
usages: ["battery"]
render: |
type: custom
power:
Expand Down Expand Up @@ -88,14 +95,30 @@ render: |
- Auth-Token: {{ .token }}
- case: 3 # charge
set:
source: http
uri: http://{{ .host }}/api/v2/configurations
insecure: true
method: PUT
headers:
- content-type: application/json
- Auth-Token: {{ .token }}
body: '{"EM_OperatingMode":"2"}' # self consumption
source: sequence
set:
- source: http
uri: http://{{ .host }}/api/v2/configurations
insecure: true
method: PUT
headers:
- content-type: application/json
- Auth-Token: {{ .token }}
body: '{"EM_OperatingMode":"1"}' # manual
- source: http
uri: http://{{ .host }}/api/v2/setpoint/discharge/0
insecure: true
method: POST
headers:
- content-type: application/json
- Auth-Token: {{ .token }}
- source: http
uri: http://{{ .host }}/api/v2/setpoint/charge/{{ .chargepower }}
insecure: true
method: POST
headers:
- content-type: application/json
- Auth-Token: {{ .token }}
{{- end }}
{{- if .capacity }}
capacity: {{ .capacity }} # kWh
Expand Down

0 comments on commit ede3cec

Please sign in to comment.