Advices for time based automation

Hi,

Here is what I’d like to do:
I have a water heater in home for all hot water. To save money I’d like to be able when I want to get it on power only half of time. I want too that it still works in last setup mode even if HA is down/avalaible !
I was thinking to setup the half-time automation in ESPHome and then in HA to have only a toggle button to activate/deactivate (when button on in HA, heater is on only half of time, when button off in HA, heater is on all the time) that automation in ESPHome node.

Considering ESPHome is now able to retrieve time from an external source, will it keep time so long it’s powered on ? even if the time source is no more avalaible ?
Is it possible to do such automation based on time in ESPHome now ?
Is it a good idea to go this way ? or better solution ?

Thanks for ideas, comments :wink:

Vincèn

My heater manufacturer advices to leave the heater on 24/7 because heating it up after a longer period effectively costs more energy than leaving it on because of the good insulation.

I only switch it off if I leave home for a longer period of time like vacations.

For safety the temperature should be kept above 60°C or more to reduce the risk of Legionella multiplying in the hot water system.

Exactly. Thats why, after a vacation, I first heat up the water, rinse and refill the boiler.

Thanks guys, I had not noticed it was a medical forum here :frowning: No offense but I asked advices for automation setup not about my heater :wink: Side note: the heater has run during years being powered only half of time with a mecanical clock and we have not been sick neither had any problems !

Interesting. Apparently your heater manufacturer doesn’t understand thermodynamics. Ignoring the “medical” side effects, consider a simple scenario. You go away for a year. According to the manufacturer, it would cost less to leave it on the whole year than to turn if off and then back on when you return. Does that make sense? No, it shouldn’t. Same thing goes for shorter periods of time. The bottom line is heat loss is a function of the temperature difference between the inside and outside of the heater. The more the difference (i.e., the higher the temperature inside the heater) the faster the heat is lost. And what the heater effectively does is to replace that loss. The hotter it is inside, the more it loses, the more it has to run to replace the lost heat. The cooler it is inside, the less it loses, and the less it has to run to replace the lost heat. Simple. Same reason set backs save energy/money on A/C units.

1 Like

Well, I’m not a physicist myself but I can imagine that heating a little every time below a certain threshold might be more cost effective than heating a lot from a really low temperature.

Yeah and I gardened and used bagged soil/potting mix for years without a mask and didn’t get legionella, but I now take precautions. People often talk about electrical safety here, and no one regards it as off topic, and neither is the warning posted here off topic.

1 Like

Hi @vincen,

I am just starting to look into this sort of thing myself (time-based stuff). I do not believe that the internal clock will survive a hard reset, but I am not an expert in these matters.

My own solution for this is to run a local NTP server on my router. The router syncs to an external clock every 24 hours or so, but all the devices on my network get their time from the router, not from an external site. That way, even if whatever international time server goes down for whatever reason, my local network of Things will still keep step with each other.

I have a water heater that is powered by a Sonoff Basic. It is not yet running ESPHome, but it will be soon. The important thing to remember is that a water heater draws too much current to be switched directly by a Sonoff relay - in fact, most smart switches are not up to the task, as they usually use a Songle relay with max 10A capacity.

So instead, I bought a 24A contactor from an electrical supply store. It was quite affordable, although more expensive than the Sonoff. It can be switched with 220VAC. So, I installed the contactor in my distribution board (please be very careful, you can kill yourself if you don’t know what you’re doing), and then connected the Sonoff to the contactor’s control switch. The Sonoff is thus completely isolated from the current draw to the water heater.

Even better, the contactor must be engaged by the Sonoff in order for the water to heat. We have very sketchy power where I live, and experience power failures at least once a week. In the event of a power failure, the contactor drops harmlessly out, so that when our generator kicks in, it is not carrying the load of a water heater.

Good luck with your project. Please share your yaml file here when you get it working, I don’t believe there is an example of such a device on this forum.

Why are people so obsessed about esphome doing all your automation? Just do the automation on home assistant.

By the way @DeeBeeKay, the Shelly One is 16A.

1 Like

@nickrout You have spelled “node-Red” incorrectly :rofl:

16A, eh? That’s a lot nicer than the Sonoff Basic. I’ll have to look into that, I don’t think I’ve seen Shelly products in my country. 16A would probably work for a lot of water heaters. Mine pulls 18A, though.

I can’t speak for other people, but the reason I want certain (not all) basic automation happening inside the ESP8266 is for failover reliability. For example, there’s a floodlamp outside my workshop that comes on on a timer, for security, and in case I need to make my way there at night. Yes, absolutely, I could do that in Node-RED; and I could even do it better; tie it to sundown, and so forth.

But, this presupposes stable wifi. The shed is far from the house, and is riiiiight at the edge of the mesh. It frequently shows as Unavailable in Home Assistant. I don’t want the functionality of the security floodlight to be reliant on whether it can see Home Assistant. I want the basic schedule to happen regardless of good wifi.

I have a shop building that is about 50 feet from my Netgear mesh satellite. Wifi was pretty dicey out near the shop. I placed a Tplink repeater in my shop, this model only does 2.4 Ghz, which is appropriate for longer distances. Not only does this provide reliable wifi in the shop but most of the area around the shop and in the area at the rear of my house.