#Deferment possible?

1 messages · Page 1 of 1 (latest)

true verge
#

So I’ve played around with timers, triggered by conditions, and altering timer states (start, stop, restart, finish, etc) which I’ve found really handy

In some scenarios though, I can’t really predict when a condition might be satisfied, and wish to defer until they are, is this possible?

I have some virtual switch helpers I use to set “modes” in the house. They have accompanying automations that run related actions whenever they’re turned on or off, but more so mostly serve as conditional predicates to the way most automations ran will respond

For example, some of my modes include Nap, Work, In a Meeting, and things like that. I’ve got automations triggered by a number of motion sensors and presence sensors that control most all the lights and electronics in the living room for me, which usually is great, but if say I’m “napping”, I don’t want one hazy roll over on the couch during a nap to all of a sudden light the entire room up on me and turn in the TV, right? So those automations verify in example that nap mode isn’t active before executing.

I’ve come into a scenario though that has to deal with push notifications when events happen I’m interested in following/knowing about, and exactly when they occur. In the same sense as the lights though, I don’t wish to be pestered with these notifications if I’m napping, nor do I want the distraction be it for me or anyone else if/when I’m in a meeting. But I’d still like the notifications…

So is there a way where I can defer them, rather than just not send them? So that once I’m out of a guarded mode, they’ll come in then?

Or I suppose if it’s possible to send them without audio, silently, that’d do too…

Any ideas? Thanks

stuck kraken
#

A straightforward way to do it is to use a wait_template as the first action in your automation to wait for something to be true before proceeding

#

if it's already true, it will move on. if not, it will wait

granite holly
#

Put in a wait for templates

#

Nvm, Rob has you covered

stuck kraken
#

another option is to set an input_boolean and then have an automation trigger when you exit a state and then do whatever happened while you were in that state

#

then reset the input_boolean

true verge
stuck kraken
#

by doing what I suggested

#

you already have an automation with a trigger

#

add a wait_template as the first action that checks for whatever state or states you want to wait to exit

true verge
#

Okay thanks, guess I just have to dig into the docs and learn to groc it before thinking much harder over it

I’ll go and make that effort before I pester you all here anymore on it 😅

stuck kraken
#

it would probably be a nice feature if you could use something like wait_for_condition with a normal YAML condition block, rather than a template