Skip to content

Fix sensor forecast button to send train-start from available history#2187

Merged
nhoening merged 6 commits into
mainfrom
copilot/issue-2186-fix-1
May 20, 2026
Merged

Fix sensor forecast button to send train-start from available history#2187
nhoening merged 6 commits into
mainfrom
copilot/issue-2186-fix-1

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

Comment thread flexmeasures/ui/templates/sensors/index.html Outdated
Co-authored-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
Signed-off-by: Nicolas Höning <iam@nicolashoening.de>
Copy link
Copy Markdown
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

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

I did my test with 3 days data and confirm that this improves the situation a lot. Forecasts still look a bit different on the edges, but the base behavior is forecasted better.

Please add a changelog entry (standard procedure), then this can go into the upcoming release!

Comment thread flexmeasures/ui/templates/sensors/index.html Outdated
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
@BelhsanHmida
Copy link
Copy Markdown
Contributor

Manual test passed.

I compared the sensor page Trigger forecast flow against the equivalent CLI command on 15-minute resolution test data.

The important thing I checked was that the button-triggered job no longer trains on the default 30-day window. The worker logs now show the training window starts from the available history instead:

Training cycle from 2023-01-01 00:15:00+00:00 to 2023-01-04 00:00:00+00:00 started ...
Prediction cycle from 2023-01-04 00:00:00+00:00 to 2023-01-06 00:00:00+00:00 started ...

I then ran the matching CLI forecast with the same train-start, start, and duration. The resulting forecasts are identical, which confirms the button now sends the intended config.train-start and behaves like the CLI path.

Also added a small follow-up fix so train-start is set for users who can trigger forecasts but do not have delete-data permission, plus test coverage for that rendered listener.

@BelhsanHmida BelhsanHmida requested a review from nhoening May 20, 2026 18:43
Signed-off-by: Nicolas Höning <iam@nicolashoening.de>
@nhoening nhoening merged commit bda3bf2 into main May 20, 2026
11 of 12 checks passed
@nhoening nhoening deleted the copilot/issue-2186-fix-1 branch May 20, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forecast button trains on mostly empty 30-day window for sensors with little history

4 participants