Skip to content

Commit

Permalink
chore: put grid first (#15990)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Sep 11, 2024
1 parent 2d60e67 commit 9010545
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
52 changes: 26 additions & 26 deletions templates/definition/meter/deye-storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
78 changes: 39 additions & 39 deletions templates/definition/meter/sma-hybrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

0 comments on commit 9010545

Please sign in to comment.