SDM120: add usage pv (#11913)

This commit is contained in:
premultiply 2024-01-28 15:21:17 +01:00 • committed by GitHub
parent 578b9ac2f7
commit 1ee09c5b65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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