Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions api/batterymode.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ const (
BatteryNormal
BatteryHold
BatteryCharge
BatteryNoCharge
)
12 changes: 8 additions & 4 deletions api/batterymode_enumer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions meter/e3dc.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ func (m *E3dc) setBatteryMode(mode api.BatteryMode) error {
e3dcDischargeBatteryLimit(false, 0),
e3dcBatteryCharge(50000), // max. 50kWh
}
case api.BatteryNoCharge:
messages = []rscp.Message{
e3dcDischargeBatteryLimit(false, 0),
e3dcBatteryCharge(0),
}
default:
return api.ErrNotAvailable
}
Expand Down
3 changes: 3 additions & 0 deletions meter/usage_battery.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func (m *batterySocLimits) LimitController(socG func() (float64, error), limitSo
case api.BatteryCharge:
return limitSocS(m.MaxSoc)

case api.BatteryNoCharge:
return limitSocS(m.MinSoc)

default:
return api.ErrNotAvailable
}
Expand Down
18 changes: 18 additions & 0 deletions templates/definition/meter/fronius-gen24.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,23 @@ render: |
uri: {{ .host }}:{{ .port }}
id: 1
value: 124:0:OutWRte
- case: 4 # nocharge
set:
source: sequence
set:
- source: const
value: 1
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
id: 1
Comment on lines +251 to +260
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (bug_risk): Align nocharge handling with sunspec inverter control regarding InOutWRte_RvrtTms.

In sunspec-inverter-control.yaml, the nocharge case also sets InOutWRte_RvrtTms to 0s. Here and in fronius-vertoplus.yaml, nocharge only sets StorCtl_Mod and InWRte. If these backends are intended to behave equivalently, consider also setting InOutWRte_RvrtTms here, or confirm that leaving it unset is intentional due to device behavior or defaults.

value: 124:0:StorCtl_Mod
- source: const
value: 0 # %
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
id: 1
value: 124:0:InWRte
{{- include "battery-params" . }}
{{- end }}
4 changes: 4 additions & 0 deletions templates/definition/meter/fronius-solarapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ render: |
body: '{"timeofuse":[]}'
- source: error
error: ErrNotAvailable
- case: 4 # nocharge (not implemented)
set:
source: error
error: ErrNotAvailable
{{- end }}
{{- include "battery-params" . }}
{{- end }}
18 changes: 18 additions & 0 deletions templates/definition/meter/fronius-vertoplus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,23 @@ render: |
uri: {{ .host }}:{{ .port }}
id: 1
value: 124:0:OutWRte
- case: 4 # nocharge
set:
source: sequence
set:
- source: const
value: 1
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
id: 1
value: 124:0:StorCtl_Mod
- source: const
value: 0 # %
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
id: 1
value: 124:0:InWRte
{{- include "battery-params" . }}
{{- end }}
22 changes: 22 additions & 0 deletions templates/definition/meter/sunspec-inverter-control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,27 @@ render: |
source: sunspec
{{- include "modbus" . | indent 10 }}
value: 124:0:InOutWRte_RvrtTms
- case: 4 # nocharge
set:
source: sequence
set:
- source: const
value: 1
set:
source: sunspec
{{- include "modbus" . | indent 10 }}
value: 124:0:StorCtl_Mod
- source: const
value: 0 # %
set:
source: sunspec
{{- include "modbus" . | indent 10 }}
value: 124:0:InWRte
- source: const
value: 0 # s
set:
source: sunspec
{{- include "modbus" . | indent 10 }}
value: 124:0:InOutWRte_RvrtTms
{{- include "battery-params" . }}
{{- end }}
Loading