So, this is probably one of the most useless automations I've made in Home Assistant, but it's also one of my favourites.
If you've watched The Middle, you'll probably remember Brick Heck randomly going "WHOOP!" for absolutely no reason.
Somehow i got the idea to make my Google speaker randomly go whoop. So i went on youtube, found a clip containing the whoop, and cut out the audio. A little coding later we have Whoops blaring trough the house.
It's pretty simple. Every five minutes, Home Assistant rolls a random number. If it hits, and the speaker isn't already playing something, it plays a short recording of Brick's whoop. Only between 9 AM and 9 PM.
I've had it running for a few days now and I've genuinely startled myself quite a few times. You're just doing something around the house and suddenly... WHOOP.
The funny thing is, getting rid of that annoying Google Cast startup chime turned out to be more work than the actual automation.
It kind of ruins the surprise when the speaker announces that it's about to play something.
Eventually I got around it by muting the speaker, casting a five-second silent MP3 to wake up the Cast session, waiting a couple of seconds, then unmuting and playing the actual whoop.
Seems to work pretty well on my Nest Audio so far. No warning chime anymore.
Here's the automation if anyone wants to try it:
alias: Living Room - Random Brick Heck Whoop
triggers:
- trigger: time_pattern
minutes: "/5"
conditions:
- condition: time
after: "09:00:00"
before: "21:00:00"
- condition: state
entity_id: media_player.huiskamer
state:
- "off"
- "idle"
- condition: template
value_template: "{{ range(1, 101) | random <= 5 }}"
actions:
- action: media_player.volume_mute
target:
entity_id: media_player.huiskamer
data:
is_volume_muted: true
- delay:
milliseconds: 300
- action: media_player.play_media
target:
entity_id: media_player.huiskamer
data:
media_content_id: "media-source://media_source/local/silence_cast.mp3"
media_content_type: "audio/mpeg"
- wait_template: >
{{ is_state('media_player.huiskamer', 'playing') }}
timeout: "00:00:08"
continue_on_timeout: false
- delay:
seconds: 2
- action: media_player.volume_mute
target:
entity_id: media_player.huiskamer
data:
is_volume_muted: false
- delay:
milliseconds: 200
- action: media_player.play_media
target:
entity_id: media_player.huiskamer
data:
media_content_id: "media-source://media_source/local/Brick Heck whooping.m4a"
media_content_type: "audio/mp4"
mode: single
You'll need your own whoop clip and a five-second silent MP3 in the HA media folder. Obviously, change the media player entity to match yours.
One small caveat: if the silent Cast session fails to start, this version can leave the speaker muted. Hasn't happened to me so far, but worth keeping in mind.
I originally had the chance set to 15%, which works out to roughly 22 whoops a day if the speaker is always available. Turns out that's a bit much, even for Brick. I'm dropping it to 5% to keep the surprise.
For anyone who hasn't seen The Middle, here's Brick doing his thing.
Curious if anyone else has made similarly pointless automations just because they thought it would be funny.