Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonnenBatterie: implement grid charging #15956

Merged
merged 2 commits into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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