Skip to content

Commit

Permalink
scheduled charging can also be used for discharge
Browse files Browse the repository at this point in the history
Improve the ESS Scheduled menu to more clearly indicate
when a scheduled operation is active, what SOC is being
targeted, and to provide an option to self-consume
battery energy above the limit.

The use case for this is when a schedule with a lower
SOC limit follows one with a higher limit. The user may
want to self-consume down to the lower level.

victronenergy/venus#970
  • Loading branch information
DanielMcInnes committed Jul 26, 2023
1 parent 2203dc8 commit c947a33
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
32 changes: 14 additions & 18 deletions components/settings/CGwacsBatteryScheduleNavigationItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -146,35 +146,31 @@ ListNavigationItem {
maximumHour: 9999
}

ListSwitch {
id: socLimitEnabled

//% "Stop on SOC"
text: qsTrId("cgwacs_battery_schedule_stop_on_soc")
checked: socLimitSpinBox.value < 100
visible: defaultVisible && itemEnabled.checked

onCheckedChanged: {
if (checked && socLimitSpinBox.value >= 100) {
socLimitSpinBox.dataPoint.setValue(95)
} else if (!checked && socLimitSpinBox.value < 100) {
socLimitSpinBox.dataPoint.setValue(100)
}
}
}

ListSpinBox {
id: socLimitSpinBox

//% "SOC limit"
text: qsTrId("cgwacs_battery_schedule_soc_limit")
visible: defaultVisible && socLimitEnabled.checked
visible: defaultVisible
dataSource: root._scheduleSource + "/Soc"
suffix: "%"
from: 5
to: 95
stepSize: 5
}

ListRadioButtonGroup {
//% "Self-consumption above limit"
text: qsTrId("cgwacs_battery_schedule_self_consumption_above_limit")
dataSource: root._scheduleSource + "/AllowDischarge"
visible: defaultVisible && itemEnabled.checked && socLimit.value < 100
optionModel: [
//% "PV"
{ display: qsTrId("cgwacs_battery_schedule_pv"), value: 0 },
//% "PV & Battery"
{ display: qsTrId("cgwacs_battery_schedule_pv_and_battery"), value: 1 }
]
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion data/mock/SystemSettingsImpl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ QtObject {
setMockSettingValue("CGwacs/BatteryLife/DischargedTime", 0)
setMockSettingValue("CGwacs/BatteryLife/Flags", 0)
setMockSettingValue("CGwacs/BatteryLife/MinimumSocLimit", 10)
setMockSettingValue("CGwacs/BatteryLife/Schedule/Charge/0/AllowDischarge", 1)
setMockSettingValue("CGwacs/BatteryLife/Schedule/Charge/0/Day", -1)
setMockSettingValue("CGwacs/BatteryLife/Schedule/Charge/0/Duration", -1)
setMockSettingValue("CGwacs/BatteryLife/Schedule/Charge/0/Soc", 100)
setMockSettingValue("CGwacs/BatteryLife/Schedule/Charge/0/Soc", 90)
setMockSettingValue("CGwacs/BatteryLife/Schedule/Charge/0/Start", 0)
setMockSettingValue("CGwacs/BatteryLife/SocLimit", 10)
setMockSettingValue("CGwacs/BatteryLife/State", 4)
Expand Down

0 comments on commit c947a33

Please sign in to comment.