Water heater automation

Hi all.
As a guy who loves to shower early in the morning, I’ve decided to automate my water heater. I have a hot water tank on my roof that is connected to a solar heating system and includes an electrical heating (for the days the sun is not strong enough). I had everything connected to a timer, but decided that it is not smart enough. So… here are the steps I’ve taken, and the results:

  1. Installed a Shelly1PM and a Temperature Sensor Add On. The Shelly controls the power to the electrical heating system, and is in line with the water heater thermostat (making sure there is an additional fail safe for over heating). One temp sensor was installed on top of the tank existing temperature sensor - reading the water temp in the middle of the tank, and a second was installed hanging below the tank (providing outside temperature reading).
  2. Set up a Node-RED flow to control the water heater based on set of inputs from HA

    In essence the flow defines the water temperature in the morning, daytime, evening and night and turn the electrical heating element based on the actual water temperature reading. I’ve built the schedule based on the normal usage in my house.
  3. Installed a WaveShare epaper display to allow a quick view on current water temperature.
  4. Installed a ZigBee based button, to allow for a quick 30’’ water heating - for my girls who remember to turn the heating on before showering, but not to turn it off. The button operate a script that put the water heater in manual mode, and temperature is set to the evening temperature.

So far this install works great. I have warm water when needed, power consumption is definitely lower than using a basic timer, and I have fun playing with Grafana and poking through the data.

Will be happy to share further info if anyone is interested.