From aeaa1807b5bbf526ba02687ea70ca7f358d9f380 Mon Sep 17 00:00:00 2001 From: Frank Steiler Date: Wed, 3 Dec 2025 19:18:02 +0100 Subject: [PATCH] SMA Hybrid Inverter: add `grid` usage (#25456) --- templates/definition/meter/sma-hybrid.yaml | 78 +++++++++++++++++++--- 1 file changed, 68 insertions(+), 10 deletions(-) diff --git a/templates/definition/meter/sma-hybrid.yaml b/templates/definition/meter/sma-hybrid.yaml index 9ee852839..e3c51a0ba 100644 --- a/templates/definition/meter/sma-hybrid.yaml +++ b/templates/definition/meter/sma-hybrid.yaml @@ -11,7 +11,7 @@ requirements: de: Bei der Nutzung der aktiven Speichersteuerung durch evcc darf die Funktion 'Prognosebasierten Laden' im SMA Portal nicht aktiv sein. Ansonsten kann es zu Konflikten bei der Steuerung des Speichers kommen. params: - name: usage - choice: ["pv", "battery"] + choice: ["pv", "battery", "grid"] allinone: true - name: modbus choice: ["tcpip"] @@ -36,12 +36,21 @@ render: | type: custom {{- if eq .usage "grid" }} power: - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 30865 # SMA Modbus Profile: Metering.GridMs.TotWIn - type: input - decode: int32nan + source: calc + add: + - source: modbus + {{- include "modbus" . | indent 6 }} + register: + address: 30865 # SMA Modbus Profile: Metering.GridMs.TotWIn + type: input + decode: int32nan + - source: modbus + {{- include "modbus" . | indent 6 }} + register: + address: 30867 # SMA Modbus Profile: Metering.GridMs.TotWOut + type: input + decode: int32nan + scale: -1 energy: source: modbus {{- include "modbus" . | indent 2 }} @@ -54,24 +63,73 @@ render: | - source: modbus {{- include "modbus" . | indent 4 }} register: - address: 31435 # SMA Modbus Profile: Metering.GridMs.A.phsA + address: 31435 # SMA Modbus Profile: Metering.GridMs.A.phsA # Grid current phase L1, unsigned (independent of flow direction) type: input decode: int32nan scale: 0.001 - source: modbus {{- include "modbus" . | indent 4 }} register: - address: 31437 # SMA Modbus Profile: Metering.GridMs.A.phsB + address: 31437 # SMA Modbus Profile: Metering.GridMs.A.phsB # Grid current phase L2, unsigned (independent of flow direction) type: input decode: int32nan scale: 0.001 - source: modbus {{- include "modbus" . | indent 4 }} register: - address: 31439 # SMA Modbus Profile: Metering.GridMs.A.phsC + address: 31439 # SMA Modbus Profile: Metering.GridMs.A.phsC # Grid current phase L3, unsigned (independent of flow direction) type: input decode: int32nan scale: 0.001 + powers: + - source: calc + add: + - source: modbus + {{- include "modbus" . | indent 8 }} + register: + address: 31265 # SMA Modbus Profile: Metering.GridMs.WIn.phsA # Power drawn from grid phase L1, unsigned, zero if no consumption + type: input + decode: uint32nan + scale: 1 + - source: modbus + {{- include "modbus" . | indent 8 }} + register: + address: 31259 # SMA Modbus Profile: Metering.GridMs.W.phsA # Power grid feeding L1, unsigned, zero if no feeding + type: input + decode: uint32nan + scale: -1 + - source: calc + add: + - source: modbus + {{- include "modbus" . | indent 8 }} + register: + address: 31267 # SMA Modbus Profile: Metering.GridMs.WIn.phsB # Power drawn from grid phase L2, unsigned, zero if no consumption + type: input + decode: uint32nan + scale: 1 + - source: modbus + {{- include "modbus" . | indent 8 }} + register: + address: 31261 # SMA Modbus Profile: Metering.GridMs.W.phsB # Power grid feeding L2, unsigned, zero if no feeding + type: input + decode: uint32nan + scale: -1 + - source: calc + add: + - source: modbus + {{- include "modbus" . | indent 8 }} + register: + address: 31269 # SMA Modbus Profile: Metering.GridMs.WIn.phsC # Power drawn from grid phase L3, unsigned, zero if no consumption + type: input + decode: uint32nan + scale: 1 + - source: modbus + {{- include "modbus" . | indent 8 }} + register: + address: 31263 # SMA Modbus Profile: Metering.GridMs.W.phsC # Power grid feeding L3, unsigned, zero if no feeding + type: input + decode: uint32nan + scale: -1 {{- end }} {{- if eq .usage "pv" }} power: