I have a few automations where I want to check the state of a device, and depending on the state it should continue or wait for the state to change. is there an easy way to add a “wait for” inside a trigger and/or condition?
To give an example, I have a passive listener when a calendar post starts, it announces that post on a group of speakers with a condition that I’m actually home at the moment. Now, sometimes I’m home but I´m wearing headphones, in that case I would like to wait until any media is stopped before announcing the calendar post.
Same thing when I get home, open my front door, I’m greeted with information like temperature and any upcoming calendar events for the day etc, but if my headphones are still on (walking home from work) I can’t hear a thing.
Since my headphones, even if they are bluetooth, is not a device in HA I can’t pause the media and announce the post and then continue the media; that would have been my preferred method of course.
So my next best thought was to check if any media is currently playing on either my computer or phone, it should sort of pause/queue the announcement until it stopped.
Any idea how to accomplish this in a simple manner?