Hot water control with Shelly and Home Assistant
I thought I would share my experiences with setting up a Shelley to work with my hot water cylinder and new solar system using home assistant.
I wasn't able to find much detail on how to do this (and there may be better ways than what I'm sharing here) but thought I'd share what I've done to date - appreciate any feedback.
The overall objective is to have the cylinder turning on when there is excess solar, and off when there is not enough solar - to reduce importing as much as possible. But importantly also to make sure the HWC reaches temperature every day to avoid any bacteria.
My Setup:
- Rheem 3kw hot water cylinder - this has a single element
- 6kw Solax inverter and 6.65kw panels
- Shelly Ogemray 25a device - installed in the switchboard by the solar installers. This can handle larger loads than a regular Shelly (without a contactor), and has built in power measurement - so you can tell by the power usage if the thermostat has tripped i.e. the cylinder has reached temperature.
- Home Assistant running on an old windows PC, using Oracle Virtualbox virtual machine
First challenge was to get the Solax inverter talking to home assistant so I can see whether the inverter is exporting or importing. This was a bit of a challenge but I used a HACS integration called 'SolaX Inverter Modbus'. I had to reduce the polling interval to 60s to get reliable data.
The main entity my Home Assistant automations are looking at is called 'SolaX CT Power'. This gives me a view of whether the inverter is currently exporting or importing - e.g. it will read +3000 if I am exporting 3kW or negative if I'm importing.
I have set up the following Home Assistant automations and helpers
- A Helper which I called "HWC Export Threshold". This is a variable which is used to turn the HWC on - if my export kW is currently over this threshold, the HWC turns on. I normally have this set to 3000 to match my HWC's wattage - but having this as a variable means that I can change this manually or using automations (e.g. if it's a cloudy / rainy day - I might reduce it to 1000)
- An automation which turns the HWC on if the Export is greater than the Threshold for more than 3 minutes. (it also sends a notification to my iphone so i can see what is going on)
- An automation which turns the HWC off if I'm importing more than the threshold - 3500 watts for more than 3 minutes. The 3500 is because my cylinder is 3000w, plus another 500 watts as a buffer so that it doesn't turn on/off continually.
- An automation which detects if temperature has been reached. It does this by turning on a toggle if the Shelly power reading is <1000 for 5 seconds, and if the Shelley is on. If both of these conditions are met, it concludes that temperature has been reached and it sets a "hotWaterTempReached" toggle on.
- An automation every day at 2.30pm to begin a "Boost" if the HWC has not reached temperature. This is done using the "hotWaterTempReached" toggle above, and if this rule triggers it activates another toggle called "HWCBoost". HWCBoost can be triggered manually as well - and the automation to turn off the cylinder does not activate during a boost. The logic of 2.30pm is that if the cylinder hasn't reached temperature by this time, it's unlikely to get there without help, and I might as well trigger it while there is still some daylight remaining.
- An automation which runs at sunrise which looks at the Home Assistant weather forecast and reduces the threshold to 2000 if the forecast is for rainy or cloudy etc.
- An automation to turn the HWC off at sunset every day, and another at midnight which resets the thresholds and toggles
While this was a bit fiddly to set up, it's working pretty well now and increases my self consumption % while avoiding using a costly diverter.
Posted Apr 24, 2026, 8:24 PM UTC