From 1ee09c5b656ee4cadb59c923f57d520da4d790be Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Sun, 28 Jan 2024 15:21:17 +0100 Subject: [PATCH] SDM120: add usage pv (#11913) --- .../definition/meter/eastron-sdm120.yaml | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/templates/definition/meter/eastron-sdm120.yaml b/templates/definition/meter/eastron-sdm120.yaml index b2eeda52f9..04d3e21ba3 100644 --- a/templates/definition/meter/eastron-sdm120.yaml +++ b/templates/definition/meter/eastron-sdm120.yaml @@ -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