Skip to content

Commit

Permalink
SofarSolar: switch battery control (#16311)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Sep 25, 2024
1 parent f78c406 commit 6db50af
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 70 deletions.
71 changes: 71 additions & 0 deletions templates/definition/meter/sofarsolar-g3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ requirements:
description:
de: Es wird empfohlen die Verbindung über einen LSE-3 Logger Stick mittels ModBus TCP herzustellen (LSW-3 WLAN Stick wird nicht unterstützt). Bei seriellem Anschluss via RS485 mit entsprechendem Adapter am COM Port ist zu beachten, dass wechselrichterseitig für eine Terminierung des RS485 Busses zu sorgen ist.
en: It is recommended to establish the connection via a LSE-3 logger stick using ModBus TCP (LSW-3 WiFi stick is not supported). If you are connecting via serial RS485 using the inverter's COM port and a proper adapter note that on the inverter's side you have to take care of a proper termination of the RS485 bus.
capabilities: ["battery-control"]
params:
- name: usage
choice: ["grid", "pv", "battery"]
Expand Down Expand Up @@ -143,4 +144,74 @@ render: |
address: 0x0608 # SOC_Bat1
type: holding
decode: uint16
batterymode:
source: switch
switch:
- case: 1 # normal
set:
source: const
value: 0 # self-use
set:
source: modbus
{{- include "modbus" . | indent 8 }}
register:
address: 0x1110
type: writemultiple
decode: int16
- case: 2 # hold
set:
source: sequence
set:
- source: const
value: 3 # passive
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x1110
type: writemultiple
decode: int16
- source: const
value: 0
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x1187
type: writemultiple
decode: int32
- source: const
value: 0
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x1189
type: writemultiple
decode: int32
- source: const
value: 0x7FFFFFFF
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x118B
type: writemultiple
decode: int32
- case: 3 # charge (not implemented -> normal)
set:
source: const
value: 0 # self-use
set:
source: sequence
set:
- source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x1110
type: writemultiple
decode: int16
- source: error
error: ErrNotAvailable
capacity: {{ .capacity }} # kWh
{{- end }}
70 changes: 0 additions & 70 deletions templates/definition/meter/sofarsolar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ products:
- brand: ZCS Azzurro
description:
generic: Inverter, Hybrid Inverter
capabilities: ["battery-control"]
params:
- name: usage
choice: ["grid", "pv", "battery"]
Expand Down Expand Up @@ -92,74 +91,5 @@ render: |
address: 0x0210 # The residual capacity of battery
type: holding
decode: uint16
batterymode:
source: switch
switch:
- case: 1 # normal
set:
source: const
value: 0 # self-use
set:
source: modbus
{{- include "modbus" . | indent 8 }}
register:
address: 0x1110
type: writemultiple
decode: int16
- case: 2 # hold
set:
source: sequence
set:
- source: const
value: 3 # passive
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x1110
type: writemultiple
decode: int16
- source: const
value: 0
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x1187
type: writemultiple
decode: int32
- source: const
value: 0
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x1189
type: writemultiple
decode: int32
- source: const
value: 0x7FFFFFFF
set:
source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x118B
type: writemultiple
decode: int32
- case: 3 # charge (not implemented -> normal)
set:
source: const
value: 0 # self-use
set:
source: sequence
set:
- source: modbus
{{- include "modbus" . | indent 10 }}
register:
address: 0x1110
type: writemultiple
decode: int16
- source: error
error: ErrNotAvailable
capacity: {{ .capacity }} # kWh
{{- end }}

0 comments on commit 6db50af

Please sign in to comment.