From 2fd77db6417c923b80b858291ab51a879aeaf0da Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Sat, 11 Nov 2023 08:37:40 +0100 Subject: [PATCH] Deye: add single phase inverters (#10692) --- .../{deye-hybrid.yaml => deye-hybrid-3p.yaml} | 43 +++---- templates/definition/meter/deye-mi.yaml | 42 +++++++ templates/definition/meter/deye-storage.yaml | 109 ++++++++++++++++++ templates/definition/meter/deye-string.yaml | 35 ++++++ templates/evcc.io/brands.json | 1 + 5 files changed, 209 insertions(+), 21 deletions(-) rename templates/definition/meter/{deye-hybrid.yaml => deye-hybrid-3p.yaml} (71%) create mode 100644 templates/definition/meter/deye-mi.yaml create mode 100644 templates/definition/meter/deye-storage.yaml create mode 100644 templates/definition/meter/deye-string.yaml diff --git a/templates/definition/meter/deye-hybrid.yaml b/templates/definition/meter/deye-hybrid-3p.yaml similarity index 71% rename from templates/definition/meter/deye-hybrid.yaml rename to templates/definition/meter/deye-hybrid-3p.yaml index d5fdffd1c..950763a5c 100644 --- a/templates/definition/meter/deye-hybrid.yaml +++ b/templates/definition/meter/deye-hybrid-3p.yaml @@ -1,11 +1,12 @@ -template: deye-hybrid +template: deye-hybrid-3p +covers: ["deye-hybrid"] products: - brand: Deye description: - generic: SUN-(5/6/8/10/12)K-SG04LP3-EU series hybrid inverter + generic: 3p hybrid inverter - brand: Sunsynk description: - generic: SYNK-(8/10/12)K-SG04LP3 *untested* + generic: 3p hybrid inverter params: - name: usage choice: ["grid", "pv", "battery"] @@ -22,14 +23,14 @@ render: | power: source: modbus {{- include "modbus" . | indent 2 }} - register: # manual non-sunspec register configuration + register: address: 625 # Grid side total power type: holding decode: int16 energy: source: modbus {{- include "modbus" . | indent 2 }} - register: # manual non-sunspec register configuration + register: address: 522 # "Total_GridBuy_Power Wh" type: holding decode: uint32 @@ -37,21 +38,21 @@ render: | currents: - source: modbus {{- include "modbus" . | indent 4 }} - register: # manual non-sunspec register configuration + register: address: 613 # "Out-of-grid - current A" type: holding decode: int16 scale: 0.01 - source: modbus {{- include "modbus" . | indent 4 }} - register: # manual non-sunspec register configuration + register: address: 614 # "Out-of-grid - current B" type: holding decode: int16 scale: 0.01 - source: modbus {{- include "modbus" . | indent 4 }} - register: # manual non-sunspec register configuration + register: address: 615 # "Out-of-grid - current C" type: holding decode: int16 @@ -63,32 +64,32 @@ render: | add: - source: modbus {{- include "modbus" . | indent 4 }} - register: # manual non-sunspec register configuration + register: address: 672 # "PV1 input power" type: holding - decode: int16 + decode: uint16 - source: modbus {{- include "modbus" . | indent 4 }} - register: # manual non-sunspec register configuration + register: address: 673 # "PV2 input power" type: holding - decode: int16 + decode: uint16 - source: modbus {{- include "modbus" . | indent 4 }} - register: # manual non-sunspec register configuration + register: address: 674 # "PV3 input power" type: holding - decode: int16 + decode: uint16 - source: modbus {{- include "modbus" . | indent 4 }} - register: # manual non-sunspec register configuration + register: address: 675 # "PV4 input power" type: holding - decode: int16 + decode: uint16 energy: source: modbus {{- include "modbus" . | indent 2 }} - register: # manual non-sunspec register configuration + register: address: 534 # "Total_PV_Power_Wh" type: holding decode: uint32 @@ -98,24 +99,24 @@ render: | power: source: modbus {{- include "modbus" . | indent 2 }} - register: # manual non-sunspec register configuration + register: address: 590 # "Battery output power" type: holding decode: int16 soc: source: modbus {{- include "modbus" . | indent 2 }} - register: # manual non-sunspec register configuration + register: address: 588 # "battery capacity" type: holding - decode: int16 + decode: uint16 {{- if .capacity }} capacity: {{ .capacity }} # kWh {{- end }} energy: source: modbus {{- include "modbus" . | indent 2 }} - register: # manual non-sunspec register configuration + register: address: 518 # "Total discharge of the battery (Wh)" type: holding decode: uint32 diff --git a/templates/definition/meter/deye-mi.yaml b/templates/definition/meter/deye-mi.yaml new file mode 100644 index 000000000..00f9ee003 --- /dev/null +++ b/templates/definition/meter/deye-mi.yaml @@ -0,0 +1,42 @@ +template: deye-mi +products: + - brand: Deye + description: + generic: Micro inverter + - brand: Bosswerk + description: + generic: Micro inverter + - brand: Anker + description: + generic: Micro inverter + - brand: Sunsynk + description: + generic: Micro inverter +params: + - name: usage + choice: ["pv"] + - name: modbus + choice: ["rs485", "tcpip"] + baudrate: 9600 + id: 1 + advanced: true +render: | + type: custom + {{- if eq .usage "pv" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 86 # "Output active power" + type: holding + decode: uint32 + scale: 0.1 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 63 # "Total_Active_PowerWh" + type: holding + decode: uint32 + scale: 0.1 + {{- end }} diff --git a/templates/definition/meter/deye-storage.yaml b/templates/definition/meter/deye-storage.yaml new file mode 100644 index 000000000..6a90dee72 --- /dev/null +++ b/templates/definition/meter/deye-storage.yaml @@ -0,0 +1,109 @@ +template: deye-storage +products: + - brand: Deye + description: + generic: Storage (hybrid) inverter + - brand: Sunsynk + description: + generic: Storage (hybrid) inverter +params: + - name: usage + choice: ["pv", "battery", "grid"] + - name: modbus + choice: ["rs485", "tcpip"] + baudrate: 9600 + id: 1 + - name: capacity + advanced: true +render: | + type: custom + {{- if eq .usage "pv" }} + power: + source: calc + add: + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 186 # "PV1 input power" + type: holding + decode: uint16 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 187 # "PV2 input power" + type: holding + decode: uint16 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 188 # "PV3 input power" + type: holding + decode: uint16 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 189 # "PV4 input power" + type: holding + decode: uint16 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 96 # "historyPV PowerWh" + type: holding + decode: uint32 + scale: 0.1 + {{- end }} + {{- if eq .usage "battery" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 190 # "Battery output power" + type: holding + decode: int16 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 74 # "Battery cumulative discharge" + type: holding + decode: uint32 + scale: 0.1 + soc: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 184 # "battery capacity" + type: holding + decode: uint16 + {{- if .capacity }} + capacity: {{ .capacity }} # kWh + {{- end }} + {{- end }} + {{- if eq .usage "grid" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 169 # "Total grid power" + type: holding + decode: int16 + energy: + source: calc + add: + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 78 # "Total_GridBuy_PowerWh_low" + type: holding + decode: uint16 + scale: 0.1 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 80 # "Total_GridBuy_PowerWh" + type: holding + decode: uint16 + scale: 6553.6 + {{- end }} diff --git a/templates/definition/meter/deye-string.yaml b/templates/definition/meter/deye-string.yaml new file mode 100644 index 000000000..393e8759d --- /dev/null +++ b/templates/definition/meter/deye-string.yaml @@ -0,0 +1,35 @@ +template: deye-string +products: + - brand: Deye + description: + generic: String inverter + - brand: Sunsynk + description: + generic: String inverter +params: + - name: usage + choice: ["pv"] + - name: modbus + choice: ["rs485", "tcpip"] + baudrate: 9600 + id: 1 +render: | + type: custom + {{- if eq .usage "pv" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 86 # "Output active power" + type: holding + decode: uint32 + scale: 0.1 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 63 # "Total_Active_PowerWh" + type: holding + decode: uint32 + scale: 0.1 + {{- end }} diff --git a/templates/evcc.io/brands.json b/templates/evcc.io/brands.json index 71e742289..c6e942791 100644 --- a/templates/evcc.io/brands.json +++ b/templates/evcc.io/brands.json @@ -151,6 +151,7 @@ "Acrel", "Ads-tec", "Alpha ESS", + "Anker", "AVM", "Bosswerk", "Deye",