Cheap-hours scheduling
Runs the heavy appliances when your hourly electricity price dips, and tells you why.
Why it exists
Spanish hourly pricing changes every day, and nobody wants to check a tariff chart before running the washing machine. This mod reads tomorrow's prices, plans the dishwasher, washer and water heater into the cheapest windows, and sends one evening summary of what it planned and why.
It was requested by one household and now runs in hundreds. The planner respects quiet hours, minimum spacing between appliances, and a manual override that never argues back.
What it does
- Plans appliance runs into the cheapest tariff windows
- Respects quiet hours and per-appliance constraints
- One evening summary: what runs when, and the price it locked
- Manual override that sticks until you release it
The spec
These acceptance criteria were written with the person who requested the mod, then locked in as its tests. The mod has to pass them on every new release train before it rides along.
- A planned run never starts inside configured quiet hours
- The override runs the appliance immediately and suspends planning until released
- When tariff data is missing, appliances run on their normal schedule and the summary says so
mods/cheap-hours/tests/test_quiet_hours.py
def test_plan_never_enters_quiet_hours():
prices = fixtures.pvpc_day(cheapest_hour=3) # 03:00, inside quiet hours
plan = planner.plan(appliances, prices, quiet=(23, 7))
for run in plan.runs:
assert not run.overlaps(quiet_hours)