an automation to make the immersion water heater turn off and waste no energy if the water is already hot

The Sonoff POWR2 can replace the timer on a hot water immersion heater. This model also measures electricity as volts, amps and current. This feature provides the key to saving energy by heating the water only for as long as necessary.

For years, my immersion heater timer turned on during the night and turned off in the morning. That provided enough hot water till the next day but sometimes it needed a boost.

So what do you think happens when the heater is turned on and left running through the night? Answer: the water in a tank heats up and after about two hours, a thermostat stops it heating. The tank cools and after 2-3 hours the thermostat calls and gets 5 – 10 minutes of heating. This continues (stupidly) through the night doubling the electricity used.

Advice? Adjust the timer to start heating water an hour before you need it. But as well as doing that, an automation routine waits for the amps to drop (because the water is hot) and then it switches off the heater

When the water heater timer on continuously there’s a significant waste of energy.

The Sonoff POW2 can be integrated in Home Assistant without modification. Alternatively its ESP chip can instead be flashed with different firmware – this is what I did before it was possible to set a heating schedule and access its energy readings. The setting up is described on this page. Below I focus on the automation routines after setting up.

Turn the water heater off when the water is hot

Home Assistant will run my automation script that waits for the water heater current to drop. In summary, turn on the immersion heater at say, 5am; turn it off at 7am but if the water is hot before then turn it off anyway. Here’s the code:

alias: water heater turn off
# WAIT UNTIL WATER HEATER CURRENT DROPS BELOW 8 amps FOR 5 MINUTES
trigger:
- entity_id: sensor.water_heater_current
  below: '8'
  for: 00:05:00
  platform: numeric_state
# DON'T DO ANYTHING IF THE HEATER ISN'T ON ANYWAY
condition:
- condition: state
  entity_id: switch.sonoff_water_heater_relay
  state: 'on'
# TURN OFF THE WATER HEATER 
action:
- data:
    entity_id: switch.sonoff_water_heater_relay
    service: switch.turn_off
# WHILE TESTING USE A SMART BULB TO SHOW SUCCESS DELETE LATER
- data:
   brightness: 5
   color_name: green
   entity_id: light.corner_lamp
   service: light.turn_on 

The hot water ‘boost’ button

When people stay over, there’s not enough hot water. Unfortunately if I turn the timer to start heating, I’ll forget to turn it off. A solution is to write a ‘boost’ script. The boost script turns on the water once – when you press the button on the device (photo) or when you press a button in Home Assistant. Turning off is taken care of by the automation above.

BTW the Sonoff ewelink app has a surprisingly named ‘inching’ feature which turns off my heater when it’s been running a specified time. This is a way of ensuring the unit isn’t left switched on.

 water_heater_boost:
  alias: heat water till hot
  sequence:
# START HEATING WATER
  - data:
      entity_id: switch.sonoff_water_heater_relay
    service: switch.turn_on
# WAIT A FEW MINUTES 
  - delay: 00:05:01
# IS THE CURRENT ALREADY BELOW 8 amps 
  - below: '8'
    condition: numeric_state
    entity_id: sensor.water_heater_current
# FAILSAFE - TURN OFF HEATER JUST IN CASE IT IS
 - data:
     entity_id: switch.sonoff_water_heater_relay
  service: switch.turn_off
 

Scripts in Home Assistant.

A script looks a bit like an automation but it runs only when you tell it to run. An automation is always active, as it waits for say, a time to trigger some action. The distinction between them became clearer over time.

Leave a Reply

Your email address will not be published.