I’m fairly new to Home Assistant and after setting up some sensors etc. I have started wondering if it can be used to implement this kind of automation.
I have a hot tub with its own heater already working in HA (I’m able to read the temperature and set the heater on/off). The heather is able to warm at 2°C/hour.
I’d like HA to read my calendar and see when I plan to use the hot tub (I have an appointment set) and activate the heater so that a defined temperature is reached in time for the appointment.
Can anyone advise if this can be accomplished with HA?
When it will happen soon, use wait for trigger in automation with template and a bit of math
Turn it on
As for the math, find the difference between the current temperature and the target temperature, divide that by 2°C, and subtract that amount in hours from the start. Or
s - ((t - c) / 2°C)
Where s is start, t is target temp, and c is current temp.
ok I think I mostly accomplished what I wanted and, more important learnt a lot regarding HA automations during my testing.
I had to switch to CalDAV to use iCloud and discovered that the exposed sensor will be on only at the time the event start and off at then end. Therefore I used it as trigger the Sunrise, if the calendar sensor is on it will activate the heater. Once the day is off (my event is all-day) the heater will be set off with another automation.
Will have to test it more during the following days.