Skip to content

Commit

Permalink
SDM120: add usage pv (#11913)
Browse files Browse the repository at this point in the history
  • Loading branch information
premultiply authored Jan 28, 2024
1 parent 578b9ac commit 1ee09c5
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions templates/definition/meter/eastron-sdm120.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,29 @@ products:
generic: SDM120-Modbus
params:
- name: usage
choice: ["grid", "charge"]
choice: ["grid", "charge", "pv"]
- name: modbus
choice: ["rs485"]
render: |
type: mbmd
{{- include "modbus" . }}
model: sdm
power: Power
energy: Import
type: custom
power:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
address: 0x0c # Active power
type: input
decode: float32
{{- if eq .usage "pv" }}
scale: -1
{{- end }}
energy:
source: modbus
{{- include "modbus" . | indent 2 }}
register:
{{- if eq .usage "pv" }}
address: 0x4c # Export active energy
{{- else }}
address: 0x48 # Import active energy
{{- end }}
type: input
decode: float32

0 comments on commit 1ee09c5

Please sign in to comment.