From 383ef6a0446680b025d7d53ae16fdc6e4be05da7 Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Tue, 11 Jul 2023 09:22:17 +0200 Subject: [PATCH] Add M-TEC Energy Butler (#8901) --- templates/definition/meter/mtec-eb-gen2.yaml | 47 ++++++++++++++++ templates/definition/meter/mtec-eb-gen3.yaml | 47 ++++++++++++++++ templates/docs/meter/mtec-eb-gen2_0.yaml | 58 ++++++++++++++++++++ templates/docs/meter/mtec-eb-gen3_0.yaml | 58 ++++++++++++++++++++ templates/evcc.io/brands.json | 2 + 5 files changed, 212 insertions(+) create mode 100644 templates/definition/meter/mtec-eb-gen2.yaml create mode 100644 templates/definition/meter/mtec-eb-gen3.yaml create mode 100644 templates/docs/meter/mtec-eb-gen2_0.yaml create mode 100644 templates/docs/meter/mtec-eb-gen3_0.yaml diff --git a/templates/definition/meter/mtec-eb-gen2.yaml b/templates/definition/meter/mtec-eb-gen2.yaml new file mode 100644 index 000000000..5834ac8dc --- /dev/null +++ b/templates/definition/meter/mtec-eb-gen2.yaml @@ -0,0 +1,47 @@ +template: mtec-eb-gen2 +products: + - brand: M-TEC + description: + generic: Energy Butler GEN2 +params: + - name: usage + choice: ["grid", "pv", "battery"] + - name: modbus + choice: ["rs485"] +render: | + type: custom + {{- if eq .usage "grid" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 11000 # Zähler (NVP) Leistung + type: holding + decode: int32 + {{- end }} + {{- if eq .usage "pv" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 11028 # PV Leistung + type: holding + decode: uint32 + {{- end }} + {{- if eq .usage "battery" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 40258 # Batterie Leistung + type: holding + decode: int32 + soc: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 43000 # State of Charge (SOC) + type: holding + decode: uint16 + scale: 0.01 + {{- end }} diff --git a/templates/definition/meter/mtec-eb-gen3.yaml b/templates/definition/meter/mtec-eb-gen3.yaml new file mode 100644 index 000000000..5d2fde709 --- /dev/null +++ b/templates/definition/meter/mtec-eb-gen3.yaml @@ -0,0 +1,47 @@ +template: mtec-eb-gen3 +products: + - brand: M-TEC + description: + generic: Energy Butler GEN3 +params: + - name: usage + choice: ["grid", "pv", "battery"] + - name: modbus + choice: ["rs485"] +render: | + type: custom + {{- if eq .usage "grid" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 11000 # Zähler (NVP) Leistung + type: holding + decode: int32 + {{- end }} + {{- if eq .usage "pv" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 11028 # PV Leistung + type: holding + decode: uint32 + {{- end }} + {{- if eq .usage "battery" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 30258 # Batterie Leistung + type: holding + decode: int32 + soc: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 33000 # State of Charge (SOC) + type: holding + decode: uint16 + scale: 0.01 + {{- end }} diff --git a/templates/docs/meter/mtec-eb-gen2_0.yaml b/templates/docs/meter/mtec-eb-gen2_0.yaml new file mode 100644 index 000000000..5f76fb894 --- /dev/null +++ b/templates/docs/meter/mtec-eb-gen2_0.yaml @@ -0,0 +1,58 @@ +product: + brand: M-TEC + description: Energy Butler GEN2 +render: + - usage: grid + default: | + type: template + template: mtec-eb-gen2 + usage: grid + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + 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: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + - usage: pv + default: | + type: template + template: mtec-eb-gen2 + usage: pv + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + 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: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + - usage: battery + default: | + type: template + template: mtec-eb-gen2 + usage: battery + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + 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: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port diff --git a/templates/docs/meter/mtec-eb-gen3_0.yaml b/templates/docs/meter/mtec-eb-gen3_0.yaml new file mode 100644 index 000000000..850d6ee23 --- /dev/null +++ b/templates/docs/meter/mtec-eb-gen3_0.yaml @@ -0,0 +1,58 @@ +product: + brand: M-TEC + description: Energy Butler GEN3 +render: + - usage: grid + default: | + type: template + template: mtec-eb-gen3 + usage: grid + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + 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: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + - usage: pv + default: | + type: template + template: mtec-eb-gen3 + usage: pv + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + 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: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + - usage: battery + default: | + type: template + template: mtec-eb-gen3 + usage: battery + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + 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: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port diff --git a/templates/evcc.io/brands.json b/templates/evcc.io/brands.json index 546669190..ed5dc7fed 100644 --- a/templates/evcc.io/brands.json +++ b/templates/evcc.io/brands.json @@ -97,6 +97,7 @@ "Janitza", "Kostal", "LG", + "M-TEC", "my-PV", "myStrom", "OpenEMS", @@ -147,6 +148,7 @@ "IGEN Tech", "Kostal", "LG", + "M-TEC", "myStrom", "OpenEMS", "Powerfox",