evcc-io/templates/definition/meter/sma-si-modbus.yaml

114 lines
3.2 KiB
YAML

template: sma-si-modbus
products:
- brand: SMA
description:
generic: Sunny Island (Modbus)
capabilities: ["battery-control"]
params:
- name: usage
choice: ["battery"]
- name: modbus
choice: ["tcpip"]
port: 502
id: 3
help:
en: ModbusTCP server needs to be enabled.
de: Der ModbusTCP Server muss aktiviert sein.
- preset: battery-params
- name: maxchargepower
default: 4200
required: true
- name: watchdog
default: 60s
- name: chargepower
deprecated: true
render: |
type: custom
power:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 30775 # SMA Modbus Profile: GridMs.TotW
type: input
decode: int32nan
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 30513 # SMA Modbus Profile: Metering.TotWhOut
type: holding
decode: uint64nan
scale: 0.001
soc:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 30845 # SMA Modbus Profile: Bat.ChaStt
type: holding
decode: uint32nan
batterymode:
source: watchdog
timeout: {{ .watchdog }}
reset: 1 # reset watchdog on normal
set:
source: switch
switch:
- case: 1 # normal
set:
source: const
value: 803 # inaktiv (Ina)
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 40151 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WCtlComAct
type: writemultiple
decode: uint32
- case: 2 # hold
set:
source: sequence
set:
- source: const
value: 0 # Wirkleistungsvorgabe
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 40149 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSpt
type: writemultiple
decode: int32
- source: const
value: 802 # aktiv (Act)
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 40151 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WCtlComAct
type: writemultiple
decode: uint32
- case: 3 # charge
set:
source: sequence
set:
- source: const
value: -{{ .maxchargepower }} # Wirkleistungsvorgabe
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 40149 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSpt
type: writemultiple
decode: int32
- source: const
value: 802 # aktiv (Act)
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 40151 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WCtlComAct
type: writemultiple
decode: uint32
default:
source: error
error: ErrNotAvailable
{{- include "battery-params" . }}