For me the killer use for google home is playing audio to chromecast audio. In the past I’ve wired audio to rooms with volume controls, set up harmony hub/remotes, and used chromecast to make what were for ME easy to use options for audio. “Click this button on the harmony remote to pick the right zone, then get your phone and chromecast to it” - seemed easy. But frankly, not easy enough for the family.
The google home devices really made it so much easier. Except for a few annoying things - you typically have to know the names of specific outputs, and if using an AVR with a chromecast attached - UGH people are listening to audio on google home when there’s a nice audio setup in the same room. What is wrong with people, don’t they CARE?
No, my wife and kid don’t care about that. But let’s face it, I watch movies and get weird about sitting in the sweet spot. When I was single, a marker of a serious relationship was fixing their TV video setup (omg, you have it in stretch mode - or omg, you are using RCA cables instead of s-video … I’m old). So, dammit that is not good enough for me.
With google home’s new (to me) “preferred speaker” option, harmony hub, and home assistant I’ve finally made my life complete. Alright, maybe that’s a stretch.
It’s simple, but here’s a software solution for things that otherwise would require some annoying hardware work (voltage triggered inputs?)
First, I set the google home preferred speaker to my chromecast plugged into my AVR. My google home is named living_room_home. My harmony hub has a cleverly named “Music” activity that sets the AVR input to the chromecast.
This automation detects my chromecast audio (called living_room_speaker) changing to the play state. If the harmony hub is already in the music activity, well, ok don’t do anything. If the harmony hub remote state is PowerOff (meaning no one’s using the TV/AVR because god forbid you use the original remote and not the harmony, are you an ANIMAL?), then run a script living_room_music that starts the Music activity. Otherwise, warn people what is up.
The automation:
- id: living_room_cast
alias: Living Room Cast
trigger:
platform: state
entity_id: media_player.living_room_speaker
to: 'playing'
condition:
condition: template
value_template: '{{ states.remote.harmony_hub.attributes.current_activity != "Music" }}'
action:
- service: script.turn_on
data_template:
entity_id: >-
{% if states.remote.harmony_hub.attributes.current_activity == "PowerOff" %}
script.living_room_music
{% else %}
script.warn_living_room_music
{% endif %}
Script ‘living_room_music’
living_room_music:
alias: Living Room Music
sequence:
- service: remote.turn_on
entity_id: remote.harmony_hub
data:
activity: 'Music'
Warning script. What’s the point of this eh? Well, I could just always force the input over the chromecast, and if you live alone, go for it! But if not, it’s nice to be nice. Plus the robot google tts english to english translate voice is creepy and entertaining.
warn_living_room_music:
alias: Warn Living Room Music
sequence:
- service: tts.google_say
entity_id: media_player.living_room_home
data:
message: 'Press the music button on remote to play music.'
Finally, I just added this last automation but have not tested it. If I tell the google home to play music but then never actually listen to it I want to stop the stream. If we’re in that state for 7 minutes, turn the stupid thing off.
- id: unused_living_room_cast
alias: Unused living room cast
trigger:
platform: state
entity_id: media_player.living_room_speaker
to: 'playing'
for:
minutes: 7
condition:
condition: template
value_template: '{{ states.remote.harmony_hub.attributes.current_activity != "Music" }}'
action:
- service: media_player.turn_off
entity_id: media_player.living_room_speaker
Is this a life changing event? No. But very satisfying.