#First automations

1 messages · Page 1 of 1 (latest)

modest saffron
#

Hey, I’m setting up my first automations to turn my HVAC fan on for 4 hours if CO2 is above 1000 for a bit. Since 4 hours is a while, to avoid my fans stuck to “on” I assume I need to do this statefully, is below a pretty “standard” solution to this or is there any more idiomatic suggestions? Basically I set a helper timer that’s set to restore state on restarts and then have a separate automation that sets it back to auto when the timer finishes? Should I be restarting the timer instead?

#

I don’t think storing state on the above 1000 for 30 min is as crucial

#

lol it does not like me changing the name of the timer

#

Re: restarting the timer I guess my question depends on how often this triggers. Every 30 minutes while above 1000 or only once?

#

Or every tick while above 1000 and 30 minute has passed?

modest saffron
#

Trying to find the docs that clarify that for the ‘for’ trigger

#

Looks like I found the answer in the forum, only once so long as it stays above 1000

#

I guess it really doesn’t like editing timers at all, just need to make new ones

stray silo
#

I can edit everything about a timer:

modest saffron
#

Do you create a third automation that checks for idle on startup?

modest saffron
modest saffron
stray silo
#

A separate automation or just another trigger for the homeassistant.started event to check for idle, yes

#

You can do that, too.

#

or just check the C02 at HA start and either turn the HVAC fans on or off, regardless of what was going on when you restarted HA

#

in fact, you could just use a numeric_state trigger to turn the fans off when it goes below your threshold, or a certain amount below that threshold

#

stateless is generally a good strategy - focus on your actual goal

#

amount of time isn't the goal - CO2 level is

modest saffron
#

Mmmm I see, yeah, just check below 1000 for 4 hours to trigger setting auto

#

And I guess that would survive restarts too. The 4 hour timer resets but that’s not a big deal at all

stray silo
#

A "for" block will not survive a restart. It may never trigger because there may not be a stage change to start the for:

modest saffron
#

Oh