feat(optimization): schedule any number of flexible consumers

Replace the single hourly "dishwasher" home appliance with a list of
flexible consumers (home_appliances). Each consumer defines its load
either as an explicit power profile (energy-preservingly resampled onto
the optimization slot grid, incl. 15-min and non-integer interval ratios)
or the flat consumption_wh/duration_h fallback, and runs ONCE or DAILY
within its time windows and the optimization horizon.

- ConsumerScheduleMode + shared load-definition validation (XOR of
  profile/fallback, reject negative/NaN/inf, unique device_id)
- ApplianceGeneLayout: variable appliance gene block (index into
  allowed_start_slots), ONCE/DAILY calendar-day based, no snapping
- per-device output: result.home_appliance_energy_wh, appliance_starts
  (absolute local times), per-device solution columns and DDBC RUN/OFF
  instructions on state transitions only
- deprecate dishwasher/washingstart/Home_appliance_wh_per_hour with
  backward-compatible mapping and explicit conflict rejection
- max_home_appliances is now an upper bound only; no demo appliance and
  no on/off behaviour
- docs, openapi.json, CHANGELOG and optimize_result_2* fixtures updated;
  new tests/test_homeappliance.py covers the mandatory test matrix

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Andreas
2026-07-15 14:19:46 +02:00
co-authored by Claude Opus 4.8
parent c59bf1b486
commit 67cf6f7d8a
21 changed files with 2505 additions and 1094 deletions
+24 -2
View File
@@ -7,6 +7,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased
### Added
- Flexible consumers (home appliances): schedule any number of consumers via
`devices.home_appliances`, each with a unique `device_id`. Every consumer defines its
load **either** as an explicit power profile (`load_profile_power_w` at
`load_profile_interval_seconds`, energy-preservingly resampled onto the optimization
slot grid, including the 15-minute interval and non-integer ratios such as 10→15 min)
**or** as the flat `consumption_wh` + `duration_h` fallback. A `schedule_mode` selects
`ONCE` (a single run in the horizon) or `DAILY` (one run per local calendar day that
still has a feasible full run). Allowed start times honour `time_windows` (including
weekday/date restrictions) and the horizon; ONCE without any valid start is rejected.
Results are reported per device (`result.home_appliance_energy_wh`, `appliance_starts`,
per-device solution columns and `DDBCInstruction`s emitted only on RUN/OFF transitions).
- EV Bug (wrong output in genetic.py / no senseful results)
- Direktvermarktung active / Battery discharge into grid (new state / action battery_grid_export_allowed) + (new simulation output Feed_in_tariff)
- New PV forecast providers giving operators more cloud forecast sources to choose from in
@@ -25,8 +36,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
is distributed across four slots, prices are held constant, and hourly warm-start
solutions are expanded to slot controls. Native slot arrays are preserved and
ambiguous lengths are rejected.
- Home-appliance scheduling remains hourly and is therefore rejected for sub-hourly
optimization instead of being simulated with incorrect slot indices.
- Home-appliance (flexible consumer) scheduling now runs on the same slot grid and
supports the 15-minute interval (see the flexible consumers entry below).
- The Tibber electricity price provider now requests native 15-minute exchange prices
(`priceInfoRange(resolution: QUARTER_HOURLY)`) and stores them at their native
resolution, so both the hourly and the 15-minute optimizer are fed the correct
@@ -45,6 +56,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
missing slots at the end of the optimization horizon are extended with weekly or daily seasonal
ETS forecasts. A median fallback is used when the available history is too short for ETS.
### Changed
- `max_home_appliances` is now purely an upper bound. No demo appliance is created when
no `home_appliances` are configured, and the number is no longer used as an on/off switch.
### Deprecated
- The single-appliance genetic optimization input `dishwasher` is deprecated in favour of
the `home_appliances` list; a lone `dishwasher` is mapped to a one-element list, and
setting both at once is rejected. In the solution, `washingstart` (start slot of a single
hourly appliance) and `result.Home_appliance_wh_per_hour` (aggregate over all appliances)
are deprecated in favour of `appliance_starts` and `result.home_appliance_energy_wh`.
## 0.3.0 (2026-03-17)
Akkudoktor-EOS can now be run as Home Assistant add-on and standalone.