diff --git a/templates/definition/meter/deye-storage.yaml b/templates/definition/meter/deye-storage.yaml index 85a9aa3f1..94a382899 100644 --- a/templates/definition/meter/deye-storage.yaml +++ b/templates/definition/meter/deye-storage.yaml @@ -17,6 +17,32 @@ params: advanced: true render: | type: custom + {{- if eq .usage "grid" }} + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 169 # "Total grid power" + type: holding + decode: int16 + energy: + source: calc + add: + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 78 # "Total_GridBuy_PowerWh_low" + type: holding + decode: uint16 + scale: 0.1 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 80 # "Total_GridBuy_PowerWh" + type: holding + decode: uint16 + scale: 6553.6 + {{- end }} {{- if eq .usage "pv" }} power: source: calc @@ -79,29 +105,3 @@ render: | decode: uint16 capacity: {{ .capacity }} # kWh {{- end }} - {{- if eq .usage "grid" }} - power: - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 169 # "Total grid power" - type: holding - decode: int16 - energy: - source: calc - add: - - source: modbus - {{- include "modbus" . | indent 4 }} - register: - address: 78 # "Total_GridBuy_PowerWh_low" - type: holding - decode: uint16 - scale: 0.1 - - source: modbus - {{- include "modbus" . | indent 4 }} - register: - address: 80 # "Total_GridBuy_PowerWh" - type: holding - decode: uint16 - scale: 6553.6 - {{- end }} diff --git a/templates/definition/meter/sma-hybrid.yaml b/templates/definition/meter/sma-hybrid.yaml index f6bddf9b1..b01fe0e0e 100644 --- a/templates/definition/meter/sma-hybrid.yaml +++ b/templates/definition/meter/sma-hybrid.yaml @@ -24,6 +24,45 @@ params: advanced: true 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 + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 30581 # SMA Modbus Profile: Metering.GridMs.TotWhIn + type: holding + decode: int32nan + scale: 0.001 + currents: + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 31435 # SMA Modbus Profile: Metering.GridMs.A.phsA + type: input + decode: int32nan + scale: 0.001 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 31437 # SMA Modbus Profile: Metering.GridMs.A.phsB + type: input + decode: int32nan + scale: 0.001 + - source: modbus + {{- include "modbus" . | indent 4 }} + register: + address: 31439 # SMA Modbus Profile: Metering.GridMs.A.phsC + type: input + decode: int32nan + scale: 0.001 + {{- end }} {{- if eq .usage "pv" }} power: source: calc @@ -145,42 +184,3 @@ render: | decode: uint32 capacity: {{ .capacity }} # kWh {{- end }} - {{- if eq .usage "grid" }} - power: - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 30865 # SMA Modbus Profile: Metering.GridMs.TotWIn - type: input - decode: int32nan - energy: - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 30581 # SMA Modbus Profile: Metering.GridMs.TotWhIn - type: holding - decode: int32nan - scale: 0.001 - currents: - - source: modbus - {{- include "modbus" . | indent 4 }} - register: - address: 31435 # SMA Modbus Profile: Metering.GridMs.A.phsA - type: input - decode: int32nan - scale: 0.001 - - source: modbus - {{- include "modbus" . | indent 4 }} - register: - address: 31437 # SMA Modbus Profile: Metering.GridMs.A.phsB - type: input - decode: int32nan - scale: 0.001 - - source: modbus - {{- include "modbus" . | indent 4 }} - register: - address: 31439 # SMA Modbus Profile: Metering.GridMs.A.phsC - type: input - decode: int32nan - scale: 0.001 - {{- end }}