Skip to content

Commit

Permalink
Kostal Plenticore: add battery charge control (#15709)
Browse files Browse the repository at this point in the history
  • Loading branch information
iseeberg79 authored Sep 7, 2024
1 parent dab8dfa commit 92abe21
Showing 1 changed file with 37 additions and 15 deletions.
52 changes: 37 additions & 15 deletions templates/definition/meter/kostal-plenticore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

0 comments on commit 92abe21

Please sign in to comment.