Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kostal Plenticore: add battery control #15709

Merged
44 changes: 37 additions & 7 deletions templates/definition/meter/kostal-plenticore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,46 @@ 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 # % to reset grid loading
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 # % lock battery
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 # % charge battery with maximum allowed power
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 }} # %
Expand Down
Loading