Commit ffd3d67
authored
fix(output): apply load_scaling_dynamic and manual_load_adjust to today_remaining (#4511)
* fix(output): apply load_scaling_dynamic and manual_load_adjust to today_remaining (#4496 follow-up)
#4506 fixed today_remaining diverging from the plan's own remaining-load
total by applying the flat load_scaling factor, but missed two other
multipliers step_data_history() (fetch.py) also applies when building the
plan's load_minutes_step: load_scaling_dynamic (per-minute - carries
saving-session/free-electricity-event scaling, and any per-window
override from rates_import_override or the manual API) and
manual_load_adjust (additive, per-minute).
Confirmed via a live report on the same issue: a user with a 2-hour
"power up" (free electricity) event set to load_scaling: 1.5 via the
manual API saw today_remaining still diverge from the plan's own total
even after updating to the #4506 fix, since only the flat 1.05 base
load_scaling was being applied. Replayed their attached debug.yaml
directly - their load_scaling_dynamic dict does carry 1.5 for the 2-hour
window as expected; load_today_comparison() never looked at it. After
this fix, the same replay's plan-vs-sensor ratio drops from a much
larger gap to 1.0076, matching the same small residual seen on the
original #4506 replay.
New tests confirm today_remaining scales with load_scaling_dynamic
(uniformly across the day, mirroring the existing load_scaling test) and
reflects a single manual_load_adjust entry additively. Both confirmed to
fail without this fix and pass with it.
* cspell: rephrase comments to avoid a reporter's GitHub handle
Follow-up to the previous commit - cspell flagged the handle as an
unknown word; reworded rather than adding it to the dictionary.
* fix(fetch): reword days_previous_auto log to not imply it ran this cycle
Raised alongside the #4496 follow-up investigation: the "days_previous_auto
enabled - using weighted-bucket historical load forecast..." log line
fires unconditionally every cycle purely because days_previous_auto
defaults to True, regardless of whether the weighted-bucket forecast is
actually used that cycle. Load ML (or any source that sets
load_forecast_only) takes precedence and skips it entirely -
fetch_sensor_data() already has its own, correctly conditional "Using
weighted-bucket historical load forecast over N days" line that only
logs when the fallback genuinely runs.
Reworded to describe what's enabled/configured, not what happened, so a
Load ML user reading the log isn't misled into thinking both forecast
sources are being blended every cycle when they aren't - confirmed via
code trace, not just the log wording, that no double-application
actually occurs.1 parent 3050004 commit ffd3d67
3 files changed
Lines changed: 132 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2366 | 2366 | | |
2367 | 2367 | | |
2368 | 2368 | | |
2369 | | - | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
2370 | 2379 | | |
2371 | 2380 | | |
2372 | 2381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2588 | 2588 | | |
2589 | 2589 | | |
2590 | 2590 | | |
2591 | | - | |
2592 | | - | |
2593 | | - | |
2594 | | - | |
2595 | | - | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
2596 | 2606 | | |
2597 | | - | |
2598 | | - | |
2599 | | - | |
2600 | | - | |
| 2607 | + | |
2601 | 2608 | | |
2602 | | - | |
2603 | | - | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
2604 | 2619 | | |
2605 | 2620 | | |
2606 | 2621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
313 | 406 | | |
314 | 407 | | |
315 | 408 | | |
| |||
320 | 413 | | |
321 | 414 | | |
322 | 415 | | |
323 | | - | |
| 416 | + | |
| 417 | + | |
324 | 418 | | |
325 | 419 | | |
326 | 420 | | |
327 | 421 | | |
328 | 422 | | |
329 | 423 | | |
330 | 424 | | |
| 425 | + | |
331 | 426 | | |
332 | 427 | | |
0 commit comments