Immersion Heater for hot water

I have an immersion heater for heating water… I have used 2 sonoffs - 1 for on/off and a 2nd one for measuring temp installed near the tank. The 2nd one also controls power to my water pressure system.
I can set max temp/ max working time, boost function, and also a generic thermostat platform.
Any suggestions are welcome!

4 Likes

automations- boost start/cancel/end, max temp and working time:

- id: '1572900431040'
  alias: Boost Start
  description: ''
  trigger:
  - entity_id: input_boolean.boost
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data_template:
      duration: 00:{{ states.input_number.heater_boost.state | int }}
      entity_id: timer.boost
    service: timer.start
  - device_id: e17b1ca6870440d8b5aa7a89d3841ef3
    domain: switch
    entity_id: switch.hotwaterswitch
    type: turn_on
	
- id: '1572901200125'
  alias: Boost Cancel
  description: ''
  trigger:
  - entity_id: input_boolean.boost
    from: 'on'
    platform: state
    to: 'off'
  - device_id: e17b1ca6870440d8b5aa7a89d3841ef3
    domain: switch
    entity_id: switch.hotwaterswitch
    platform: device
    type: turned_off
  condition: []
  action:
  - data:
      entity_id: timer.boost
    service: timer.cancel
  - device_id: e17b1ca6870440d8b5aa7a89d3841ef3
    domain: switch
    entity_id: switch.hotwaterswitch
    type: turn_off
  - data:
      entity_id: input_boolean.boost
    service: input_boolean.turn_off
	
- id: '1572935060390'
  alias: Boost End
  description: ''
  trigger:
  - event_data:
      entity_id: timer.boost
    event_type: timer.finished
    platform: event
  condition: []
  action:
  - device_id: e17b1ca6870440d8b5aa7a89d3841ef3
    domain: switch
    entity_id: switch.hotwaterswitch
    type: turn_off
  - data:
      message: Your Hot Water is ready! The current hot water temp is {{states('sensor.pressureswitch_ds18b20_temperature')
        | float}} °C
    service: notify.home_assistant
  - alias: ''
    data:
      entity_id: input_boolean.boost
    service: input_boolean.turn_off
	
- id: '1572939461079'
  alias: Max hot water Set
  description: ''
  trigger:
  - platform: template
    value_template: '{{ states(''sensor.pressureswitch_ds18b20_temperature'') | float>
      states(''input_number.heating_temperature'') | float}}'
  condition: []
  action:
  - device_id: e17b1ca6870440d8b5aa7a89d3841ef3
    domain: switch
    entity_id: switch.hotwaterswitch
    type: turn_off
  - data:
      message: Hot water temp reached  Max Temp set! The current hot water temp is
        {{states('sensor.pressureswitch_ds18b20_temperature') | float}} °C. Turned
        off...
    service: notify.home_assistant
- id: '1572982592362'
  alias: Max time heater switch
  description: ''
  trigger:
  - entity_id: switch.hotwaterswitch
    for: 'duration: ''{{states(''input_number.heater_time'')|int}}:00'' '
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - device_id: e17b1ca6870440d8b5aa7a89d3841ef3
    domain: switch
    entity_id: switch.hotwaterswitch
    type: turn_off
  - data:
      message: Hot water was turned on for {{states('input_number.heater_time') |int}}  hours..Turned
        off
    service: notify.home_assistant

configuration :

climate:
  - platform: generic_thermostat
    name: Hot Water
    heater: switch.hotwaterswitch
    target_sensor: sensor.pressureswitch_ds18b20_temperature
    min_temp: 40
    max_temp: 65 
    ac_mode: false
    hot_tolerance: 1
    cold_tolerance: 0.5
    min_cycle_duration:
      minutes: 5
    initial_hvac_mode: 'off'

sensor:
  - platform: time_date
    display_options:
      - 'time'
      
input_boolean:
  boost:
    name: Boost
    initial: off
timer:
  boost:
    name: Boost CountDown
   

input_number:
  heating_temperature:
    name: Set Max Temp
    min: 50
    max: 70
    step: 5
    unit_of_measurement: '°C'    
    icon: mdi:thermometer
  heater_boost:
    name: Minutes
    initial: 45
    min: 15
    max: 120
    step: 15
    unit_of_measurement: 'min'
    icon: mdi:clock-start
  heater_time:
    name: Auto Off After
    initial: 2
    min: 2
    max: 5
    step: 1
    unit_of_measurement: 'hours'
1 Like

Hi
Your project is awesome
I have made and ap key error
Please help me

I like this.

I went a few steps further with mine, connecting 7 ds18b20 sensors via the 2.5mm port on the same sonoff that is controlling the immersion heater.

Then made a small python script on the web server of the RPi running HA, that generates a nice SVG image of the tank that I can show in a custom card. Perhaps this was going a bit too far!

image

I can do some maths to work out what % of the tank is still above 35degrees.

It is rigged to my solar panels (free energy intermittently), you can see the temperature increasing in steps during the day on the graph as clouds pass. my hive heating system now only boosts the hot water if it’s running low rather than on a daily timer.

Next step is a bit more maths to work out “N baths/showers remaining” from this data.

SVG generator:

3 Likes

I’ve just revived my old immersion water heater and wanted to say thanks for this post. Only had to switch in my sensor and relay to get it all to work :slight_smile:

How did you attach the sensors?

Via the 2.5mm port on the sonoff.

https://m.aliexpress.com/i/32854454198.html

If you want to connect more than one you need to modify the cable (connect them in parallel).

This looks awesome. I would love to see some images of the cylinder, and how you attached the sensors

Hi David,

It wasn’t anything special! Just the sensors shoved into the foam lining of the tank, as far as they’d go until they hit the metal.

I will try to get some photos but you can’t really see the sensors, just the black outer cable in a sort of daisy chain.

The tank is very similar to this type, where the yellow foam feels quite solid but you can poke things into it:
image
In my case I have a retrofit jacket over the top of that too.

Some extra detail if anyone’s interested:

Something all this monitoring told me is that even with two layers of insulation and all pipes insulated, the tank loses loads of heat (almost all gone in 24h even if no-one uses it).

Another thing I noticed was that the length of the electric heater is important. You can heat the top half but leave the bottom of the tank cold, then when you consume some, you can’t really get much more heat in because the top is still at high temperature, and trying to turn on any more will just mean you hit the thermal limiter. Can lead to a situation where the sun is shining and the very top 20L of the tank is hot, but the rest is cold. The gas heater has the advantage of flowing through a helix through the tank, which spreads the heat. This is very obvious when you look at the tank image and the traces. I sometimes wish there was a way to turn on the gas central heating pump only (no gas heat) to just circulate the heat a bit.

In any case, overall my family hot water has cost me nothing all summer because of this!

@dave_t_uk
I’ve the same sensor setup. In an attempt to answer the subjective question “how much hot water is there?”
https://community.home-assistant.io/t/six-temperature-sensors-on-a-hot-tank/

My old mechanical rotary timer for my immersion has just died so its time to swap it out for something a little clevererer.

I believe that my immersion will draw up to 3000w and in the UK we’re on 240v so would the Sonoff Mini R3 do the trick as its rated for up to 16A, as a direct drop in replacement for my old rotary timer?

Do I need any other bits of hardware to get this working other than a working HA installation?