diff --git a/templates/definition/meter/sma-hybrid.yaml b/templates/definition/meter/sma-hybrid.yaml index db12fb905..9d3ad722d 100644 --- a/templates/definition/meter/sma-hybrid.yaml +++ b/templates/definition/meter/sma-hybrid.yaml @@ -83,7 +83,7 @@ render: | decode: uint32nan batterymode: source: watchdog - timeout: {{ .watchdog }} # re-write at timeout/2 + timeout: {{ .watchdog }} reset: 1 # reset watchdog on normal set: source: switch diff --git a/templates/definition/meter/sma-inverter-modbus.yaml b/templates/definition/meter/sma-inverter-modbus.yaml index 3cac3e927..f596b13c9 100644 --- a/templates/definition/meter/sma-inverter-modbus.yaml +++ b/templates/definition/meter/sma-inverter-modbus.yaml @@ -2,14 +2,10 @@ template: sma-inverter-modbus products: - brand: SMA description: - generic: Sunny Island (Modbus) - - brand: SMA - description: - generic: Sunny Boy Storage (Modbus) -capabilities: ["battery-control"] + generic: Wechselrichter (Modbus) params: - name: usage - choice: ["battery"] + choice: ["pv"] - name: modbus choice: ["tcpip"] port: 502 @@ -17,12 +13,6 @@ params: help: en: The Modbus TCP-Server needs to be enabled on this inverter de: Der Modbus TCP-Server muss an diesem Wechselrichter aktiviert sein - - name: capacity - advanced: true - - name: watchdog - type: duration - default: 60s - advanced: true render: | type: custom power: @@ -40,55 +30,3 @@ render: | type: holding decode: uint64nan scale: 0.001 - {{- if eq .usage "battery" }} - soc: - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 30845 # SMA Modbus Profile: Bat.ChaStt - type: holding - decode: uint32nan - batterymode: - source: watchdog - timeout: {{ .watchdog }} # re-write at timeout/2 - reset: 1 # reset watchdog on normal - set: - source: switch - switch: - - case: 1 # normal - set: - source: const - value: 10000 # Maximale Wirkleistung - set: - source: modbus - {{- include "modbus" . | indent 10 }} - register: - address: 44039 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSptMaxNom - type: writemultiple - decode: int32 - - case: 2 # hold - set: - source: const - value: 0 # Maximale Wirkleistung - set: - source: modbus - {{- include "modbus" . | indent 10 }} - register: - address: 44039 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSptMaxNom - type: writemultiple - decode: int32 - - case: 3 # charge - set: - source: const - value: -10000 # Maximale Wirkleistung - set: - source: modbus - {{- include "modbus" . | indent 10 }} - register: - address: 44039 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSptMaxNom - type: writemultiple - decode: int32 - {{- if .capacity }} - capacity: {{ .capacity }} # kWh - {{- end }} - {{- end }} diff --git a/templates/definition/meter/sma-sbs-modbus.yaml b/templates/definition/meter/sma-sbs-modbus.yaml new file mode 100644 index 000000000..8a3a89e96 --- /dev/null +++ b/templates/definition/meter/sma-sbs-modbus.yaml @@ -0,0 +1,89 @@ +template: sma-sbs-modbus +products: + - brand: SMA + description: + generic: Sunny Boy Storage (Modbus) +capabilities: ["battery-control"] +params: + - name: usage + choice: ["battery"] + - name: modbus + choice: ["tcpip"] + port: 502 + id: 3 + help: + en: The Modbus TCP-Server needs to be enabled on this inverter + de: Der Modbus TCP-Server muss an diesem Wechselrichter aktiviert sein + - name: capacity + advanced: true + - name: watchdog + type: duration + default: 60s + advanced: true +render: | + type: custom + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 30775 # SMA Modbus Profile: GridMs.TotW + type: input + decode: int32nan + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 30513 # SMA Modbus Profile: Metering.TotWhOut + type: holding + decode: uint64nan + scale: 0.001 + soc: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 30845 # SMA Modbus Profile: Bat.ChaStt + type: holding + decode: uint32nan + batterymode: + source: watchdog + timeout: {{ .watchdog }} + reset: 1 # reset watchdog on normal + set: + source: switch + switch: + - case: 1 # normal + set: + source: const + value: 10000 # Maximale Wirkleistung 100.00% + set: + source: modbus + {{- include "modbus" . | indent 10 }} + register: + address: 44039 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSptMaxNom + type: writemultiple + decode: int32 + - case: 2 # hold + set: + source: const + value: 0 # Maximale Wirkleistung 0.00% + set: + source: modbus + {{- include "modbus" . | indent 10 }} + register: + address: 44039 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSptMaxNom + type: writemultiple + decode: int32 + - case: 3 # charge + set: + source: const + value: -10000 # Maximale Wirkleistung -100.00% + set: + source: modbus + {{- include "modbus" . | indent 10 }} + register: + address: 44039 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSptMaxNom + type: writemultiple + decode: int32 + {{- if .capacity }} + capacity: {{ .capacity }} # kWh + {{- end }} diff --git a/templates/definition/meter/sma-si-modbus.yaml b/templates/definition/meter/sma-si-modbus.yaml new file mode 100644 index 000000000..a55e7300e --- /dev/null +++ b/templates/definition/meter/sma-si-modbus.yaml @@ -0,0 +1,111 @@ +template: sma-si-modbus +products: + - brand: SMA + description: + generic: Sunny Island (Modbus) +capabilities: ["battery-control"] +params: + - name: usage + choice: ["battery"] + - name: modbus + choice: ["tcpip"] + port: 502 + id: 3 + help: + en: The Modbus TCP-Server needs to be enabled on this inverter + de: Der Modbus TCP-Server muss an diesem Wechselrichter aktiviert sein + - name: capacity + advanced: true + - name: watchdog + type: duration + default: 60s + advanced: true +render: | + type: custom + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 30775 # SMA Modbus Profile: GridMs.TotW + type: input + decode: int32nan + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 30513 # SMA Modbus Profile: Metering.TotWhOut + type: holding + decode: uint64nan + scale: 0.001 + soc: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 30845 # SMA Modbus Profile: Bat.ChaStt + type: holding + decode: uint32nan + batterymode: + source: watchdog + timeout: {{ .watchdog }} + reset: 1 # reset watchdog on normal + set: + source: switch + switch: + - case: 1 # normal + set: + source: const + value: 803 # inaktiv (Ina) + set: + source: modbus + {{- include "modbus" . | indent 10 }} + register: + address: 40151 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WCtlComAct + type: writemultiple + decode: uint32 + - case: 2 # hold + set: + source: sequence + set: + - source: const + value: 0 # Wirkleistungsvorgabe + set: + source: modbus + {{- include "modbus" . | indent 12 }} + register: + address: 40149 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSpt + type: writemultiple + decode: int32 + - source: const + value: 802 # aktiv (Act) + set: + source: modbus + {{- include "modbus" . | indent 12 }} + register: + address: 40151 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WCtlComAct + type: writemultiple + decode: uint32 + - case: 3 # charge + set: + source: sequence + set: + - source: const + value: -2147483648 # Wirkleistungsvorgabe + set: + source: modbus + {{- include "modbus" . | indent 12 }} + register: + address: 40149 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WSpt + type: writemultiple + decode: int32 + - source: const + value: 802 # aktiv (Act) + set: + source: modbus + {{- include "modbus" . | indent 12 }} + register: + address: 40151 # SMA Modbus Profile: Inverter.WModCfg.WCtlComCfg.WCtlComAct + type: writemultiple + decode: uint32 + {{- if .capacity }} + capacity: {{ .capacity }} # kWh + {{- end }}