From 62b63812a6c7d4120a596bfae9bdfab1d0cdd66a Mon Sep 17 00:00:00 2001 From: David Date: Sat, 14 Dec 2024 12:18:13 +0100 Subject: [PATCH] Senec-Home: add battery control (#17729) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David Müller --- templates/definition/meter/senec-home.yaml | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/templates/definition/meter/senec-home.yaml b/templates/definition/meter/senec-home.yaml index a4976b4b9..e4629483e 100644 --- a/templates/definition/meter/senec-home.yaml +++ b/templates/definition/meter/senec-home.yaml @@ -52,5 +52,30 @@ render: | jq: .ENERGY.GUI_BAT_DATA_FUEL_CHARGE | sub("fl_"; "") unpack: hex decode: float32 + batterymode: + source: switch + switch: + - case: 1 # normal + set: + source: http + uri: {{ .schema }}://{{ .host }}/lala.cgi + insecure: true + method: POST + headers: + - content-type: application/json + body: '{"ENERGY":{"SAFE_CHARGE_PROHIBIT":"u8_01"}}' # self consumption + - case: 2 # hold (not implemented) + set: + source: error + error: ErrNotAvailable + - case: 3 # charge + set: + source: http + uri: {{ .schema }}://{{ .host }}/lala.cgi + insecure: true + method: POST + headers: + - content-type: application/json + body: '{"ENERGY":{"SAFE_CHARGE_FORCE":"u8_01"}}' # force to charge capacity: {{ .capacity }} # kWh {{- end }}