From b6c747e726102ac1bc744437f77d5bb5c6dc466c Mon Sep 17 00:00:00 2001 From: Andre Frintrop Date: Wed, 30 Oct 2024 14:14:51 +0100 Subject: [PATCH] Update sofarsolar-g3.yaml for charging battery Update sofarsolar-g3.yaml for charging battery regarding Sofar HYD: Battery Control #12220 --- templates/definition/meter/sofarsolar-g3.yaml | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/templates/definition/meter/sofarsolar-g3.yaml b/templates/definition/meter/sofarsolar-g3.yaml index 570f31d661..8084b2dd7d 100644 --- a/templates/definition/meter/sofarsolar-g3.yaml +++ b/templates/definition/meter/sofarsolar-g3.yaml @@ -192,14 +192,14 @@ render: | address: 0x1187 type: writemultiple decode: bytes - - case: 3 # charge (not implemented -> normal) + - case: 3 # charge set: - source: const - value: 0 # self-use + source: sequence set: - source: sequence + - source: const + value: 3 # passive set: - - source: ignore + source: ignore error: "modbus: response data size '18' does not match count '4'" set: source: modbus @@ -208,7 +208,20 @@ render: | address: 0x1110 type: writemultiple decode: int16 - - source: error - error: ErrNotAvailable + - source: convert + convert: int2bytes + set: + source: const + value: '0x00000000_7FFFFFFF_7FFFFFFF' + set: + source: ignore + error: "modbus: response data size '18' does not match count '4'" + set: + source: modbus + {{- include "modbus" . | indent 14 }} + register: + address: 0x1187 + type: writemultiple + decode: bytes capacity: {{ .capacity }} # kWh {{- end }}