Google Assistant Merge/Hide Media Players

Just wondered if anyone had come up with a smart way to merge or hide inactive Google Homes in HA?
I now have 3 Google Homes and want a couple more to cover the whole house. They work awesome with HA (even my wife approves).
We have a couple of speaker groups setup such as downstairs, upstairs, whole house etc and the issue is every group shows in HA as a separate media player in either an off or unavailable state.

I have a view for my living room with 3 Google Assistant media players (the device itself plus downstairs and whole house groups).

I’ve played with universal media player and it seems to take the state of the group speakers of unavailable when the main device is in a off state.

Best middle ground I’ve found is this…

https://github.com/c727/home-assistant-mini-media-player

Then they can be added to a card(s) that don’t take up much space, mine…

5 Likes

Thanks that’s way better than all the big cards

1 Like

Any chance you can share the configuration yaml you use to do that? The link is a bit cryptic…

Have you seen the sample configuration.yaml file on the github page? That’s what got me up and running

Yes I have but I don’t use multiple views and scripts etc and it references HTML files. It’s not clear how to put those media players in a group… or maybe it’s just the standard way? I might give that a go.

It just make the card’s smaller. You can just group them in the same way you would anything else.

My configuration is all on my GitHub…

link removed

The package that makes the media players is

link removed

And the custom state cards are in the www/custom_ui directory.

Hope this helps.

This is what i ended up with. Mostly the same as what @anon43302295 posted but I changed the input_text icon so if it’s unavailable on HA startup I don’t get that input text icon.
I’ve also made the media_player icons different for the speakers and speaker groups as a easy way to tell the difference

homeassistant:
  customize:
#------------------------State Card----------------------#
  #Speakers
    input_text.gh_kitchen:
      custom_ui_state_card: state-card-mini-media-player
      config:
        player: media_player.kitchen_speaker
        
    input_text.gh_living_room:
      custom_ui_state_card: state-card-mini-media-player
      config:
        player: media_player.living_room_speaker
        
    input_text.gh_bedroom:
      custom_ui_state_card: state-card-mini-media-player
      config:
        player: media_player.bedroom_speaker
        
  #Speaker Groups
    input_text.gh_everywhere:
      custom_ui_state_card: state-card-mini-media-player
      config:
        player: media_player.everywhere
        
    input_text.gh_downstairs:
      custom_ui_state_card: state-card-mini-media-player
      config:
        player: media_player.downstairs
        
#------------------------Icons----------------------#     
  #Speakers   
    media_player.living_room_speaker:
      icon: mdi:google-home
      
    media_player.kitchen_speaker:
      icon: mdi:google-home
      
    media_player.bedroom_speaker:
      icon: mdi:google-home
  #Speaker Groups  
    media_player.downstairs:
      icon: mdi:speaker-wireless
    media_player.everywhere:
      icon: mdi:speaker-wireless

frontend:
  extra_html_url:
    - /local/custom_ui/state-card-mini-media-player.html
  extra_html_url_es5:
    - /local/custom_ui/state-card-mini-media-player_es5.html


input_text:
#speakers
  gh_kitchen:
    name: 'Kitchen'
    icon: mdi:cancel
  gh_living_room:
    name: 'Living Room'
    icon: mdi:cancel
  gh_bedroom:
    name: 'Bedroom'

#speaker groups
  gh_everywhere:
    name: 'Everywhere'
    icon: mdi:cancel
  gh_downstairs:
    icon: mdi:cancel

#------------------------Group----------------------#
group:
  google_home:
    name: 'Google Home'
    control: hidden
    icon: mdi:google-home
    entities:
      - input_text.gh_kitchen
      - input_text.gh_living_room
      - input_text.gh_bedroom
      - input_text.gh_downstairs
      - input_text.gh_everywhere
2 Likes

This was working perfectly for me until I upgraded to 0.70. Now I only get the group heading with no media players and I have several of these errors in my log:

http:// 192.168.1.xxx:8123/frontend_latest/app-653721033e62144d6a686dab25ef1429.js:2:12049 Uncaught TypeError: Cannot read property ‘computeStateName’ of undefined

Not upgraded myself yet but have you checked the repository there was a fix applied 11 days ago for HA 0.70

Any idea how I change it so that the standard media player more info is shown:
17%20pm
rather than the cut down version:
20%20pm
(which has no title, and needs be ‘escaped’ to close)

As an aside, I get the following error now and then:

myserverlocal/custom_ui/state-card-mini-media-player_es5.html:208:44 Uncaught TypeError: this.root.getElementById(...).open is not a function

I also noticed that viewing this card on a mobile browser, has some scaling issues - the card doesn’t seem to resize to the smaller native display…

(or do I move to lovelace?)