From 5ceecd172c807df79c8718b527130096afead2ee Mon Sep 17 00:00:00 2001 From: Ingo <71161062+iseeberg79@users.noreply.github.com> Date: Wed, 30 Apr 2025 16:21:47 +0200 Subject: [PATCH] OpenEMS: add battery control (#20948) --- templates/definition/meter/openems.yaml | 59 +++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/templates/definition/meter/openems.yaml b/templates/definition/meter/openems.yaml index cd8c56e8c..e2c7a7105 100644 --- a/templates/definition/meter/openems.yaml +++ b/templates/definition/meter/openems.yaml @@ -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 }}