TLDR: I want to keep my garage at around 40°f in the winter. Since automation triggers only fire when the “threshold” is crossed (aka 40° changes to 39°), the trigger would sometimes be missed since it also had a condition to NOT run during Energy Peak Pricing times. When the trigger was missed, I would have to manually turn on the heater, otherwise the “Turn On Heater” automation would never fire again. I solved this problem by changing the trigger to every 15 minutes and I moved the “logic” to the condition section of the automation. The conditions now are: Garage below 40 and heater is off and time is after 7pm and before 3pm. The “Turn Off Heater” automation follows similar logic now too.
I was just wondering if there was a better way to achieve this. Concerned I may have overcomplicated it. Based on other topics I have read, there doesn’t appear to be a better way? Note: I realize I could get similar results using a timer plug and a thermostat plug, but that’s no fun
Long Version:
I have a detached garage and keep my tools and such in it, including my battery operated tools. We get some pretty cold winters, so to keep my batteries from degrading too badly, and to protect the rest of my tools from condensation and such, I want to keep my garage around 40°f.
Initially I setup an automation to turn on an electric heater (Oil filled, very safe) and a fan when the garage dropped below 40 and another to turn off the heater and fan when it got above 43. This worked fine until I decided I did not want to run the heater during my electrical providers “peak pricing” time (3pm-7pm). I modified the On automation so it would not trigger from 3pm-7pm. I then added a new trigger to my Off automation so it would trigger at 3pm daily in addition to when the garage was above 43.
The problem I started running into now was that if the garage dropped below 40 between 3 and 7, the On automation would “miss” its trigger since automation triggers like that only fire when the threshold is crossed, aka when temp goes from 40 to 39. This meant that until I manually turned on the heater and fan, the automation loop was broken.
I have since solved this issue by using a Time trigger instead of a Temperature trigger. Both the On and Off automations now trigger every 15 minutes. All the “logic” is in the Condition section now. The On automation has the following conditions: Garage is below 40 AND (the Heater OR Fan is off) AND The time is after 7pm and before 3pm. The Off automation follows a similar logic.
I am just wondering if I overcomplicated this. Is there a better way to achieve this?
At some point during this process it did occur to me I could have gone “low tech” and got a timer plug and a thermostat plug. Have the timer plugged into the wall, and the thermostat plugged into the timer, and run everything off that lol. That seemed less fun to me than getting Home Assistant to work though, and since i already had everything else, the Home Assistant solution was free