diff --git a/templates/definition/meter/cg-em24.yaml b/templates/definition/meter/cg-em24.yaml index 47616409ae..c5d82bcc95 100644 --- a/templates/definition/meter/cg-em24.yaml +++ b/templates/definition/meter/cg-em24.yaml @@ -8,28 +8,90 @@ products: generic: EM24 params: - name: usage - choice: ["grid", "charge"] + choice: ["grid", "charge", "pv"] - name: modbus choice: ["rs485", "tcpip"] render: | - type: mbmd - {{- include "modbus" . }} - model: cgem24 - power: Power - energy: Import + type: custom + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x28 + type: input + decode: int32 + scale: {{ if eq .usage "pv" }}-{{ end }}0.1 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: {{ if eq .usage "pv" }}0x5c{{ else }}0x3e{{ end }} + type: input + decode: int32 + scale: 0.1 currents: - - CurrentL1 - - CurrentL2 - - CurrentL3 - {{- if eq .usage "grid" }} - powers: - - PowerL1 - - PowerL2 - - PowerL3 - {{- end }} - {{- if eq .usage "charge" }} + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x0c + type: input + decode: uint32 + scale: 0.001 + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x0e + type: input + decode: uint32 + scale: 0.001 + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x10 + type: input + decode: uint32 + scale: 0.001 voltages: - - VoltageL1 - - VoltageL2 - - VoltageL3 - {{- end }} + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x0 + type: input + decode: uint32 + scale: 0.1 + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x2 + type: input + decode: uint32 + scale: 0.1 + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x4 + type: input + decode: uint32 + scale: 0.1 + powers: + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x12 + type: input + decode: int32 + scale: {{ if eq .usage "pv" }}-{{ end }}0.1 + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x14 + type: input + decode: int32 + scale: {{ if eq .usage "pv" }}-{{ end }}0.1 + - source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x16 + type: input + decode: int32 + scale: {{ if eq .usage "pv" }}-{{ end }}0.1