From 0dad8b82d5431d9701eee6b150b8e17975cc0af5 Mon Sep 17 00:00:00 2001 From: Mungg1818 <65672049+Mungg1818@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:31:10 +0100 Subject: [PATCH] Add Huawei EMMA (#17338) --- templates/definition/meter/huawei-emma.yaml | 108 ++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 templates/definition/meter/huawei-emma.yaml diff --git a/templates/definition/meter/huawei-emma.yaml b/templates/definition/meter/huawei-emma.yaml new file mode 100644 index 0000000000..2172e4c1f7 --- /dev/null +++ b/templates/definition/meter/huawei-emma.yaml @@ -0,0 +1,108 @@ +template: huawei-emma +products: + - brand: Huawei + description: + generic: EMMA +params: + - name: usage + choice: ["grid", "pv", "battery"] + allinone: true + - name: modbus + choice: ["tcpip"] + - name: capacity + advanced: true +render: | + type: custom + {{- if eq .usage "grid" }} + power: + source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 31657 # Active power of built-in electric energy sensor + type: holding + decode: int32 + energy: + source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 31679 # Total negative active energy of built-in electric energy sensor + type: holding + decode: int64 + scale: 0.01 + currents: + - source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 31651 # Huawei phase A grid current + type: holding + decode: int32 + scale: 0.1 + - source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 31653 # Huawei phase B grid current + type: holding + decode: int32 + scale: 0.1 + - source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 31655 # Huawei phase C grid current + type: holding + decode: int32 + scale: 0.1 + {{- end }} + {{- if eq .usage "pv" }} + power: + source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 30354 # Active power + type: holding + decode: int32 + energy: + source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 30344 # E-Total + type: holding + decode: uint32 + scale: 0.1 + {{- end }} + {{- if eq .usage "battery" }} + power: + source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 30360 + type: holding + decode: int32nan + scale: -1 + energy: + source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 30312 # Total discharge + type: holding + decode: uint32nan + scale: 0.01 + soc: + source: modbus + id: 0 + uri: {{ .host }}:{{ .port }} + register: + address: 30368 + type: holding + decode: uint16nan + scale: 0.01 + capacity: {{ .capacity }} # kWh + {{- end }}