Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huawei EMMA template #17338

Merged
merged 10 commits into from
Nov 20, 2024
110 changes: 110 additions & 0 deletions templates/definition/meter/huawei-emma.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
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
scale: 1
andig marked this conversation as resolved.
Show resolved Hide resolved
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
scale: 1
andig marked this conversation as resolved.
Show resolved Hide resolved
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: .01
andig marked this conversation as resolved.
Show resolved Hide resolved
capacity: {{ .capacity }} # kWh
{{- end }}