evcc-io/templates/definition/meter/sunspec-inverter.yaml

104 lines
2.2 KiB
YAML

template: sunspec-inverter
products:
- description:
de: Wechselrichter
en: Inverter
group: generic
params:
- name: usage
choice: ["grid", "pv", "battery"]
- name: modbus
choice: ["tcpip", "rs485"]
- name: capacity
advanced: true
render: |
{{- if eq .usage "grid" }}
type: custom
# sunspec model 203 (int+sf)/ 213 (float) meter
power:
source: sunspec
{{- include "modbus" . | indent 2 }}
value:
- 203:W
- 213:W
energy:
source: sunspec
{{- include "modbus" . | indent 2 }}
value:
- 203:TotWhImp
- 213:TotWhImp
currents:
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:AphA
- 213:AphA
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:AphB
- 213:AphB
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:AphC
- 213:AphC
voltages:
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:PhVphA
- 213:PhVphA
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:PhVphB
- 213:PhVphB
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:PhVphC
- 213:PhVphC
powers:
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:WphA
- 213:WphA
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:WphB
- 213:WphB
- source: sunspec
{{- include "modbus" . | indent 4 }}
value:
- 203:WphC
- 213:WphC
{{- end }}
{{- if eq .usage "pv" }}
type: custom
power:
source: sunspec
{{- include "modbus" . | indent 2 }}
value:
- 101:W
- 103:W
energy:
source: sunspec
{{- include "modbus" . | indent 2 }}
value:
- 101:WH
- 103:WH
scale: 0.001
{{- end }}
{{- if eq .usage "battery" }}
type: custom
soc:
source: sunspec
{{- include "modbus" . | indent 2 }}
value:
- 124:ChaState
- 802:SoC
capacity: {{ .capacity }} # kWh
{{- end }}