Sungrow: fix lan template battery sign

This commit is contained in:
andig 2022-02-21 21:58:13 +01:00
parent 7008a4b1f6
commit af03bbb6e0

View file

@ -33,13 +33,31 @@ render: |
{{- end }}
{{- if eq .usage "battery" }}
power:
source: modbus
{{include "modbus" . | indent 2}}
register:
address: 13021 # Battery power
type: input
decode: int16
#scale: -1 # charging sign form 13000 & 0x2
source: calc
mul:
- source: modbus
{{include "modbus" . | indent 2}}
register:
address: 13021 # Battery power
type: input
decode: int16
- source: calc
add:
- source: modbus
{{include "modbus" . | indent 6}}
register:
type: input
address: 13000 # Battery running state
decode: bool16
bitmask: 2 # Charging
scale: -1
- source: modbus
{{include "modbus" . | indent 6}}
register:
type: input
address: 13000 # Battery running state
decode: bool16
bitmask: 4 # Discharging
soc:
source: modbus
{{include "modbus" . | indent 2}}