Repository navigation
Appliances and EV
Appliances (dishwasher, washing machine, dryer or any other on/off load) and the electric vehicle (EV) are planned outside the linear program of The planner. Each planning run they are placed on top of the base load per phase (see Solar, base load and phases), in the cheapest quarters that still fit under the per-phase limit. That limit is the grid connection maximum divided by three.
How an appliance is linked and switched (plug, pause/resume, remote start, automation) is described on Consumers. This page covers how the cycle is learned and placed, and how the EV charger is planned.
Once a week (and after a start) ZenMaster learns the cycle from the appliance's power entity:
- Read 10 days of 5-minute mean statistics and average every three into a 15-minute value in kW.
- Split the series into runs: consecutive quarters above 10 W.
- Drop runs shorter than 2 quarters (blips). At least 3 runs are needed, otherwise nothing is learned.
- The cycle length is the median run length. The power of quarter
jis the mean of quarterjover all runs that are longer thanj.
The learned profile replaces the configured duration and is kept across restarts.
Until a profile is learned, the cycle is flat: the power rating times the cycle duration from the expert settings, or, when those are not set, the default for its kind:
| Kind | Default power | Default length |
|---|---|---|
| Dishwasher | 0.9 kW | 7 quarters |
| Washing machine | 0.3 kW | 7 quarters |
| Dryer | 1.6 kW | 7 quarters |
A rise in power counts as a new start only after the appliance has been quiet long enough; pauses inside a cycle must not look like a new start. The same calibration measures the longest silence that still sat inside one cycle (gaps of up to 6 quarters, 90 minutes, join two runs). The quiet time is twice that gap, but at least 45 minutes and at most 90 minutes.
When the appliance offers a duration sensor (device class duration, unit d, h, min or s) for the selected program, that length is used. The profile is stretched or shortened to round(hours x 4) quarters by linear interpolation; its power levels are kept.
| Situation | The cycle must be finished |
|---|---|
| Latest start time set | By that start time plus the cycle length |
| Armed at or after 17:00, or before 08:00 | By 08:00 |
| Armed during the day | Within 4 hours of arming, and never after 17:00 |
flowchart LR
A[Armed cycle profile] --> B[Every start before the deadline]
B --> C{Every quarter under<br/>the phase limit?}
C -- no --> D[Count as ruled out]
C -- yes --> E[Cost = sum of power x buy price]
E --> F[Cheapest window]
F --> G[Add to the phase loads]
For every possible start, from now to the last start that still finishes before the deadline, the window cost is the sum of power x buy price over the cycle. A window where any quarter would push a phase over its limit is skipped; an appliance on all phases puts a third of its power on each. The cheapest remaining window wins and its load is added to the phases, so the next consumer sees it. The explanation shows the average price of the chosen window, the deadline rule and how many cheaper windows a full phase ruled out.
While the cycle runs, its measured energy is booked at the buy price of the quarter it was used in. A cycle ends after 600 s (10 minutes) without power. The saving is then:
saving = cycle kWh x (price of the quarter it was armed in - average price paid)
Positive when the plan moved the cycle to a cheaper moment, negative when it did not.
| Mode | Behaviour |
|---|---|
| Maximum | Full charger power from now on, ignores price and solar |
| Ready by | Reach the departure target before the departure time, whatever the price |
| Price (default) | Charge while it pays, up to the charge compensation price, no deadline |
| Solar | Only the solar surplus, at least 4.2 kW |
| V2H (vehicle to home) | Not built yet; plans like Price |
The mode holds for one session: when the cable is unplugged it goes back to Price.
The energy to charge is (target % - current state of charge) x battery capacity. The target is the departure target (capped by the maximum state of charge) in Ready by, and the maximum state of charge in the other modes. The plan covers the quarters until the departure time, or one day when no departure time is set.
The solar surplus per quarter is the solar forecast minus the planned house load on the three phases, never below zero.
Quarters are filled in time order. Maximum asks for the full charger power, Solar for the solar surplus of that quarter (at most the charger power). In Solar the charger then follows the live surplus: every 30 seconds it gets its last power plus the mean surplus of those 30 seconds, between 4.2 kW and the charger's maximum.
The price cap is the charge compensation (EUR/kWh) in Price, and unlimited in Ready by. For each quarter:
- if the sell price is at or above the cap, the quarter is not used;
- if the buy price is at or below the cap, full charger power;
- otherwise only as much as keeps the blended price at the cap:
solar x (buy - sell) / (buy - cap).
The blended price of a quarter values the solar part at the sell price and the grid part at the buy price:
price = (solar kWh x sell + grid kWh x buy) / total kWh
The quarters are sorted by this price, cheapest first, and filled until the energy is reached.
Every quarter is capped by the phase room: the lowest headroom under the phase limit on the car's phase (times three for a car on all phases), as kWh per quarter. The wallbox cannot charge below 4.2 kW, so a quarter, or a remainder, below 4.2 kW is left out. The explanation marks whether a quarter was cut by a full phase or by the price.
In the code: custom_components/zenmaster/solver/consumers/appliance.py, custom_components/zenmaster/solver/consumers/ev.py, custom_components/zenmaster/solver/solver.py
ZenMaster on GitHub · Releases · Issues · Licensed under GPL-3.0
Getting started
Devices
How it calculates
- The planner
- Battery model
- Real-time control
- House model
- Hot water tank
- Price model
- Solar, base load and phases
- Appliances and EV
- Recorder
More