Solar Surplus Automation for Hot Water and Other Flexible Loads

Automate solar surplus for hot water safely: diverter vs relay, Home Assistant thresholds, batteries, import/export metering and real payback.

Quick Summary (TL;DR)

The safest way to use surplus solar electricity for hot water is usually a purpose-built, professionally installed solar diverter. A diverter such as myenergi eddi can proportionally feed a compatible resistive heating element as spare generation rises and falls; a simple on/off relay cannot. Use Home Assistant to prioritise loads, display measured results and coordinate schedules, not to replace the heater’s thermostat, over-temperature protection or electrical safeguards.

For a genuinely deferrable on/off appliance, choose a manufacturer-supported enable input or a suitably engineered contactor arrangement installed by an electrician. Measure net export at the grid connection, add a margin above the load’s actual power, require a sustained surplus, and turn off safely when importing. Where a battery is fitted, decide whether charging the battery or heating water gets priority. Neither forecast output nor solar-generation power alone proves that there is energy available to divert.

The buying decision: diverter, smart control or integrated energy system?

A solar array will often generate electricity when occupants are away and household demand is low. Exporting is not inherently wasteful: if your export tariff pays well, selling that energy may be more valuable than using it in a resistive heater. But where export is poorly compensated and you have a properly sized hot-water cylinder, using otherwise-exported generation can offset purchased heat. The economics depend on the alternative method of heating the water, not just the export meter.

A flexible load is something that can run earlier or later without loss of service. That includes certain immersion heaters, heat-pump water heaters with an approved external command, vehicle charging, preheating and some household appliances. It does not mean an arbitrary device is suitable for frequent interruption. Electric ovens, safety-critical equipment and fixed-cycle appliances should not be toggled just because a CT reports spare watts.

Control approach What it actually does Best fit Key limitation
Proportional solar diverter Varies power to a compatible resistive heater using measured spare electricity Immersion heater and suitable thermal store Requires approved heater, wiring, CT position and safety devices
Certified on/off relay driving approved control equipment Enables one defined load once surplus exceeds its full demand Smaller resistive load, appliance with manufacturer-supported remote start Can consume imported electricity when clouds pass; switching duty matters
Smart heat-pump or cylinder integration Uses vendor-provided demand input, target or schedule Heat pump, heat-pump water heater, thermal storage Model-specific support; do not switch compressor supply on and off
EV charger with solar mode Adjusts charging subject to minimum current and vehicle/EVSE behaviour Plugged-in EV with variable solar output Charging minimum and phases can make low surplus unusable
Battery/inverter energy-management system Coordinates solar, battery reserves, dynamic tariffs and selected loads More complex solar-plus-storage systems Permissions, backup behaviour and vendor compatibility vary

Recommendation: For a conventional immersion heater, price the installed cost of a solar diverter first. For a heat pump, use its documented PV or smart-grid input if available. For other loads, avoid improvised mains switching. Treat Home Assistant as the orchestration layer, not a safety controller.

Start with the right measurement boundary

Three signals appear similar on a dashboard but produce different automation decisions:

  • PV generation: what the panels or solar inverter are producing at a point in time.
  • Grid import/export: the net electricity crossing the property’s utility connection, after the home’s loads and, where applicable, batteries have acted.
  • Household consumption: energy used behind the meter, possibly including charging a battery or running a diverter, depending on sensor placement.

For export-led diversion, a signed or directional grid-power measurement at the point of common connection is usually the most useful feedback. It captures the real situation after the house has used what it needs. Solar output minus one selected circuit’s load is not equivalent to whole-home surplus.

Take a house generating 4.2 kW, with 1.5 kW of normal demand. If its battery is charging at 2.0 kW, the available net export is only about 0.7 kW, not 2.7 kW. A controller starting a 2.0 kW resistive element because it sees 4.2 − 1.5 would pull roughly 1.3 kW from the grid, absent a battery-control response. This is why a CT upstream or downstream of the battery can materially change the decision.

Sensor reading Use in diversion control Common mistake Verification
Grid export power (W) Primary live feedback Sign convention reversed Compare against utility meter and a controlled load
Grid import power (W) Stop or inhibit load Treating import as negative export without confirmation Observe meter when a large appliance starts
Solar production (W) Context, forecast validation and upper bound Assuming every solar watt is spare Compare PV power with grid and household readings
Battery SOC (%) Set an optional reserve or priority Assuming SOC gives present spare power Also monitor charging/discharging power
Tank temperature (°C) Respect heat demand and upper limits Replacing certified thermostat with HA sensor Use approved thermostat and independent safety cut-out
Export energy (kWh) Historical value and tariff calculation Using yesterday’s accumulated energy as live power Use instantaneous W for switching

Home Assistant’s energy documentation distinguishes instantaneous power from accumulated energy. For troubleshooting import/export entities, see our Home Assistant energy dashboard troubleshooting guide for a related, published explanation of meter entities and energy statistics.

Single-phase versus three-phase homes

On three-phase installations, confirm whether the meter reports net three-phase exchange or per-phase flows. A device may import on one phase while the sum across phases indicates export. Utility billing and export rules can use phase aggregation differently by market and meter arrangement. Never assume a positive total export means an electrician can put any high-load device on any phase without assessing cable ratings, load balance, neutral currents and protection.

If a hybrid inverter has its own external meter, a separate Home Assistant meter must not quietly replace the inverter’s approved one or interfere with its communications. Prefer read-only access to existing data, or a standalone measurement approved for the purpose. A netting method and device placement should be documented on the wiring diagram by the installer.

Why a proportional diverter behaves differently from a relay

A conventional immersion element might draw about 2–3 kW when switched on. At 600 W of sustained export, switching on a 3 kW element creates up to 2.4 kW of new demand from somewhere else: the grid, battery or another source. A proportional diverter instead adjusts the energy delivered to a compatible resistive element to follow the spare solar power. It can make use of a much smaller surplus, subject to the product’s operating limit.

For example, myenergi advertises the current eddi with a minimum diversion load of 100 W and a maximum heater load of 3.68 kW. Those are model-specific product specifications, not generic limits of all diverters. Consult the myenergi eddi product information and the appropriate model installation documentation before specifying hardware. The unit and connected circuits still require professional installation and appropriate electrical protection.

Sustained measured spare export 2.0 kW on/off heater, simple relay Compatible proportional diverter Sensible result
150 W Heater off May divert around this level if within operating range Small solar gain is usable only with modulation
600 W Heater off Can divert part of available surplus Avoid importing 1.4 kW for a nominal 2 kW heater
1,250 W Heater off Can follow available surplus Accumulate useful thermal energy without waiting for 2 kW
2,400 W Heater may run if threshold and margin passed Diverts up to available heater capacity Both strategies can work, but relay needs stability
Variable clouds May repeatedly start/stop Tracks within device response limits Modulation is preferable for variable surplus

These are illustrative control outcomes, not measured results for a particular installation. A proprietary diverter may have export margin, response delay, battery priority, CT and phase-netting settings. Follow its documentation and do not attempt to reproduce phase-control electronics with a hobby microcontroller connected directly to mains.

How to choose a safe hot-water route

First identify what produces domestic hot water today. For a gas boiler with a hot-water cylinder and a separate immersion heater, an appropriate diverter may be straightforward. A combi boiler with no suitable cylinder is a different proposition: installing storage solely to absorb export adds plumbing cost, standing losses and maintenance. A heat-pump system requires another calculation entirely: an efficient heat pump can yield several units of heat from one electrical unit under suitable conditions, so switching to resistance heating can be financially and energetically worse even when the electricity is solar-generated.

Resistive cylinder or immersion element

A qualified electrician and heating professional should verify the cylinder’s immersion element, thermostat, thermal cut-out, element rating, cable and protective devices before selecting a diverter or control. The diverter is not permission to bypass or reconfigure any protective thermostat. Where there are two heating elements or an alternative boiler, assess interlocks and precedence. A smart dashboard does not replace a certified temperature regulator.

Heat-pump water heater

Look for a documented PV-ready, SG Ready, demand-response or external enable input, and ask precisely what it does: increases a storage-temperature target, advances a cycle, permits operation, or merely receives a tariff signal. Commands differ by model, firmware and installer settings. Do not use Home Assistant or a generic smart plugAliExpress price to repeatedly remove mains supply from a compressor-driven appliance. Respect minimum compressor off-time, defrost, frost protection and manufacturer’s legionella programmes.

Water hygiene and scalding protection

Heating only when spare solar exists can leave stored water too cool for too long. The UK’s Health and Safety Executive guidance describes storing hot water at at least 60°C as a traditional temperature-control measure, with distribution requirements and consideration of scalding risk. The correct system-specific setting and maintenance regime depend on equipment, occupancy, jurisdiction and risk assessment. Keep the appliance’s approved hygiene cycle, thermostat and thermal safety protection independent of Home Assistant; consider thermostatic mixing as professionally specified. Neither a dashboard graph nor a cloud-based temperature estimate establishes microbiological safety.

Five controls every reliable automation needs

  1. Stable surplus threshold. The surplus must exceed the controlled load’s actual running power plus a buffer, not merely match its nameplate figure at one instant. For a 1.2 kW load, 1.5–1.7 kW sustained export could be a sensible initial engineering experiment, once the installer has verified the circuit.
  2. Hysteresis and hold times. Start above one threshold for several minutes; stop only when conditions have persistently worsened. Avoid cycling a mechanical contactor every cloud transition.
  3. Maximum runtime and operating window. The automatic programme should respect appliance scheduling, family hot-water needs and any maximum operating constraints. A thermal thermostat remains the actual temperature limiter.
  4. Unavailable-data behaviour. If the grid meter, network or controller is unavailable, default to no new discretionary load. The physical electrical protection must remain effective even if Home Assistant crashes.
  5. Battery and tariff priority. Decide explicitly whether the load should run before charging a battery, after a reserve threshold, or only when expected savings exceed export payments and the cost of alternative heating.
Scenario Suggested supervisory response Why
Stable export comfortably above load power Permit the load after a time delay Limits accidental grid import
Brief dip caused by a cloud Wait briefly, within safe appliance limits Reduces contactor wear
Sustained grid import End discretionary programme Prevents uneconomic import
Battery below user’s chosen reserve Defer load where batteries have priority Preserves chosen backup energy
Inverter or meter unavailable Do not initiate a new load; alert; engineered fail-safe stop where supported Missing telemetry is not spare power
Cylinder already satisfied Appliance thermostat or controller keeps heat off Never override thermal protection
Cheap-rate grid window Use explicit economic rule, not ‘solar-only’ logic Sometimes grid heating is cheaper than giving up export

Home Assistant implementation: a supervised on/off example

The following illustrative automation controls an existing, professionally installed low-voltage enable interface exposed as switch.hot_water_enable. It is not a mains wiring guide and is not suitable for direct connection to an immersion element. The certified appliance controls, thermostat and manual isolation remain in place. You must replace the example entities and thresholds after commissioning.

Assume sensor.grid_export_power reports positive watts only when exporting and zero while importing; use a separate sensor.grid_import_power if available. For a 1.2 kW supported on/off load, a starting threshold of 1,600 W for five minutes leaves a nominal 400 W margin. A distinct off rule acts after one minute of sustained import above 150 W. This does not avoid a brief grid import during sudden load changes, nor does it guarantee zero grid use when clouds pass.

# Example only: this switch is a manufacturer-approved enable input,
# not an improvised immersion-heater mains switch.
- alias: Solar surplus - enable hot-water request
  id: solar_surplus_hot_water_enable
  triggers:
    - trigger: numeric_state
      entity_id: sensor.grid_export_power
      above: 1600
      for: '00:05:00'
  conditions:
    - condition: state
      entity_id: switch.hot_water_enable
      state: 'off'
    - condition: time
      after: '09:00:00'
      before: '17:00:00'
    - condition: template
      value_template: >
        {{ has_value('sensor.grid_export_power')
           and has_value('sensor.grid_import_power') }}
  actions:
    - action: switch.turn_on
      target:
        entity_id: switch.hot_water_enable
  mode: single

- alias: Solar surplus - cancel hot-water request
  id: solar_surplus_hot_water_cancel
  triggers:
    - trigger: numeric_state
      entity_id: sensor.grid_import_power
      above: 150
      for: '00:01:00'
    - trigger: state
      entity_id: sensor.grid_export_power
      to: 'unavailable'
    - trigger: state
      entity_id: sensor.grid_import_power
      to: 'unavailable'
    - trigger: time
      at: '17:00:00'
  conditions:
    - condition: state
      entity_id: switch.hot_water_enable
      state: 'on'
  actions:
    - action: switch.turn_off
      target:
        entity_id: switch.hot_water_enable
  mode: single

This is a starting point, not a complete safety system. In a production configuration add a local watchdog or approved fail-off mechanism, minimum-on/minimum-off policy suitable for the device, load maximum run-time, circuit protection, restoration behaviour, tank demand checks and any battery-priority gate. Unavailability or restart can reset for timers. A time-pattern re-evaluation may be preferable where conditions remain above the start threshold through a restart or an automation was disabled. A switch command succeeding is not proof that an appliance actually started: use metering and supported feedback to confirm operation.

Home Assistant’s automation triggers, automation troubleshooting and Shelly integration documentation explain state changes, threshold behaviour and local device integration. Where a suitable certified DIN-rail relay is used to signal a control input, its contact and input ratings, enclosure, coil/control voltage and failure mode remain an electrician’s responsibility. A relay’s printed current rating should never be interpreted as carte blanche to switch every heater duty cycle.

A more robust alternative: state machine instead of one threshold

A real installation benefits from states such as IDLE, WAITING_FOR_SURPLUS, RUNNING, MINIMUM_REST and FAULT. Track when the controlled load last ran, whether the external heater indicates demand, and whether measured grid power settles as predicted after engagement. Use an input helper for homeowner preferences, but keep safety and electrical protection entirely outside the helper. For heat pumps, let the manufacturer’s controller decide when the compressor actually runs; the energy manager should only request a suitable operating window.

Batteries, export payments and other loads change the answer

It is tempting to programme “hot water first, batteries second” because heating feels like an obvious way to consume solar. That may be incorrect if the battery provides backup during outages, if off-peak import later costs less than forfeited export revenue, or if the same energy could drive a heat pump with a higher effective conversion to useful heat. Conversely, an ageing battery cycling at a low value spread might make water diversion attractive. The comparison is specific to the home.

Where surplus could go Important constraint Practical decision test
Export to grid Export compensation and settlement rules Value of each exported kWh
Charge home battery Usable capacity, round-trip losses, degradation, reserve SOC Likely avoided import value and backup priority
Immersion heater via diverter Resistive conversion and cylinder heat losses Cost and efficiency of alternative water heating
Heat-pump water heater COP at actual conditions; permitted manufacturer input Heat delivered per electric kWh
EV charging EVSE minimum current, availability, departure requirements Whether enough stable surplus and time exist
Dishwasher, washing machine Cycle integrity and supported delayed start Does the cycle finish when needed?
Space preheating Comfort limits, building inertia, weather Does shifted heat avoid later purchased energy?

Do not switch a washing machine or dishwasher on and off partway through a cycle. Prefer the appliance’s supported delayed-start or remote-start function. Likewise, charging an EV needs a compliant EVSE with appropriate built-in protections and manufacturer-supported current management; a general-purpose relay is not an EV charger.

Worked example: a few surplus hours are not a universal payback case

Suppose a home diverts 3 kWh of genuine would-have-been exported electricity into an immersion heater on a good day. If the owner would otherwise buy electricity at £0.26/kWh to provide the same electrical heat, and export would have paid £0.10/kWh, the incremental gross benefit is (0.26 − 0.10) × 3 = £0.48 for that day, before equipment losses, standing losses, installation cost or tax. If the alternative was a heat pump delivering the same heat with a seasonal COP of 2.5, that heat would need about 1.2 kWh of electricity, not 3 kWh, so the value comparison changes dramatically. Both tariff figures and COP are hypothetical examples, not current market offers.

At 150 equivalent sunny days, the first simple case produces about £72 of illustrative annual gross benefit, not a promise of savings. The installed cost of the equipment, household hot-water demand and existing water-heating method determine payback. Never multiply peak summer export by 365 days or assume that every diverted kWh would otherwise have been bought at the full import price.

Other flexible loads: prioritise what can really move

A sensible load hierarchy is: preserve basic household demand and system safety; honour user-selected battery reserve; supply temperature-sensitive hot water safely; manage genuinely flexible appliances by deadlines; then charge an EV at an allowed minimum current and within its desired departure window. This order is not universal. Users with high export compensation might favour selling energy; users without storage might favour an immersion diverter; households using a heat pump might benefit more from preheating via its own scheduler.

Solar forecasts can make a controller less reactive. If a forecast predicts abundant generation, you might postpone a morning hot-water top-up until midday while retaining a fallback deadline. But forecast data is not a live safety or surplus measurement. Use the forecast to select a schedule, then use actual meter readings and approved equipment to decide what may run. Home Assistant can combine forecasts with measured data, but always check the forecast provider’s documentation and access restrictions before scheduling household loads around it.

What hardware should you buy?

Build a full installed bill of materials, not a shopping basket containing a cheap relay and an optimistic diagram. A system with power-switching capacity requires appropriate cable, isolation, protection and certification as well as monitoring. An existing inverter gateway might already provide live export information; if not, allow for a compatible meter and its installation. Where the objective is hot water, a packaged diverter can remove much of the custom-control burden, but still requires professional commissioning.

Item Buy or verify Common hidden cost or incompatibility
Solar export meter/CT Approved, correctly placed, correct phase topology Electrician time, CT extension, meter access, orientation
Proprietary diverter Exact heater type and electrical rating supported Model-specific integration, CT pairing, cable run
Manufacturer-supported heat-pump input Confirm installer documentation and operating behaviour Optional interface card, firmware, commissioning
Local Home Assistant host Stability, monitoring, local communications UPS/network resilience, maintenance
Certified enabling device or contactor system Properly specified for signal and switching duty Enclosure, protection, fail-off design
Cylinder temperature and safety devices Existing certified independent protection Service, replacement thermostats and commissioning
Appliance-side metering Real consumption/operation confirmation Not all devices expose accurate power feedback
Installation and certification Relevant local electrical and plumbing compliance Labour, test documentation, warranty boundaries

For a typical UK installation the regulations and installer requirements differ from Greece or another European country; the same product label does not guarantee approval in every market or network. Check the manufacturer’s regional documentation and an appropriately qualified local installer. Do not infer a heater’s compatibility from the relay’s maximum amperage alone.

Commissioning: seven tests before trusting a solar automation

1. Confirm the meter sign. With solar low and a known household load running, the property should report import. Under real surplus conditions, compare Home Assistant with the utility meter. Record whether export is positive or negative in every source entity.

2. Confirm the system boundary. Switch an ordinary home load on and see that grid export decreases by a plausible amount. For a battery-equipped home, record battery power and SOC separately. A solar-inverter production register is not automatically a grid meter.

3. Measure the controlled load. Verify its actual running watts and any start-up transient through a supported meter, not a guessed nameplate. Account for whether the heat pump is drawing auxiliary heater power.

4. Test clear and partly cloudy periods. Observe stable start and stop behaviour, timers, hysteresis and minimum-rest constraints. Too-frequent switching is a commissioning defect, not a dashboard inconvenience.

5. Test outage and loss of data. Disconnect the Home Assistant network path as a non-invasive simulation and verify the system does not start new discretionary heating. Have the installer confirm electrical fail-safe behaviour, especially on power restoration. No solar automation should disable a protective thermostat or BMS.

6. Test battery priority. In a suitable safe test condition, confirm the intended reserve threshold and check that water heating does not unexpectedly drain backup energy. Do not change battery charging limits or inverter registers without manufacturer support.

7. Reconcile daily energy. Log useful heater-on time and actual energy, grid import/export before and after, hot-water temperature and battery SOC. Compare against a similar sunny day without diversion, accounting for different weather and water use. This shows whether the system is doing something valuable rather than merely moving a graph.

Troubleshooting: when solar diversion seems to misbehave

Symptom Likely explanation Safe next check
Heater starts while grid imports Wrong CT sign/location; threshold based on PV power rather than export Compare live grid meter and configured sign with electrician
Heater never starts Threshold exceeds typical surplus; meter W/kW mismatch; device not demanding heat Compare real surplus, rated load and thermostat demand
On/off every few minutes Cloud transients, no delay, too-small margin Review hysteresis, rest time and suitable control method
Solar generation drops when diverter runs Inverter limits, CT boundary or misleading sensor presentation Compare production sensor and physical grid meter
Battery unexpectedly discharges Control priority and fast battery response interact Inspect battery power, reserve policy and vendor settings
Export measured but diverter stays idle Cylinder thermostat satisfied; CT pairing or device delay Read product status and approved diagnostics
Device stays on after Home Assistant disconnects Remote switch retains last state without independent fail-off Stop using automatic control until electrician reviews failure mode
Forecast predicts surplus but nothing happens Cloud cover, wrong array geometry or a high household load Prioritise live measurement; revise forecast expectations

Also beware of accumulated energy versus instantaneous power and numeric-state triggers that only fire when a value crosses the threshold. A sensor that is already above the limit after an automation reload may not trigger until it crosses again. Home Assistant’s documentation describes these behaviours; design accordingly rather than multiplying trigger copies without a state model.

Frequently asked questions

Will an ESP32 and a relay replace a commercial immersion diverter?

Not equivalently. An ESP32AliExpress price can read sensors or issue an approved control request, but a basic relay provides on/off switching, not proportional diversion. Designing a safe mains power controller is an electrical engineering and certification task. For immersion heaters, a professionally installed certified diverter is generally the cleaner product solution.

Can I use a Shelly smart relay directly for a 3 kW heater?

Do not decide from a headline ampere rating. The exact model, load category, switching frequency, enclosure, thermal conditions, local rules, circuit protection and appliance compatibility all matter. Ask a competent electrician whether a certified contactor and appropriate control input is required. Home Assistant’s local Shelly integration does not change the electrical design requirements.

Does Home Assistant need internet access?

Not necessarily for local export-meter and compatible local actuator integrations. Forecast providers and some proprietary ecosystems do need a remote service, however. Design a sensible response to Home Assistant, network and sensor failure; essential hot-water and protection functions must not rely solely on an internet connection.

Should I use the solar output reading instead of grid export?

Not for a simple export-following algorithm. Generation says what panels make, but not how much the home, battery or other devices need. Use a correctly configured grid connection measurement, and confirm phase aggregation for three-phase sites.

Is hot-water diversion better than charging a battery?

Sometimes, not always. It depends on heat demand, alternative heating efficiency, export/import tariffs, battery degradation, reserve preferences and whether useful hot water can actually be stored. Compare incremental value rather than assuming self-consumption is automatically profitable.

Can the automation ensure water is safe?

No. Home Assistant and a solar forecast are not substitutes for the water system’s approved thermostats, thermal cut-outs and hygiene control. Heating schedules must not defeat manufacturer protection or an appropriate legionella-control regime.

Final recommendation

If your goal is to turn genuine solar surplus into hot water with minimal engineering risk, choose a professionally installed, compatible proportional immersion diverter and measure the result. If your goal is to coordinate an existing smart heat pump, look for its documented external enable or demand-response feature, not hard mains switching. For EV charging and other flexible loads, use the appliance’s compliant and supported scheduling interface.

When adding Home Assistant, build the algorithm around correct net grid measurement, conservative margins, clear battery priorities and fault handling. Test the value against the export tariff and the cost of the alternative way of heating, not against a simplistic ‘free solar’ calculation. The result should reduce bills or improve comfort without allowing a software automation to become an electrical or thermal safety system.

Official documentation and further reading

CONTINUE EXPLORING / ESP32 & ELECTRONICS

Read next

Practical guides related to this article.

Explore the topic →
HARDWARE DECISION GUIDEWhich ESP32 board should you use?

Compare practical options before you choose hardware.

Compare options →