evcc-io/templates/definition/meter/kostal-plenticore-gen2.yaml

176 lines
5.9 KiB
YAML

template: kostal-plenticore-gen2
products:
- brand: Kostal
description:
de: Plenticore Hybrid
en: Plenticore Hybrid
capabilities: ["battery-control", "curtail"]
covers: ["kostal-plenticore-hw0200", "kostal-plenticore"]
caveats:
- description:
de: |
Nur ein System kann und darf auf den Wechselrichter zugreifen!
en: |
Only a single system may access the inverter!
link: https://github.com/evcc-io/evcc/wiki/Kostal-Plenticore
requirements:
description:
de: |
Anwendbar für verschiedene Wechselrichter Generationen (G1/G2/G3). Für die aktive Batteriesteuerung muss die Funktion externe Batteriesteuerung über Modbus mit dem Handwerkerzugang aktiviert sein.
en: |
Compatible with various inverter generations (G1/G2/G3). For active battery control, the feature external battery control via Modbus must be activated using installer access.
params:
- name: usage
choice: ["pv", "battery"]
- name: modbus
choice: ["tcpip"]
id: 71
port: 1502
- name: endianness
description:
de: Byte-Reihenfolge (Little/Big)
en: Endianness (Little/Big)
type: choice
choice: ["little", "big"]
default: little
advanced: true
- name: maxacpower
service: modbus/read?address=531&type=holding&encoding=uint16&{modbus}
- preset: battery-params
- name: capacity
service: modbus/read?address=1068&type=holding&encoding=float32s&scale=0.001&{modbus}
- name: minsoc
service: modbus/read?address=1042&type=holding&encoding=float32s&{modbus}
- name: maxsoc
service: modbus/read?address=1044&type=holding&encoding=float32s&{modbus}
- name: maxchargepower
service: modbus/read?address=1038&type=holding&encoding=float32s&resulttype=int&{modbus}
- name: maxdischargepower
service: modbus/read?address=1040&type=holding&encoding=float32s&resulttype=int&{modbus}
- name: maxchargerate
deprecated: true
- name: watchdog
default: 60s
render: |
{{- if eq .usage "pv" }}
type: custom
power:
source: calc
add: # The add plugin sums up all string values
- source: sunspec
{{- include "modbus" . | indent 4 }}
value: 160:1:DCW # string 1
- source: sunspec
{{- include "modbus" . | indent 4 }}
value: 160:2:DCW # string 2
- source: sunspec
{{- include "modbus" . | indent 4 }}
value: 160:3:DCW # string 3
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 1056 # total DC PV energy (sum), Wh
type: holding
encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }}
scale: 0.001 # Wh -> kWh
maxacpower: {{ .maxacpower }} # W
# feed-in curtailment via active power limit (SunSpec model 123, WMaxLimPct @ 40217).
# written as a single register (fn 06); the Plenticore rejects write multiple (fn 16) here.
# WMaxLim_Ena (register 40221) is enabled by default and left to the inverter
# sets the limit percent (100 % = uncurtailed), if set it takes priority over battery control.
curtail: # limit feed-in to the given percent of nominal (WMaxLimPct)
source: sunspec
{{- include "modbus" . | indent 2 }}
value: 123:WMaxLimPct
curtailed: # the limit percentage only applies while the limit is enabled
source: go
in:
- name: ena
type: bool
config:
source: sunspec
{{- include "modbus" . | indent 6 }}
value: 123:WMaxLim_Ena
- name: limit
type: float
config:
source: sunspec
{{- include "modbus" . | indent 6 }}
value: 123:WMaxLimPct
script: |
percent := 100
if ena {
percent = int(limit)
}
percent
{{- end }}
{{- if eq .usage "battery" }}
type: custom
power:
source: sunspec
{{- include "modbus" . | indent 2 }}
value: 802:W # 802 battery control
soc:
source: sunspec
{{- include "modbus" . | indent 2 }}
value: 802:SoC # 802 battery control
batterymode:
source: watchdog
timeout: {{ .watchdog }} # re-write at timeout/2
defer: true # make sure timeouts are followed on update
reset: 1 # reset watchdog on normal
set:
source: switch
switch:
- case: 1 # normal
set:
source: const
value: 0 # W (set once to reset from forced charge)
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 1034 # Battery charge power (DC) setpoint, absolute [W]
type: writemultiple
encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }}
- case: 2 # hold
set:
source: const
value: 0 # W
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 1040 # Battery max. discharge power limit, absolute [W]
type: writemultiple
encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }}
- case: 3 # charge
set:
{{- if .maxchargepower }}
source: const
value: -{{ .maxchargepower }} # W
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 1034 # Battery charge power (DC) setpoint, absolute [W]
type: writemultiple
encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }}
{{- else }}
source: error
error: ErrNotAvailable
{{- end }}
- case: 4 # holdcharge
set:
source: const
value: 0 # W
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 1038 # Battery max. charge power limit, absolute [W]
type: writemultiple
encoding: {{ if (eq .endianness "big") }}float32{{ else }}float32s{{ end }}
{{- include "battery-params" . }}
{{- end }}