Skip to content

Commit

Permalink
EM24: add pv usage & fix energy (evcc-io#17173)
Browse files Browse the repository at this point in the history
  • Loading branch information
premultiply authored Nov 13, 2024
1 parent 5eea98f commit 964adbe
Showing 1 changed file with 82 additions and 20 deletions.
102 changes: 82 additions & 20 deletions templates/definition/meter/cg-em24.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 964adbe

Please sign in to comment.