Skip to content

Commit

Permalink
SofarSolar: add battery discharge control (evcc-io#16113)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Sep 20, 2024
1 parent 161c068 commit b8162aa
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions templates/definition/meter/sofarsolar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ products:
- brand: ZCS Azzurro
description:
generic: Inverter, Hybrid Inverter
capabilities: ["battery-control"]
params:
- name: usage
choice: ["grid", "pv", "battery"]
Expand Down Expand Up @@ -91,5 +92,74 @@ 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 b8162aa

Please sign in to comment.