From 2fb9a84ddf4a9048830f7d97c5f65307f9c6892e Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:35:00 +0100 Subject: [PATCH] Add GoodWe hybrid inverters (#5869) --- templates/definition/meter/goodwe-hybrid.yaml | 102 ++++++++++++ templates/docs/meter/goodwe-hybrid_0.yaml | 148 ++++++++++++++++++ templates/evcc.io/brands.json | 2 + 3 files changed, 252 insertions(+) create mode 100644 templates/definition/meter/goodwe-hybrid.yaml create mode 100644 templates/docs/meter/goodwe-hybrid_0.yaml diff --git a/templates/definition/meter/goodwe-hybrid.yaml b/templates/definition/meter/goodwe-hybrid.yaml new file mode 100644 index 000000000..6909e70d5 --- /dev/null +++ b/templates/definition/meter/goodwe-hybrid.yaml @@ -0,0 +1,102 @@ +template: goodwe-hybrid +products: + - brand: GoodWe + description: + generic: ET/EH/BH/BT Hybrid Inverter +params: + - name: usage + choice: ["grid", "pv", "battery"] + - name: modbus + choice: ["rs485", "tcpip"] + baudrate: 9600 + id: 247 + - name: capacity + advanced: true +render: | + type: custom + {{- if eq .usage "grid" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: # manual non-sunspec register configuration + address: 36025 # MTTotalActivepower Pmeter + type: holding + decode: int32 + scale: -1 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: # manual non-sunspec register configuration + address: 36017 # E-Total-Buy + type: holding + decode: float32 + scale: 0.1 + {{- end }} + {{- if eq .usage "pv" }} + power: + source: calc + add: + - source: modbus + {{- include "modbus" . | indent 4 }} + register: # manual non-sunspec register configuration + address: 35105 # Ppv1 PV1 Power + type: holding + decode: uint32 + scale: 0.1 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: # manual non-sunspec register configuration + address: 35109 # Ppv2 PV2 Power + type: holding + decode: uint32 + scale: 0.1 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: # manual non-sunspec register configuration + address: 35113 # Ppv3 PV3 Power + type: holding + decode: uint32 + scale: 0.1 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: # manual non-sunspec register configuration + address: 35117 # Ppv4 PV4 Power + type: holding + decode: uint32 + scale: 0.1 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: # manual non-sunspec register configuration + address: 35191 # PV E-Total Total PV Energy + type: holding + decode: uint32 + scale: 0.1 + {{- end }} + {{- if eq .usage "battery" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: # manual non-sunspec register configuration + address: 35183 # Pbattery1 First group battery power + type: holding + decode: int16 + soc: + source: modbus + {{- include "modbus" . | indent 2 }} + register: # manual non-sunspec register configuration + address: 37007 # SOC First group battery capacity + type: holding + decode: uint16 + {{- if ne .capacity "" }} + capacity: {{ .capacity }} # kWh + {{- end }} + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: # manual non-sunspec register configuration + address: 35209 # E-BatteryDischarge Discharge energy + type: holding + decode: uint32 + scale: 0.1 + {{- end }} diff --git a/templates/docs/meter/goodwe-hybrid_0.yaml b/templates/docs/meter/goodwe-hybrid_0.yaml new file mode 100644 index 000000000..10a3d1256 --- /dev/null +++ b/templates/docs/meter/goodwe-hybrid_0.yaml @@ -0,0 +1,148 @@ +product: + brand: GoodWe + description: ET/EH/BH/BT Hybrid Inverter +render: + - usage: grid + default: | + type: template + template: goodwe-hybrid + usage: grid + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 247 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + advanced: | + type: template + template: goodwe-hybrid + usage: grid + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 247 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + capacity: 50 # Akkukapazität in kWh # Optional + - usage: pv + default: | + type: template + template: goodwe-hybrid + usage: pv + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 247 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + advanced: | + type: template + template: goodwe-hybrid + usage: pv + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 247 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + capacity: 50 # Akkukapazität in kWh # Optional + - usage: battery + default: | + type: template + template: goodwe-hybrid + usage: battery + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 247 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + advanced: | + type: template + template: goodwe-hybrid + usage: battery + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 247 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 247 + host: 192.0.2.2 # Hostname + port: 502 # Port + capacity: 50 # Akkukapazität in kWh # Optional diff --git a/templates/evcc.io/brands.json b/templates/evcc.io/brands.json index 40ff7ec49..9379826ed 100644 --- a/templates/evcc.io/brands.json +++ b/templates/evcc.io/brands.json @@ -68,6 +68,7 @@ "FENECON", "FoxESS", "Fronius", + "GoodWe", "Growatt", "Homematic IP", "Huawei", @@ -104,6 +105,7 @@ "FENECON", "FoxESS", "Fronius", + "GoodWe", "Growatt", "Homematic IP", "Huawei",