From 3c11886d35da39616bc575cdb6d43b5ebf46b63f Mon Sep 17 00:00:00 2001 From: Ingo <71161062+iseeberg79@users.noreply.github.com> Date: Thu, 14 Aug 2025 22:12:45 +0200 Subject: [PATCH] OpenEMS: enable grid charging (#22951) --- templates/definition/meter/openems.yaml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/templates/definition/meter/openems.yaml b/templates/definition/meter/openems.yaml index 6bb9ab02c..65aa04349 100644 --- a/templates/definition/meter/openems.yaml +++ b/templates/definition/meter/openems.yaml @@ -33,6 +33,8 @@ params: en: adjusted to the API timeout usages: ["battery"] advanced: true + - name: maxchargepower + default: 4200 - name: maxacpower - name: capacity advanced: true @@ -85,7 +87,7 @@ render: | method: POST headers: - content-type: application/json - body: '{"value":0}' + body: '{"value": 0}' - case: 2 # hold set: source: http @@ -97,11 +99,19 @@ render: | method: POST headers: - content-type: application/json - body: '{"value":0}' - - case: 3 # charge (not implemented) + body: '{"value": 0}' + - case: 3 # charge set: - source: error - error: ErrNotAvailable + source: http + uri: http://{{ .host }}/rest/channel/{{ .battery }}/SetActivePowerLessOrEquals + auth: + type: basic + user: x + password: {{ .password }} + method: POST + headers: + - content-type: application/json + body: '{"value": {{ mul .maxchargepower -1 }}}' # charge power is negative {{- end }} capacity: {{ .capacity }} # kWh {{- end }}