Skip to content

battery soc daily goal setting#36

Merged
jeffborg merged 5 commits into
masterfrom
battery_soc_goals
May 6, 2026
Merged

battery soc daily goal setting#36
jeffborg merged 5 commits into
masterfrom
battery_soc_goals

Conversation

@jeffborg

@jeffborg jeffborg commented May 6, 2026

Copy link
Copy Markdown
Owner

Adds a setting to get the optimizer to get the battery to a minimum soc at a certain time each day if set

Adds a setting to get the optimizer to get the battery to a minimum soc at a certain time each day if set

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread server/http_site_handler.go Outdated
Comment thread server/http_site_handler.go
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI and others added 2 commits May 6, 2026 04:47
Comment thread server/http_site_handler.go Outdated
return handler(strconv.ParseBool, set, get)
}

func stringHandler(set func(string) error, get func() string) http.HandlerFunc {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot remove unused function see lint comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removed in commit 231e659.

Agent-Logs-Url: https://github.com/jeffborg/evcc/sessions/332f3c5b-137d-4434-a5c2-4dabe28b592e

Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
@jeffborg jeffborg merged commit 823b97b into master May 6, 2026
6 checks passed
@jeffborg jeffborg deleted the battery_soc_goals branch May 6, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants