Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SofarSolar: add battery discharge control #16113

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}