battery soc daily goal setting#36
Merged
Merged
Conversation
Adds a setting to get the optimizer to get the battery to a minimum soc at a certain time each day if set
There was a problem hiding this comment.
Pull request overview
Adds a new “daily minimum battery SoC goal” feature for the optimizer, configurable via UI, HTTP, and MQTT, and applied during optimizer request construction.
Changes:
- Extends the site API/state/keys to persist and publish an optimizer SoC goal, a daily target time, and a timezone.
- Adds HTTP + MQTT setters and a UI settings section to configure/enable/disable the daily goal.
- Updates optimizer request generation to add an SoC goal constraint at the first slot at/after the configured local time each day (with unit tests).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| server/mqtt.go | Adds MQTT topics to set the SoC goal, target time, and timezone. |
| server/mqtt_setter.go | Introduces a stringSetter helper for MQTT payloads. |
| server/http.go | Registers new site routes for setting/deleting the optimizer SoC goal. |
| server/http_site_handler.go | Adds the JSON POST handler to set soc/time/tz together. |
| i18n/en.json | Adds English UI strings for the new optimizer SoC goal setting. |
| i18n/de.json | Adds German UI strings for the new optimizer SoC goal setting. |
| core/site/api.go | Extends the external site API with goal/time/timezone getters/setters. |
| core/site.go | Persists/restores the new settings and publishes them on startup. |
| core/site_optimizer.go | Applies the new daily SoC goal to optimizer battery requests using forecast timestamps. |
| core/site_optimizer_test.go | Adds unit tests for slot placement and battery request integration. |
| core/site_api.go | Implements storage, validation, publishing, and optimizer-refresh triggers for the new settings. |
| core/keys/site.go | Adds new state keys for goal/time/timezone. |
| assets/js/types/evcc.ts | Extends the frontend State type with the new fields. |
| assets/js/components/Battery/BatteryUsageSettings.vue | Adds UI controls and API calls to manage the setting. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…e applying changes Agent-Logs-Url: https://github.com/jeffborg/evcc/sessions/41d39e27-afb0-4d32-b8df-c521d3801a36 Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jeffborg/evcc/sessions/41d39e27-afb0-4d32-b8df-c521d3801a36 Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
jeffborg
commented
May 6, 2026
| return handler(strconv.ParseBool, set, get) | ||
| } | ||
|
|
||
| func stringHandler(set func(string) error, get func() string) http.HandlerFunc { |
Owner
Author
There was a problem hiding this comment.
@copilot remove unused function see lint comment
Agent-Logs-Url: https://github.com/jeffborg/evcc/sessions/332f3c5b-137d-4434-a5c2-4dabe28b592e Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a setting to get the optimizer to get the battery to a minimum soc at a certain time each day if set