Advice on setting up hot water tank automation

Morning all.

I have finally got round to buying a Shelly Relay with the addon board and three temperature probes.

I have put one probe at the very top of the tank, one in the middle and one at the bottom.

I have suddenly realised that I have no idea how to start using Home Assistant to control my hot water.

What I want to achieve:

  1. Timers so that my hot water tank is full warmed up at 7am and 7pm - HA can tell the boiler to fire up earlier and later, depending on how much hot water is already in the tank.
  2. A boost button, so I can have enough water for, say, a bath in the middle of the day.

I have literally no idea where to start with this.

Should I use Node Red or is there an integration that I should use instead?

Any advice on getting started would be much appreciated.

You could start with providing a sketch/drawing and facts about your Tank and Heating Source, and maybe also over your i.e pipes ( I.e do you have any circulation of the hot water to/from the Tap/crane points, or for the tank it self etc )

Node Red,MQTT or Or which ever integration you have Your Shelly( with add-on/temp-sensors ) integrated with ( In the end, it’s the Automations/Templates which will " do the job " )

Thank you for this - I clearly need to learn a lot more before taking the plunge with this.

At the moment, I can confirm that my water tank is heated by a gas boiler.

I am using a Shelly 2PM Gen4 - it has Zigbee capability but I have been advised that it is a bit flakey and it would be safer to use wifi for something as critical as hot water and heating.

And how is the gas-boiler “operated” via another “smart-switch” ? or the same Shelly 2PM ?

The single Shelly will be turning on both.


I am replacing the programmer with the Shelly relay - I am going to use it to control both my hot water and central heating.

Yes, you do have to “read up” on your system, if you want to replace that “Programmer” with 1 shelly, with 3 temp-sensors in your Tank

What is the Cylinder ?, the hotwater tank, or Water-tank(with buildin hotwater-coil) ?
And You do know that this “programmer” is controlling the 3 port Valve, and boiler/pump, based upon i.e the room thermostat, , and the cylinder thermostat
The 3 port Valve, what does that “control”, heating water to the tank vs heating water to heating-system (elements) ?
The Pump is that a Gas-Pump, or the water-pump ?
The diagram seems to come from a (1 unit) , which make it hard to understand, where you have placed your 3 temperatures , and in particular how you intend to “replace” that Programmer with 1 Shelly

Both what ?

Thanks for your help with all this, beheme61.

I have just realised that my initial post is really vague.

I meant to say that the tank I am monitoring is a copper hot water tank with a heat exchanger running though it. The three probes are on this tank. The pump is just a regular water pump. When I need hot water, the switch closes (i.e. connection 3 is connected on the diagram) and this activates both the boiler and the pump. My gas boiler turns on and heats water that is pushed through the hot water cylinder continuously until either the programmer has run for a set time or the cylinder thermostat reaches the desired temperature and breaks the connection to both the boiler and the pump is cut.

I would also say that the three-port valve gets a signal too, to ensure that water is diverted away from my central heating system and sent via the hot water cylinder.

Yes i “think” i understand, some “system” like this have i.e settings to prioritized either hotwater, or heating-system water flow
Beside that, Yes You are still somehow “unclear”, so i’ll stop “dragging” relevant info out of You, and recommend you reading the Very first Topic in here, " Howto Help …" and Post a “structured” Request with a detailed description of you heating system
Bottom line … don’t let the water in the Tank get warmer than the Top-Sensor, with i.e no circulation the water in the bottom will be colder, So don’t wait for the bottom-sensor to reach 80 degree Celsious, because the Top will be 100 C

Ah the good old 3-port mid-position valve with Y-Plan wiring. How quaint.

Worth noting, before you go anywhere, that the cylinder stat is a single-pole two-way changeover switch. This provides both “call for heat” and “not call for heat”. Similarly, the timer has the hot water switch as two-way, providing a “not call for hot water” as well as “call for hot water”. In short - if there is no requirement for hot water, there is still a (switched) live feed going to the valve.

If you wish to replace the timer-programmer as it stands, then whatever you use will require two channels, and one must be two-way switching. Since most smart switches, including the Shelly 2PM, are single (dual) channel and one-way switching, you will probably require three switches.

  • No hot water
  • Hot water (inverse of above)
  • Heating

Alternatively, you could, in theory, ditch the timer-programmer and the cylinder stat, but you will have to ditch the room stat as well and just go for driving the two input wires for the 3 port valve.

The 3-port mid-position valve logic is:

CH - off & HW - off → grey wire live
CH - off & HW - on → no wire live
CH - on & HW - off → both wires live
CH - on & HW - on → white wire live

Or
Grey 0, White 0 = HW
Grey 1, White 0 = nothing
Grey 0, White 1 = HW & CH
Grey 1, White 1 = CH

So Grey live is “not hot water” and White live is “Heating”

The boiler ‘call for heat’ is confounded from both the cylinder stat “call for heat” and the valve (orange wire).

In short, the boiler “call for heat” occurs when either

  • there is call for hot water via timer and cylinder stat together.
  • there is call for heating only, via the valve (orange wire) with a live feed from the white wire.

When hot water is required, neither valve wire is live, and the boiler call for heat then comes from the cylinder stat call for heat, and therefore you would still need three switches.

If you just wanted to control the hot-water side only, leaving the heating from the programmer and room stat, then you have to control the valve grey wire using one switch [turn grey on to turn HW off], together with the boiler call for heat using another switch [turn on for HW].

This post is for general discussion only and not for any practical use. Always check wiring diagrams for your specific setup, and use a competent electrician if in any doubt whatsoever.

Always triple check your Y-Plan wiring before switching on.

Thanks for this, Biscuit - extremely helpful.

I ended up buying an additional external SPDT relay that I will be using for the hot water side. That relay is controlled by one of the Shelly channels.

I did some messing around, with the help of Copilot, and I think I am starting to get a working system. I am still in the testing stage but it seems that rather than telling when the hot water comes on, I tell it for what time I want a full tank ready for and it calculates, automatically, when to turn the boiler on.

Assuming this works, I need to calculate how long it takes to go from completely cold to completely hot - this is going to take quite a bit of work as there is I have to factor in whether it is summer or winter. In the winter, not only will the tank take longer to heat anyway but I might be using hotwater to heat my radiators as well.