evcc-io/templates/definition/meter/huawei-sun2000.yaml
2025-10-03 08:56:13 +00:00

289 lines
8.4 KiB
YAML

template: huawei-sun2000
covers: ["huawei-dongle-powersensor", "huawei-sun2000-rs485"]
products:
- brand: Huawei
description:
generic: SUN2000
capabilities: ["battery-control"]
requirements:
description:
de: |
Grid und Batterie erfordern den PowerSensor.
"Modbus/TCP" erfordert Freischaltung via "Errichterzugang" in den Kommunikationseinstellungen des Wechselrichters.
Siehe https://forum.huawei.com/enterprise/en/modbus-tcp-guide/thread/667250677153415168-667213868771979264
en: |
Grid and Battery require the PowerSensor.
Modbus/TCP requires activation using "maintenance access" within the communication settings of the inverter.
See https://forum.huawei.com/enterprise/en/modbus-tcp-guide/thread/667250677153415168-667213868771979264
params:
- name: usage
choice: ["grid", "pv", "battery"]
allinone: true
- name: modbus
choice: ["rs485", "tcpip"]
- name: timeout
default: 15s
- name: storageunit
type: int
default: 1
advanced: true
- name: minsoc
advanced: true
- name: maxsoc
advanced: true
- name: maxchargepower
default: 10000
- name: maxdischargepower
- name: capacity
advanced: true
- name: maxacpower
- name: forceaccharging
default: false
advanced: true
type: bool
usages: ["battery"]
description:
en: Inverter cascade
de: Wechselrichterkaskade
help:
en: Keep AC charging active to charge the storage from other inverters via AC. Prevents stand-by.
de: AC-Laden bleibt aktiv zum Laden des Speichers aus anderen AC Quellen für Wechselrichterkaskaden. Verhindert Stand-by.
render: |
type: custom
{{- if eq .usage "grid" }}
power:
source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
connectdelay: 1s
register:
address: 37113 # Grid import export power
type: holding
decode: int32nan
scale: -1
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
register:
address: 37121 # Active energy import from the grid
type: holding
decode: uint32nan
scale: 0.01
currents:
- source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
register:
address: 37107 # Huawei phase A grid current
type: holding
decode: int32nan
scale: -0.01
- source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
register:
address: 37109 # Huawei phase B grid current
type: holding
decode: int32nan
scale: -0.01
- source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
register:
address: 37111 # Huawei phase C grid current
type: holding
decode: int32nan
scale: -0.01
{{- end }}
{{- if eq .usage "pv" }}
power:
source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
connectdelay: 1s
register:
address: 32064 # Input power DC (if no battery in your system - for more precise readings use 32080 # Active generation power AC)
type: holding
decode: int32nan
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
register:
address: 32106 # Accumulated energy yield
type: holding
decode: uint32nan
scale: 0.01
maxacpower: {{ .maxacpower }}
{{- end }}
{{- if eq .usage "battery" }}
power:
source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
connectdelay: 1s
register:
{{- if eq .storageunit "1" }}
address: 37001
{{- end }}
{{- if eq .storageunit "2" }}
address: 37743
{{- end }}
type: holding
decode: int32nan
scale: -1
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
register:
{{- if eq .storageunit "1" }}
address: 37068 # [Energy storage unit 1] Total discharge
{{- end }}
{{- if eq .storageunit "2" }}
address: 37755 # [Energy storage unit 2] Total discharge
{{- end }}
type: holding
decode: uint32nan
scale: 0.01
soc:
source: modbus
{{- include "modbus" . | indent 2 }}
timeout: {{ .timeout }}
register:
{{- if eq .storageunit "1" }}
address: 37004
{{- end }}
{{- if eq .storageunit "2" }}
address: 37738
{{- end }}
type: holding
decode: uint16nan
scale: 0.1
batterymode:
source: watchdog
timeout: 30s
reset: 1 # reset watchdog on normal
set:
source: switch
switch:
- case: 1 # normal
set:
source: sequence
set:
- source: const
value: 0 # stop
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47100 # Forcible charge/discharge
type: writesingle
encoding: uint16
{{- if eq .forceaccharging "false" }}
- source: const
value: 0 # Disable
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47087 # Charge from grid
type: writesingle
encoding: uint16
{{- end }}
- case: 2 # hold
set:
source: sequence
set:
- source: const
value: 2 # discharge
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47100 # Forcible charge/discharge
type: writesingle
encoding: uint16
- source: const
value: 0 # duration
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47246 # Forcible charge/discharge setting mode
type: writesingle
encoding: uint16
- source: const
value: 1 # Minute
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47083 # Forced charging and discharging period
type: writesingle
encoding: uint16
- source: const
value: 0 # W
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47249 # Forcible discharge power
type: writemultiple
encoding: uint32
- case: 3 # charge
set:
source: sequence
set:
- source: const
value: 1 # charge
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47100 # Forcible charge/discharge
type: writesingle
encoding: uint16
- source: const
value: 0 # duration
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47246 # Forcible charge/discharge setting mode
type: writesingle
encoding: uint16
- source: const
value: 1 # Minute
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47083 # Forced charging and discharging period
type: writesingle
encoding: uint16
- source: const
value: {{ .maxchargepower }} # W
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47247 # Forcible charge power
type: writemultiple
encoding: uint32
- source: const
value: 1 # Enable
set:
source: modbus
{{- include "modbus" . | indent 12 }}
register:
address: 47087 # Charge from grid
type: writesingle
encoding: uint16
capacity: {{ .capacity }} # kWh
minsoc: {{ .minsoc }} # %
maxsoc: {{ .maxsoc }} # %
maxchargepower: {{ .maxchargepower }} # W
maxdischargepower: {{ .maxdischargepower }} # W
{{- end }}