Quick Summary (TL;DR)
The best hot-water cylinder schedule is a safety-compliant heating schedule first and an electricity-price optimisation second. A well-insulated storage cylinder can shift some water heating to cheap overnight electricity or daytime solar generation. But a timer must never disable the cylinder’s independent thermostat, high-limit cut-out, pressure protection, manufacturer-prescribed hygiene cycle or other required controls. Home Assistant should supervise a properly installed heating controller, not replace its safety functions.
For a straightforward electric immersion heater, start with a manufacturer-approved immersion diverter or a suitably rated, professionally installed controller. For a heat-pump cylinder, prefer the heat pump’s own domestic-hot-water (DHW) schedule and approved integration; frequent immersion boosts can erase the heat pump’s efficiency advantage. The real optimisation is a measured balance between energy price, available PV export, heat loss, comfort, equipment wear and hot-water hygiene.
This guide explains what to buy, how to measure the benefit, and how to design conservative Home Assistant automation with sensible fallbacks. It is written for UK and European homes, but local electrical, water hygiene and plumbing rules always take precedence.
1. Identify the cylinder and heat source before buying anything
The phrase “smart hot water” hides several very different installations. An electrically heated vented cylinder with an immersion element is not controlled in the same way as an unvented mains-pressure cylinder, a heat-pump DHW tank or an indirect cylinder supplied by a gas boiler. Before discussing tariffs or automation, record the cylinder model, capacity, heat source, element rating, existing timers, thermostat locations, high-limit controls, and any mandatory manufacturer hygiene programme.
| System | Primary heat source | Usually appropriate scheduling method | Key constraint |
|---|---|---|---|
| Direct electric cylinder | Immersion element, commonly a few kilowatts | Approved immersion controller, diverter or existing timer | Correct switching hardware and intact independent safety controls |
| Heat-pump DHW cylinder | Heat pump through coil or heat exchanger | Heat pump’s native DHW schedule or approved API | Compressor operating envelope, anti-legionella cycle, recovery time |
| Indirect gas-boiler cylinder | Boiler and motorised valves | Boiler/programmer schedule or supported control integration | Cylinder thermostat, valve logic and boiler interlocks |
| Hybrid cylinder | Heat pump or boiler plus immersion | Primary system schedule with documented boost priority | Prevent conflicting calls and needless resistance heating |
| Thermal store / specialist system | Varies widely | Manufacturer-supported controls | May have different potable-water and temperature architecture |
A temperature sensorAliExpress price strapped to a pipe is useful for trends, but it is not automatically a reliable measure of stored potable-water temperature. Likewise, a smart plugAliExpress price showing the immersion’s electricity use is not evidence that the water has reached a required hygiene temperature throughout the cylinder. Keep the monitoring and safety roles separate.
2. Understand the four control layers
A robust design separates safety, plant operation, optimisation and reporting. Problems arise when a convenient automation platform is asked to perform a safety-critical job that belongs to dedicated equipment.
| Layer | Responsibility | Examples | What happens if Home Assistant stops |
|---|---|---|---|
| Independent safety | Over-temperature, pressure and electrical protection | Thermostat, manual-reset high-limit cut-out, relief devices | Must remain functional |
| Plant control | Normal DHW operation and required hygiene cycles | Heat pump controller, boiler programmer, certified immersion control | Continues in its documented fallback mode |
| Optimisation | Choose permitted times and targets | Home Assistant, tariff feed, solar export signal | Reverts to safe baseline schedule |
| Monitoring | Record temperatures, power and costs | Energy meterAliExpress price, cylinder sensors, dashboards | No effect on essential heating |
An ordinary ESP32 relay board is not an acceptable direct mains immersion switching solution. Immersion loads can draw sustained current for hours, and an apparently adequate relay contact rating is not the same as a complete compliant installation. If Home Assistant is to issue a demand signal, use an installer-selected, electrically isolated interface into a manufacturer-supported controller, with appropriately rated switching, protective devices and enclosure.
3. How much energy does a cylinder actually store?
The approximate sensible heat stored in water is E (kWh) ≈ volume (litres) × 0.001163 × temperature rise (°C). This is useful for estimating charging time and cost, but it is not a guarantee of usable hot water: stratification, mixing, incoming mains temperature, pipe losses and draw-off behaviour all matter.
| Illustrative cylinder | Temperature rise | Calculated thermal energy | Ideal heating time with 3 kW immersion |
|---|---|---|---|
| 150 litres | 35°C | 6.11 kWh | 2.04 hours |
| 180 litres | 35°C | 7.33 kWh | 2.44 hours |
| 210 litres | 35°C | 8.55 kWh | 2.85 hours |
| 250 litres | 35°C | 10.18 kWh | 3.39 hours |
These figures assume the entire volume is heated uniformly and ignore losses. In real systems the top of a stratified cylinder can become usable earlier, while the bottom may remain cooler. A 3 kW immersion is an electrical input figure; the delivered energy during a period is approximately input power multiplied by runtime, subject to controls and losses. Do not use this equation to infer that a partial top-of-cylinder reading proves a whole-tank hygiene cycle.
4. Solar surplus: diversion versus fixed on/off control
A solar PV installation may export power in the middle of the day. Heating water can capture some of that otherwise-exported energy, but the value depends on the export tariff, import price and whether the cylinder can accept more heat. There are two broad control approaches.
| Approach | How it works | Advantages | Limitations |
|---|---|---|---|
| Proportional immersion diverter | Continuously or incrementally modulates permitted power to immersion | Can use smaller, variable PV surplus | Requires a compatible, purpose-built controller and metering |
| On/off immersion control | Enables a full-rated element when conditions allow | Simpler supervisory logic | May import substantial power whenever PV surplus is below element rating |
| Heat pump DHW boost | Requests a DHW cycle from native controller | Potentially more heat per electrical kWh | Minimum runtime, recovery, outdoor conditions and compressor limits matter |
| Fixed daytime schedule | Runs in a chosen daylight window | Predictable and resilient | May miss cloudy periods or coincide with expensive imports |
For example, a home exporting 1.2 kW cannot continuously run a 3 kW immersion without importing roughly the difference, unless an approved diverter is modulating the element. A simplistic “export is positive, turn immersion on” rule is therefore a common false economy. Even a correctly designed proportional diverter must honour the cylinder’s thermostat and over-temperature protection.
Home Assistant can observe export and consumption, but the dedicated diverter should own the rapid power-control loop. For the wider design of diverting solar surplus into flexible loads, see our solar surplus automation guide.
5. Time-of-use tariffs: compare the opportunity cost
Cheap overnight imports can be attractive, but the right comparison is not simply “night price versus day price”. If a kilowatt-hour of PV could have been exported for payment, consuming it in a cylinder forfeits that export income. If a heat pump could heat the same water at a higher COP, resistance heating may also cost more despite using free-looking solar energy.
| Illustrative energy source | Assumed unit value | 6 kWh electrical input | Interpretation |
|---|---|---|---|
| Off-peak import | £0.10/kWh | £0.60 | Illustrative low-price charging |
| Peak import | £0.30/kWh | £1.80 | Avoid where practical |
| PV used instead of export | £0.15/kWh export foregone | £0.90 opportunity cost | Solar self-use is not economically free |
| PV with zero export value | £0.00/kWh | £0.00 marginal export value | Still account for equipment limits and alternatives |
These are hypothetical prices, not live tariff quotes. Use your actual import and export contracts, standing charges where relevant, meter intervals and tax treatment. For a heat pump, compare cost per kWh of delivered heat, approximately electricity price divided by measured or defensibly estimated COP. An off-peak heat-pump run at COP 2.5 can deliver more heat per purchased kilowatt-hour than a direct immersion heater, but hot-water COP varies with cylinder target temperature and operating conditions.
6. Build a defensible scheduling objective
A practical optimiser should aim to satisfy hot-water demand by a deadline at minimum expected net cost, subject to comfort, hygiene, equipment and power constraints. This is a constrained scheduling problem, not an instruction to heat whenever the current tariff is cheap.
- Maintain a baseline schedule that ensures essential hot-water availability without Home Assistant.
- Treat manufacturer hygiene and pasteurisation requirements as non-negotiable constraints, not discretionary price events.
- Respect minimum compressor run and rest times, maximum DHW target, and immersion element operating limits.
- Use a forecast only for optional shifting; fall back to a known schedule if price or PV data are missing.
- Avoid repeatedly reheating the whole cylinder to an unnecessarily high target just to capture every short PV peak.
- Allow a user override that requests a normal, manufacturer-supported boost without bypassing protective controls.
One useful approach is to reserve a guaranteed heating window before the morning demand period, then allow a daytime PV top-up if the native controller reports adequate remaining capacity. A more ambitious system can select the cheapest available tariff intervals, but only when the heating device explicitly supports interrupted operation or schedules. Heat-pump DHW cycles often benefit from longer uninterrupted windows.
7. Example schedules for three household situations
| Household | Baseline schedule | Optional optimisation | Avoid |
|---|---|---|---|
| Direct immersion, cheap night tariff | Existing programmer heats before morning use | Use approved diverter for afternoon surplus | Unrated smart plugAliExpress price and aggressive rapid cycling |
| Heat pump with DHW cylinder | Native controller runs DHW at suitable daily window | Shift supported DHW request toward cheaper or warmer hours | Disabling mandatory disinfection or forcing frequent immersion boosts |
| Solar PV with export payment | Schedule minimum required hot water | Compare PV export value with later off-peak import | Assuming self-consumption is always more profitable |
For a 180-litre cylinder and a 3 kW immersion, a nominal 35°C whole-cylinder rise takes about 2.44 hours before losses. If a household needs hot water at 07:00, a roughly three-hour pre-use window may be a starting calculation, not a universal schedule. Actual run time depends on the cylinder’s state at the beginning, immersion position, thermostat setting and draw-offs. Observe real energy use for at least a week before tightening any schedule.
8. Temperature monitoring: where to measure and what it means
The ideal source is the cylinder manufacturer’s supported sensor or controller telemetry. An external surface probe can provide useful comparative trends when securely attached to a representative metal pocket or pipe and insulated from room air. It should not be substituted for a certified thermostat or used alone to assert potable-water safety.
| Measurement | What it can tell you | What it cannot prove |
|---|---|---|
| Cylinder upper sensor | Availability of a warm top layer | Temperature at the bottom of the cylinder |
| Cylinder lower sensor | Lower-zone heating progress | Temperature of every part of pipework |
| Immersion electrical energy | Energy consumed by the element | Actual stored heat without loss assumptions |
| Heat-pump DHW mode | Controller requests and cycle duration | Actual thermal output unless measured |
| Grid import/export | Economic context for switching | Cylinder safety or hygiene compliance |
For additional measurement details, see our flow and return temperature sensor guide and heat-pump COP measurement guide. Surface-mounted sensors have thermal lag, mounting errors and insulation sensitivity; do not confuse their readings with calibrated immersion probes.
9. A safe Home Assistant supervisory architecture
The preferred architecture is tariff/PV inputs → Home Assistant optimisation → approved controller command → existing cylinder thermostat and safety devices → heater. Home Assistant may request an allowed schedule or boost, while the certified plant controller decides whether and how to energise equipment. Where the appliance offers a documented local API, Modbus register or OpenTherm-compatible interface, use the supported control path and preserve its built-in logic.
A simple dashboard can show: cylinder upper and lower temperatures if available; heater electrical power; total daily heater energy; heat-pump DHW state; grid import/export; today’s tariff; next planned heating window; and whether the controller is in normal, boost, hygiene or fault mode. Label sensors clearly so “hot-water temperature” does not imply a level of precision or safety assurance that the hardware cannot provide.
Illustrative Home Assistant template: cost estimate
The following is a monitoring-only example. It estimates cost from an energy sensor and a current tariff, but does not switch a heater. Because it multiplies total cumulative energy by the current price, it is suitable only for a rough snapshot when the price has been constant; for variable tariffs, integrate consumption over each actual price interval instead.
template:
- sensor:
- name: "DHW estimated energy at current price"
unit_of_measurement: "GBP"
state: >
{% set kwh = states('sensor.dhw_heater_energy_kwh') | float(0) %}
{% set price = states('sensor.electricity_price_gbp_kwh') | float(0) %}
{{ (kwh * price) | round(2) }}
For accurate historical costing, use interval-specific import/export energy and price data, or the appropriate energy/cost integrations. The names above are placeholders: replace them with your real entities and validate units. See our Home Assistant Energy Dashboard guide for correct cumulative energy sensors.
10. Worked example: is solar diversion better than overnight heating?
Consider an electrically heated cylinder needing 5 kWh of additional heat. Assume the home has 5 kWh of otherwise-exportable PV, export is worth 15p/kWh and off-peak electricity costs 10p/kWh. Diverting that PV sacrifices 75p in export revenue; importing 5 kWh overnight costs 50p. On those assumptions, overnight heating is economically 25p better, before heat loss and any control differences. If export payment is zero, PV diversion wins on marginal energy cost. If the cylinder would otherwise require peak imports at 30p/kWh, using solar could be substantially better.
Now change the system to a heat pump with an illustrative DHW COP of 2.5. Delivering 5 kWh of heat might use about 2 kWh of electricity, costing 20p at the same off-peak price. The real answer depends on heat-pump operating conditions, whether resistance boost is triggered and the actual usable thermal storage. The comparison illustrates why a blanket “use all solar in the immersion” rule is not always optimal.
11. Hygiene, legionella and temperature safety
Do not lower stored-water temperatures or suppress disinfection cycles solely to save electricity. Legionella risk depends on system design, storage temperature, circulation, stagnation and users’ vulnerability. The correct regime is specified by applicable local regulations, competent risk assessment and manufacturer instructions. In the UK, HSE guidance for relevant hot/cold water systems commonly refers to storing hot water at 60°C or above and distributing it so it reaches at least 50°C within one minute at outlets (55°C in healthcare settings), but applicability varies by property and system. Scalding protection may require appropriate thermostatic mixing valves. Do not treat one sensor reading or one weekly timer as proof of safety.
For domestic heat-pump systems, the manufacturer may specify a periodic higher-temperature disinfection cycle, sometimes using an immersion heater. Keep that native function active and follow the installation manual. Do not override protective thermostats or pressure devices. An unvented cylinder and its safety discharge arrangements require suitably qualified installation and maintenance under local rules.
12. Failure modes and commissioning checks
| Symptom | Likely explanation | Practical check |
|---|---|---|
| Immersion imports at midday despite solar export | On/off heater exceeds instantaneous surplus | Compare export immediately before and after switching; use approved modulation if supported |
| No hot water after internet outage | Cloud-only scheduling or missing fallback | Verify appliance’s local default schedule and manual override |
| Frequent short DHW calls | Competing timers or overly reactive automation | Identify the single authoritative controller and apply minimum cycle rules |
| Unexpectedly high electric use | Immersion boost running instead of heat pump | Check controller state and dedicated power measurements |
| Cylinder temperature rises slowly | Sensor location, draw-off, element position or losses | Compare readings against native controller and real consumption |
| High overnight cost despite cheap tariff | Heating too early, standby losses, inaccurate tariff data | Check actual interval prices and heat loss |
| PV forecast promises energy that never arrives | Cloud cover and forecast uncertainty | Use forecast only for optional shifts; retain guaranteed baseline |
Commission the system with Home Assistant disconnected, then reconnect it. Verify normal thermostat cut-off, existing controls, manual boost, power-loss recovery and safe default schedules using the manufacturer’s procedures. Do not deliberately defeat a safety cut-out to test automation. Record firmware versions, controller ownership, sensor calibration assumptions and all changes made to the original heating schedule.
13. Buying checklist: controller, metering and sensors
- Compatible controller: choose the exact cylinder or heat-pump model’s approved control interface; confirm local operation and offline behaviour.
- Immersion diverter: check element compatibility, metering arrangement, installation requirements, supported supply type and any interaction with export limiting.
- Electricity meterAliExpress price: use a properly rated and installed meter that distinguishes heater consumption from total household demand.
- Temperature sensors: prefer supported immersion pockets or manufacturer telemetry; treat clamp-on sensors as supplementary measurements.
- Network integration: prefer documented local APIs or native integration, and ensure a safe manual fallback.
- Professional installation: budget for protective devices, appropriate switching, enclosure, wiring, commissioning and relevant plumbing certification.
Do not assume a generic Zigbee relay, Wi-Fi smart plug or hobbyist ESP32 PCB is suitable for an immersion heater simply because its marketing claims a high current rating. Installation safety depends on the complete system, including continuous load, cable termination, contactor coordination, enclosure, earthing and over-temperature protection.
14. Frequently asked questions
Can Home Assistant directly switch a 3 kW immersion heater?
Home Assistant can send a command, but a qualified installer should select and install a suitable certified controller and switching arrangement. Do not use an ordinary hobby relay or unrated smart plug as the power switching device.
Is heating water with solar PV always cheaper?
No. Export payments and cheap off-peak import can make exporting PV and heating later more profitable. Compare the actual marginal values.
Can I turn off the heat pump’s anti-legionella cycle?
Do not disable manufacturer-required hygiene or disinfection programmes to optimise cost. Follow the manufacturer and applicable local guidance.
Is a 60°C cylinder target always necessary?
Temperature requirements depend on system design, local rules and risk assessment. Follow applicable guidance and manufacturer instructions rather than using a universal automation target.
Does a temperature sensor on the pipe measure cylinder storage temperature?
Not reliably. Pipe readings are influenced by flow, thermal coupling and ambient temperature. They are useful for trends but cannot verify whole-cylinder temperature.
Should a heat pump use solar immersion diversion?
Often the heat pump can deliver more heat per kWh of electricity than a resistance immersion. Compare actual COP, operating limits, export value and native scheduling before choosing.
Can a cylinder be heated only once per day?
Some households and cylinders can meet demand with one suitable heating window, but required hygiene, draw-off patterns, capacity and recovery must be checked. Do not assume one schedule fits all.
What happens when the internet is down?
The essential hot-water schedule and protective controls should continue locally. Test this explicitly before relying on Home Assistant.
How do I estimate cylinder charging time?
Use E ≈ litres × 0.001163 × temperature rise, then divide by heating power. Allow for stratification, losses and the fact that heating may stop before the whole cylinder reaches a uniform temperature.
Can I combine a cheap night tariff with daytime solar?
Yes. Use a guaranteed baseline heating window and allow only compatible, safe optional top-ups from solar surplus. Avoid conflicting controllers.
Does a CT clamp tell me immersion consumption?
Only if it measures the correct dedicated circuit and is correctly installed and calibrated. A whole-house CT cannot by itself isolate immersion consumption.
Can I use forecast PV to skip overnight heating?
Only with a proven fallback that still guarantees necessary hot water and all mandatory hygiene cycles. Forecasts are uncertain and should not be the sole source of heat availability.
15. Core recommendation
For direct-electric cylinders, buy a purpose-built, appropriately installed immersion controller or proportional PV diverter, keep independent temperature and safety protection intact, and use Home Assistant for monitoring and modest schedule optimisation. For heat-pump cylinders, use the heat pump’s own DHW logic as the authority, optimise only supported schedule windows and measure immersion use separately. For indirect boiler cylinders, respect the original valve, thermostat and boiler interlocks. In all cases, establish a reliable baseline first, then measure savings against the true import and export prices.
For further analysis of heating-system telemetry, see our heat-pump COP measurement guide and Home Assistant energy metering guide. Both help establish useful baselines before optimisation.
16. Map the actual cylinder, not just the label on its jacket
Before buying a smart timer, establish what the existing cylinder does in a normal day. A 200-litre cylinder may contain two immersion elements, or it may be primarily heated through an indirect coil with a separate boost element. In a heat-pump installation, the same cylinder can have a coil, an immersion backup, one or two temperature probes, a three-way diverter valve and a manufacturer-specific legionella programme. The number of electrical terminals is not the number of controllable heating modes. An external timer installed on the wrong circuit can accidentally remove the manufacturer’s protections or interrupt a heat-pump priority cycle.
Record the model and capacity, immersion wattage(s), the actual heating method for domestic hot water, thermostat position, whether any mixing valve is installed, the location of approved sensor pockets, and who currently issues the heat-demand command. An unvented cylinder also has essential pressure and temperature protections. In the UK, installation and servicing requirements are specific to unvented hot-water systems and competent installers; do not treat these parts as ordinary DIY accessories.
| Question at survey | What to look for | Why scheduling depends on it |
|---|---|---|
| How is water heated? | Direct immersion, boiler coil, heat-pump coil or combined | The efficiency and control interface differ |
| How many elements? | Upper boost, lower element, dual immersion | Element position changes the amount and speed of usable heat |
| Which thermostat is authoritative? | Cylinder stat, boiler control or heat-pump tank probe | Schedule commands must not bypass the real temperature limit |
| What output feeds the taps? | Unmixed outlet or thermostatic mixing valve | Stored temperature is not the same as delivered tap temperature |
| What happens on loss of power or network? | Programme retention, offline schedule, alarms | A smart controller must fail to a predictable state |
| What is monitored? | Cylinder temperature, electrical kWh, heat-pump status | Without feedback, claimed savings are merely estimates |
For a retrofit, photograph the cylinder label and accessible controls, then ask the installer to annotate the heating and safety circuits. That documented inventory is far more valuable than purchasing a generic DIN-rail Wi-Fi relay and hoping it can substitute for the programmer.
17. Usable hot water: stratification, mixing and realistic draw-off
The energy equation in section 3 treats water as if it were a uniform tank at one temperature. Real cylinders are often stratified: hotter water accumulates above colder incoming water. During a shower the bottom of the cylinder can be much cooler than the top. One temperature sensor at the top may therefore report “ready” while the stored energy is limited; a sensor near the bottom may report “cold” when enough usable water remains for a short shower.
A useful first estimate for the ideal amount of mixed water is: Vmixed ≈ Vhot × (Thot − Tcold) / (Tuse − Tcold). For example, 150 litres at 55°C mixed with 10°C inlet water to a theoretical 40°C gives 150 × 45 / 30 = 225 litres. This is an energy-balance upper bound only: draw-off mixing, falling cylinder temperature, heat loss, pipework and delivery-temperature constraints reduce real-world performance. The formula is not a recommendation to store below the temperature required by a site-specific hygiene regime.
| Nominal condition | Energy above 10°C cold feed | Ideal 40°C mixed-water equivalent |
|---|---|---|
| 150 L at 50°C | 6.98 kWh | 200 L |
| 150 L at 55°C | 7.85 kWh | 225 L |
| 200 L at 55°C | 10.47 kWh | 300 L |
| 200 L at 60°C | 11.63 kWh | 333 L |
All figures are simplified and assume a uniformly heated cylinder. For sizing, use the cylinder manufacturer’s published V40, draw-off profile or tested usable-volume metric where provided, not this optimistic table. Account for a household’s largest overlapping draw: two back-to-back showers may matter more than average daily litres. Heat-pump cylinders can recover more slowly than gas-boiler cylinders, and an upper immersion may provide a faster but less energy-efficient emergency boost.
18. How much does standing heat loss change the best schedule?
Moving heat into an earlier low-price window can save money, but it also holds the cylinder hot for longer. Heat losses rise when the cylinder is warmer than its surroundings. Modern insulated cylinders may have relatively low standing losses, yet they are not zero. The specification often quotes a standing-loss figure under prescribed test conditions; it is not necessarily your exact daily consumption.
Suppose a cylinder is specified at an illustrative 1.4 kWh per 24 hours under a particular test condition. Over six hours, a flat-rate approximation is 1.4 × 6 / 24 = 0.35 kWh. If the cylinder is heated to a high temperature six hours earlier than necessary, the incremental energy loss is smaller than or equal to a naïve full-period allocation in many cases, because the cylinder would not otherwise be at zero temperature. To estimate it properly, compare temperature profiles and charging energy over repeated similar days. An immersion at 10 p/kWh would make 0.35 kWh worth 3.5p, but that should not be presented as the exact penalty for an early heat-up.
Higher stored temperatures also reduce the relative efficiency of many heat pumps, because the compressor must work against a larger temperature lift. An apparently cheap off-peak electricity slot can be less attractive if reaching the desired temperature needs an inefficient immersion boost or forces the heat pump away from its normal operating envelope. Use the heat pump manufacturer’s specified hot-water controls and temperature limits.
| Scheduling choice | Possible advantage | Cost or limitation to check |
|---|---|---|
| Heat immediately before morning use | Less time at high stored temperature | Could miss the cheapest tariff period |
| Heat during cheap overnight window | Lower import unit cost | Longer storage period; may need morning top-up |
| Heat during midday PV generation | Uses on-site generation | Forfeits export income; generation is weather-dependent |
| Use heat-pump DHW window | Can preserve compressor efficiency | Occupies compressor time needed for space heating |
| Use emergency immersion boost | Fast recovery from low temperature | Resistance heating typically uses more electricity per delivered kWh |
Do not chase sub-penny theoretical savings at the expense of hot-water availability. A simple schedule that reliably delivers water by the first shower often outperforms a clever optimisation that repeatedly triggers unplanned full-price boost cycles.
19. Estimate the true marginal cost of each source of heat
One kilowatt-hour of electricity is not necessarily one kilowatt-hour of hot water heat when the source is a heat pump. An immersion heater converts almost all its consumed electrical energy to heat at the element, whereas a heat pump delivers heat using an input-dependent coefficient of performance (COP). The practical comparison is effective electricity price ÷ delivered heat per input kWh, with adjustments for relevant standing heat losses and whether the meter includes pumps, backup heaters and controls.
Take a worked example with completely illustrative tariffs: grid import at 12 p/kWh overnight, solar export at 15 p/kWh midday, and daytime import at 28 p/kWh. A 3 kW immersion consuming 6 kWh costs 72p on the night rate, or effectively forfeits 90p of export revenue if it uses 6 kWh of otherwise-exportable midday PV. A heat pump delivering 6 kWh of heat at a measured DHW COP of 2.5 would need around 2.4 kWh of electricity. At 28 p/kWh that is 67.2p before system-specific extras; at 12 p/kWh it is 28.8p. Both cases depend on whether the heat pump can achieve that COP at the temperature and time of operation.
| Heat production route | Example electricity or opportunity price | Assumed delivered heat per input kWh | Effective cost per kWh of heat |
|---|---|---|---|
| Immersion on overnight import | 12 p/kWh | Approximately 1.0 | About 12 p |
| Immersion on otherwise-exportable PV | 15 p/kWh foregone export | Approximately 1.0 | About 15 p |
| Heat pump using daytime import | 28 p/kWh | COP 2.5 | About 11.2 p |
| Heat pump on overnight import | 12 p/kWh | COP 2.5 | About 4.8 p |
| Heat pump at poorer high-temperature COP | 28 p/kWh | COP 1.7 | About 16.5 p |
This is the key reason “free solar hot water” can be misleading. PV has an opportunity value, and a heat pump can sometimes make cheaper heat from purchased power than an immersion can make from PV. Equally, a home receiving little or no export payment may sensibly choose a solar diverter when the cylinder has spare capacity and an approved immersion control path. The optimum is contract-specific, not a universal rule.
20. Understand the export payment before enabling PV diversion
There are at least four materially different cases: no export payment, a fixed export credit for metered export, export credited by time of day, and a contract with rules or restrictions specific to the installation. The marginal cost of using a kilowatt-hour of solar on-site is normally the export payment forgone if the energy would otherwise have been exported, not zero. If export metering is absent or export is limited by the inverter, the analysis changes. Storage batteries add another competing destination for the same generation.
The meter must identify the direction of energy flow at the grid connection, not infer solar surplus from PV output alone. If PV generates 4 kW while the house uses 1.5 kW, the immediate surplus is about 2.5 kW before battery charging and meter errors. An on/off 3 kW immersion switched fully on would then import roughly 0.5 kW, even though the roof is generating strongly. A suitable proportional diverter can vary its electrical consumption to match surplus, subject to device design, compatibility and installer commissioning. These figures assume a simple single-phase power balance; three-phase systems require appropriate phase-aware measurement.
| Meter observation | Plausible interpretation | Action for the scheduler |
|---|---|---|
| Export is positive and stable | There may be dispatchable excess energy | Offer surplus to an approved diverter |
| Import begins just after immersion starts | On/off load exceeded the actual surplus | Reduce or stop discretionary demand through its supported controller |
| Battery is charging and grid export is low | Solar is being allocated to storage | Apply owner-defined battery versus hot-water priority |
| Solar estimate high but export meter unavailable | Generation is not a reliable export proxy | Use conservative default; avoid discretionary boost |
| Export payment exceeds cheap import rate | PV diversion may be economically inferior | Compare full marginal economics first |
Avoid taking an energy-dashboard snapshot and treating it as a control system. For real-time diversion, the supported immersion diverter should close the control loop itself. Home Assistant can set an approved operating mode, record energy and calculate the resulting benefit.
21. A practical priority order for a house with PV, battery and EV charging
Solar-diversion projects often fail when several devices independently claim the same “available” power. A battery inverter may attempt to charge at 2 kW, an EV charger may respond to the same grid meter, and a hot-water immersion diverter may increase output at the same instant. Delays, CT calibration differences and device minimum-power thresholds can cause oscillation between importing and exporting. Prefer a clear ownership model where each controller has defined priorities and its own manufacturer-supported electrical protections.
- First: keep grid connection limits, protective controls, battery inverter protections, cylinder safety and heater limits outside Home Assistant’s override authority.
- Second: ensure hot-water hygiene and the next essential draw-off are guaranteed by the original heating system.
- Third: follow user preferences for reserve battery state of charge and EV departure deadlines, with compatible controllers managing electrical limits.
- Fourth: offer residual PV export to flexible hot-water heating only when the cylinder can safely accept additional heat.
- Fifth: perform economic optimisation with accurate import and export prices, measured load and realistic controller response times.
There is no universal ranking that always places the battery before hot water or vice versa. If the EV must leave with a specific charge and the cylinder is already warm, EV charging may have priority; if the household needs hot water imminently, the cylinder may win. Separate service requirements from discretionary energy arbitrage. When a cloud tariff feed vanishes, the household should still get showers and safe heat without assuming that all appliances must charge immediately.
22. Heat-pump hot water has different constraints from immersion-only storage
A heat pump commonly uses a diverter valve to prioritise domestic hot water over space heating. The DHW mode may command a different compressor operating point and flow temperature, and recovery time varies by cylinder coil, outdoor conditions, water draw-off and permitted setpoint. Sending rapid, repeated requests from Home Assistant can increase cycling or disrupt space heating; it is better to issue the manufacturer-supported schedule or permitted target within sensible bounds.
Many heat-pump systems also run a periodic high-temperature hygiene cycle, sometimes with supplementary electric heating because the compressor cannot attain the specified storage temperature. That cycle is not a discretionary cost-saving feature. Do not suppress it, falsify the stored-water probe or force compressor-only operation to defeat the manufacturer’s intended protections. In a shared or commercially managed building, local legal duties and risk-assessment requirements can be more stringent than those for an ordinary owner-occupied home.
A useful comparison is a four-hour low-price slot that overlaps space-heating demand in cold weather versus a slightly more expensive window in mild daylight conditions. If DHW interrupts the space-heating compressor and later requires an aggressive catch-up, the “cheap” timing may be less efficient operationally. Conversely, a supported native optimiser can already account for these interactions. For example, some heat-pump suppliers offer ready-by hot-water scheduling; consult the exact controller and tariff requirements rather than assuming generic Home Assistant control is superior.
| Heat-pump telemetry | What it establishes | What it does not prove |
|---|---|---|
| DHW active status | Controller is requesting or servicing DHW | Useful hot water at every outlet |
| Cylinder probe temperature | Temperature at one specified probe location | Uniform temperature or complete hygiene treatment |
| Compressor electrical power | Electrical input at that metering boundary | Heat delivered to the cylinder |
| Immersion relay state | Boost requested or engaged | Exact energy consumed without a suitable meter |
| Compressor flow temperature | Heating-water temperature | Stored potable-water temperature |
| Reported COP | Performance by vendor-defined scope | Certified DHW seasonal performance if boundaries differ |
For heat-pump metering and COP, refer to the site’s heat-pump COP measurement guide. Use the cylinder manufacturer’s documentation for the distinction between the primary heating circuit and the potable hot-water store.
23. Three detailed scheduling case studies
Case A: 180-litre direct-electric cylinder, fixed overnight tariff
Assume a household typically needs 4.5 kWh of element input to restore hot-water energy after daily use. Electricity costs an illustrative 11 p/kWh from 00:30 to 04:30 and 29 p/kWh otherwise. The theoretical commodity saving from moving all 4.5 kWh is 4.5 × (29 − 11) p = 81p per day, or about £296 in a full year at the same utilisation and contract. That is a theoretical ceiling: standing losses, weekends away, imperfect scheduling and changing tariffs reduce or change the realised saving. It does not justify lowering water-hygiene protection or losing heat after a power cut.
At 3 kW, the ideal element on-time is 4.5 / 3 = 1.5 hours before thermostat cycling and losses. Set a native approved timer to complete before the morning demand rather than switching the entire house through an automation. Home Assistant can measure circuit kWh and alert when off-peak heating unexpectedly fails.
Case B: PV generation, export credit and a proportional diverter
Assume the installation exports an average 3 kWh of genuine surplus during suitable afternoons and the certified diverter can safely feed a cylinder with spare capacity. If the export payment is 8 p/kWh and the otherwise-needed import rate is 27 p/kWh, using 3 kWh for immersion saves 81p of avoided import but sacrifices 24p of export income: the theoretical benefit is 57p per day on those days, before heat loss and any control overhead. At an export credit of 30 p/kWh, the same diversion would be an economic loss compared with exporting and importing later at 27 p/kWh. There is no “free electricity” assumption here.
The site should verify direction of import/export with a certified meter; PV inverter output alone is inadequate. Where a battery exists, measure whether the diverter reduces beneficial charging. If the system’s own diverter has competent priority controls, Home Assistant should only monitor and optionally provide a supported operating-mode request.
Case C: heat-pump cylinder, dual-rate electricity and morning showers
Assume 6 kWh of thermal hot-water demand and an achievable average hot-water COP of 2.4. Input is around 2.5 kWh, not 6 kWh. At 13 p/kWh overnight, the electricity commodity cost is about 32.5p. A resistance immersion making the same 6 kWh at 13 p/kWh costs about 78p. If the heat pump cannot finish by the morning deadline or has a scheduled hygiene boost, the calculation must include those extra inputs and the effect on space heating. The appropriate optimisation target is delivered hot-water service at minimum system cost, not merely the cheapest half-hour tariff.
| Scenario | Illustrative energy moved | Gross or net commodity result | Important caveat |
|---|---|---|---|
| Direct immersion, night rate | 4.5 kWh/day | Up to 81p/day versus 29p day rate | Only if the same energy would have been bought at full rate |
| PV diverter with 8p export credit | 3 kWh on surplus days | About 57p/day net opportunity benefit | No credit for days without exportable PV |
| PV diverter with 30p export credit | 3 kWh on surplus days | About 9p/day worse than 27p import | Do not assume self-consumption always wins |
| Heat pump at COP 2.4 | 6 kWh delivered heat | About 32.5p at 13p/kWh | COP and complete system metering boundary matter |
24. Design a robust Home Assistant monitoring layer
The safest starting point is an observation-only system. Read the cylinder temperature from an approved interface; measure the immersion circuit with suitable professionally installed metering; import verified grid and export readings; obtain the actual tariff feed; and record the heater controller’s operating state. Then compare at least two normal weeks before changing behaviour. Avoid generic smart plugs for an immersion circuit, particularly where the device is not expressly approved for the continuous resistive load and the existing cylinder protective circuit.
A useful dashboard has four plots: cylinder temperature against time, heater or DHW mode state, grid import/export and PV production, and price plus measured electrical energy. Include a separate marker for any hygiene or installer-maintenance event and visible sensor-unavailable states. Electricity energy for the circuit should come from an integral meter in kWh, not an assumption that every “on” minute draws exactly 3 kW.
Below is a monitoring-only template example, intended for the Home Assistant template: section. Replace all three illustrative entity IDs after checking Developer Tools → States. It estimates hot-water electrical cost at the present tariff; it does not schedule, energise or disable any heating device. Import and export costs should be booked separately for full economic accounting.
template:
- sensor:
- name: "Hot Water Instant Import Cost Rate"
unique_id: hot_water_instant_import_cost_rate
unit_of_measurement: "GBP/h"
state: >-
{% set power = states('sensor.immersion_power_w') | float(none) %}
{% set tariff = states('sensor.current_import_price_gbp_kwh') | float(none) %}
{% if power is not none and tariff is not none and power >= 0 and tariff >= 0 %}
{{ ((power / 1000) * tariff) | round(3) }}
{% else %}
{{ 'unavailable' }}
{% endif %}
availability: >-
{{ is_number(states('sensor.immersion_power_w'))
and is_number(states('sensor.current_import_price_gbp_kwh')) }}
This estimate is most meaningful when the cylinder load is actually met by grid imports at the same instant. If PV or battery power supplies part of the heater, simply multiplying immersion power by retail import price overstates the cash cost. It can still be a useful comparative indicator, but not an invoice-grade cost meter. A fully allocated cost model would distribute measured grid imports, export opportunity cost, battery losses and contract charges across loads.
Use Home Assistant’s Utility Meter integration for daily or monthly kWh buckets; tariff bucket switching must be driven by the actual rate schedule, not assumed to occur automatically. Recorder/history can show trends but should not replace certified billing data. See also correctly mapping grid, solar and battery entities before relying on cost estimates.
25. How to design the scheduler without letting it become a safety system
The automation’s decisions should be permissions or requests, not direct electrical safety control. The existing thermostat and energy source retain absolute authority over the final actuation. For example, a manufacturer-approved heat-pump API may accept “DHW economy mode until 06:30”, and a certified immersion diverter may accept a local “solar priority” mode. Home Assistant should not short temperature-limit circuits, spoof probes or bypass plant time delays to enforce its preferred tariff slot.
Use four modes: normal (manufacturer schedule), price-aware (limited approved window changes), comfort boost (time-limited user request through supported control), and fallback (return to the original native programme). Record the reason for each mode transition. Keep a local manual override that works when the network or Home Assistant is unavailable.
| Situation | Recommended response | What not to do |
|---|---|---|
| Price feed missing or stale | Use approved fixed default schedule | Infer an extremely cheap rate from zero or unavailable |
| Cylinder sensor missing | Defer discretionary boost and keep native heat control | Assume the cylinder is cold and force continuous heating |
| PV meter offline | Stop surplus-driven requests; keep normal programme | Estimate export purely from inverter generation |
| Home Assistant offline | Native timer/controller continues independently | Make HA the only path to essential hot water |
| Unexpectedly prolonged heat request | Use controller-native limits and alert operator | Bypass thermostat or cut-out to satisfy a schedule |
| Hygiene treatment due | Permit manufacturer-required treatment and record it | Skip it because a high tariff is predicted |
| User hot-water priority active | Follow supported comfort mode subject to equipment limits | Guarantee a temperature from a single exterior probe |
The scheduler should enforce a minimum time between discretionary plan changes and avoid retriggering on every small movement in PV output. A proportional immersion diverter should regulate that fast feedback itself. Keep price-aware optimisation at the slower planning layer: evaluate next usable slots and issue a supported schedule request only when it would result in a meaningful benefit.
26. Forecasts can help, but test them against a fixed schedule
A forecast can tell you whether tomorrow is likely to have surplus PV, but it does not tell you with certainty how much energy will actually be available after household loads, battery charging and weather variability. Dynamic electricity prices may also change after publication or include supplier-specific fees and time zones. Forecast-based hot-water scheduling should therefore maintain a deadline and a minimum comfort reserve, then choose the cheapest supported window among those capable of meeting the requirement.
Consider a 5 kWh hot-water top-up needed before 07:00. Tonight’s off-peak electricity is 10p/kWh: a guaranteed 50p input cost with direct immersion. Tomorrow’s forecast suggests 6 kWh of midday PV, but the family uses most hot water in the morning. Waiting for midday fails the service requirement, regardless of forecast accuracy. The appropriate plan is to heat enough for the first use overnight; only discretionary subsequent energy can depend on a solar forecast.
If two consecutive days have different heating needs, do not attribute the lower bill solely to your optimiser. Compare similar temperature, occupancy, solar and hot-water-use conditions; count unexpected boosts; include missed comfort events; and retain the export-value calculation. The goal is a reliable improvement, not the prettiest dashboard.
27. Commissioning and measurement: a four-week acceptance test
For the first week, do not change the programmer. Log actual immersion or heat-pump DHW kWh, prices, PV export, time above the system’s required hygiene control temperatures where supported, sensor availability, and whether users ran out of hot water. The next two weeks should test a single optimisation at a time: low-price scheduling first, then PV diversion or forecast-based shifts. Reserve the final week for failure tests with the installer or knowledgeable system owner.
| Test | Method | Pass condition |
|---|---|---|
| Meter direction | Observe import/export at known stable load and approved measurement point | Correct sign and realistic power |
| Controller handover | Restore local schedule after disabling HA supervisory control | Hot water still available normally |
| Loss of price feed | Temporarily mark price sensor unavailable in a safe test setup | Fallback schedule selected; no uncontrolled boost |
| Loss of cylinder telemetry | Simulate missing sensor without interfering with protective circuits | No false temperature assurance; warning issued |
| Network interruption | Take automation host off the network while native controls stay active | Normal safe heating control retained |
| Hygiene programme | Observe manufacturer-native sequence, not a forced manual bypass | Required cycle not inhibited |
| Electrical power | Compare whole-home/grid readings and permitted circuit metering | No unexpected sustained import or switching |
| Comfort result | Check first planned hot-water demand on multiple days | Required service delivered without unplanned boost |
A simple acceptance summary can report: days monitored, total DHW electricity, estimated effective thermal output where independently available, imported kWh in each tariff, exported kWh, failed or aborted commands, hygiene-programme outcomes and number of occasions when hot water was insufficient. When the monitoring boundary changes, explicitly mark the before/after comparisons as not directly equivalent.
28. Avoid over-selling the return on investment
A £250 diverter is not automatically an excellent investment, nor is it automatically unnecessary. The result depends on professional installation cost, the fraction of available solar surplus that can actually be absorbed, the export rate, the import rate displaced, existing thermal storage capacity and any alternative source of hot water. Once the cylinder is hot, another bright hour of solar production cannot be stored there. That saturation limits annual diverted kWh, particularly in summer.
Suppose an installed system costs an illustrative £450 and captures 750 kWh per year that would otherwise have been exported. If the displaced import electricity averages 26p/kWh and foregone export credit averages 10p/kWh, the gross annual value is 750 × (0.26 − 0.10) = £120, implying a simplistic 3.75-year payback before repairs, changing tariffs, degradation, excess heat loss, finance and any interaction with a heat pump. If only 250 kWh can be diverted under the same rates, the gross annual value falls to £40 and the same simple payback becomes 11.25 years. Both are hypothetical scenarios, not promises or current market quotations.
| Annual genuinely diverted energy | Net marginal value 8p/kWh | Net marginal value 16p/kWh | Net marginal value 24p/kWh |
|---|---|---|---|
| 250 kWh | £20 | £40 | £60 |
| 500 kWh | £40 | £80 | £120 |
| 750 kWh | £60 | £120 | £180 |
| 1,000 kWh | £80 | £160 | £240 |
Use readings from an actual year wherever possible, especially winter versus summer behaviour. If your utility tariff offers a particularly generous night rate, a low-cost programme using the existing hot-water controller may be a better first investment than a new immersion diverter. Measure that baseline before adding hardware.
29. Additional questions that change the buying decision
Should the cylinder always be fully recharged when the cheapest tariff starts?
Not necessarily. The service requirement is enough safe usable water when needed, and the manufacturer’s hygiene regime. Overheating a large cylinder hours before demand can increase standing loss, worsen heat-pump COP and reduce capacity to absorb later PV. A calibrated schedule uses known consumption patterns and approved cylinder controls rather than automatically chasing every low-price slot.
Can an ESP32 replace the immersion thermostat or over-temperature cut-out?
No. An ESP32 is useful for monitoring, integrating supported control interfaces and building dashboards, but it is not a certified substitute for a cylinder’s independent thermal protection or professionally installed electrical control. Do not place hobby relay boards in series with high-current loads or safety circuits as an assumed replacement for approved hardware.
Is a cylinder temperature of 55°C a sufficient legionella policy?
Do not assume that it is. Temperature and treatment requirements depend on the installation, operating regime, site-specific risk, jurisdiction and manufacturer. UK HSE guidance describes storing hot water at 60°C or above and achieving distribution temperatures of at least 50°C within one minute for temperature-controlled systems. Homeowner systems, heat-pump manufacturer strategies and other countries’ rules can differ; follow the applicable guidance and qualified advice rather than applying a blanket “once-weekly boost” rule.
Will moving immersion heating to a cheaper hour always reduce carbon emissions?
No. Lower retail prices may correlate with different generation mixes, but the relationship varies by grid and contract. The lowest bill and lowest marginal carbon impact can be different objectives. Use a reputable local grid carbon-intensity feed if carbon is an explicit goal, and preserve hygiene and user service constraints.
Can a battery be intentionally discharged into an immersion heater?
Technically it may be possible through an inverter system, but that is usually a poor choice unless a tariff/backup calculation supports it. Battery round-trip losses and lost backup reserve mean each stored kWh has a cost. Evaluate the inverter’s approved operating modes and reserve constraints; never force a battery to discharge solely because Home Assistant sees the cylinder as a “flexible load”.
References and further reading
- Home Assistant: Energy management documentation — energy monitoring principles and entities.
- Home Assistant: Utility Meter integration — period-based consumption measurement.
- UK Health and Safety Executive: Legionnaires’ disease — official guidance and risk context.
- UK HSE: Hot and cold water systems — temperature and control guidance.
- Approved Document G: Sanitation, hot water safety and water efficiency — England building guidance.
- Home Assistant: Template integration — monitoring-only template sensor syntax.
- Octopus Energy: heat-pump hot-water ready-by scheduling — supplier-specific example of supported DHW timing.
- HSE HSG274 Part 2 — comprehensive hot- and cold-water risk guidance for dutyholders.
- Home Assistant Template integration — current template sensor reference.