From 8ad563ed064c242908ef37e4ddbde233ab974c50 Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:20:43 +0100 Subject: [PATCH] Solis-Hybrid: add external battery power sign (#11842) --- templates/definition/meter/solis-hybrid.yaml | 25 +++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/templates/definition/meter/solis-hybrid.yaml b/templates/definition/meter/solis-hybrid.yaml index 946a1f680..78cc83d9f 100644 --- a/templates/definition/meter/solis-hybrid.yaml +++ b/templates/definition/meter/solis-hybrid.yaml @@ -95,12 +95,25 @@ render: | {{- end }} {{- if eq .usage "battery" }} power: - source: modbus - {{- include "modbus" . | indent 2 }} - register: - type: input - address: 33149 # Battery power - decode: int32 + source: calc + mul: + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + type: input + address: 33149 # Battery power + decode: uint32 + - source: calc + add: + - source: modbus + {{- include "modbus" . | indent 6 }} + register: + type: input + address: 33135 # Battery current direction + decode: uint16 # 0:charge, 1:discharge + scale: 2 + - source: const + value: -1 energy: source: modbus {{- include "modbus" . | indent 2 }}