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 }}