diff --git a/templates/definition/meter/kostal-plenticore.yaml b/templates/definition/meter/kostal-plenticore.yaml index 4a6f302cc6..1aaa6fea13 100644 --- a/templates/definition/meter/kostal-plenticore.yaml +++ b/templates/definition/meter/kostal-plenticore.yaml @@ -34,12 +34,6 @@ params: - name: capacity advanced: true # battery control - - name: minsoc - type: number - advanced: true - - name: maxsoc - type: number - advanced: true - name: watchdog type: duration default: 60s @@ -75,17 +69,45 @@ render: | source: sunspec {{- include "modbus" . | indent 2 }} value: 802:SoC # 802 battery control - limitsoc: + batterymode: source: watchdog timeout: {{ .watchdog }} # re-write at timeout/2 + reset: 1 # reset watchdog on normal set: - source: modbus - {{- include "modbus" . | indent 4 }} - register: - address: 1042 # limit soc - type: writemultiple - encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }} + source: switch + switch: + - case: 1 # normal + set: + source: const + value: 0 # % (set once to reset from forced charge) + set: + source: modbus + {{- include "modbus" . | indent 10 }} + register: + address: 1028 # battery charge current (DC) setpoint, relative [%] + type: writemultiple + encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }} + - case: 2 # hold + set: + source: const + value: 0 # % + set: + source: modbus + {{- include "modbus" . | indent 10 }} + register: + address: 1028 # battery charge current (DC) setpoint, relative [%] + type: writemultiple + encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }} + - case: 3 # charge + set: + source: const + value: -100 # % + set: + source: modbus + {{- include "modbus" . | indent 10 }} + register: + address: 1028 # battery charge current (DC) setpoint, relative [%] + type: writemultiple + encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }} capacity: {{ .capacity }} # kWh - minsoc: {{ .minsoc }} # % - maxsoc: {{ .maxsoc }} # % {{- end }}