OpenEMS: add battery control (#20948)

This commit is contained in:
Ingo 2025-04-30 16:21:47 +02:00 • committed by GitHub
parent ed644b98bc
commit 5ceecd172c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,13 @@ template: openems
products:
- brand: OpenEMS
- brand: FENECON
capabilities: ["battery-control"]
requirements:
description:
de: |
Für FEMS FENECON-Systeme ist eine kommerzielle Lizenz für die aktive Batteriesteuerung erforderlich.
en: |
A commercial license is required for FEMS FENECON systems for active battery control.
params:
- name: usage
choice: ["grid", "pv", "battery"]
@ -11,6 +18,21 @@ params:
mask: true
default: user
advanced: true
- name: battery
example: ess0
help:
de: steuerbare Batterie Komponente
en: controllable battery component
usages: ["battery"]
advanced: true
- name: watchdog
type: duration
default: 60s
help:
de: abgestimmt auf das API-Timeout
en: adjusted to the API timout
usages: ["battery"]
advanced: true
- name: maxacpower
- name: capacity
advanced: true
@ -44,5 +66,42 @@ render: |
user: x
password: {{ .password }}
jq: (.value // 0)
{{- if .battery }}
batterymode:
source: watchdog
timeout: {{ .watchdog }} # re-write at timeout/2
reset: 1
set:
source: switch
switch:
- case: 1 # normal
set:
source: http
uri: http://{{ .host }}/rest/channel/{{ .battery }}/SetActivePowerEquals
auth:
type: basic
user: x
password: {{ .password }}
method: POST
headers:
- content-type: application/json
body: '{"value":0}'
- case: 2 # hold
set:
source: http
uri: http://{{ .host }}/rest/channel/{{ .battery }}/SetActivePowerEquals
auth:
type: basic
user: x
password: {{ .password }}
method: POST
headers:
- content-type: application/json
body: '{"value":0}'
- case: 3 # charge (not implemented)
set:
source: error
error: ErrNotAvailable
{{- end }}
capacity: {{ .capacity }} # kWh
{{- end }}