Skip to content
Merged
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
BatteryHoldCharge
)
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.

2 changes: 1 addition & 1 deletion cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
flagCustomCssDescription = "Additional user-defined CSS file for custom styling. No compatibility guarantees."

flagBatteryMode = "battery-mode"
flagBatteryModeDescription = "Set battery mode (normal, hold, charge)"
flagBatteryModeDescription = "Set battery mode (normal, hold, charge, holdcharge)"
flagBatteryModeWait = "battery-mode-wait"
flagBatteryModeWaitDescription = "Wait given duration during which potential watchdogs are active"

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

// BatteryHoldCharge implementable via limit soc
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 @@ -264,5 +264,23 @@ render: |
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:OutWRte
- case: 4 # holdcharge
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 }}
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 # holdcharge (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 @@ -260,5 +260,23 @@ render: |
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:OutWRte
- case: 4 # holdcharge
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 # holdcharge
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