Google Music in HA -- Now as a media player!

Try portainer

Dave…
docker exec homeassistant /bin/bash
(I think) from ssh…

I’ve installed the Portainer add-on and can see the Image for gmusic proxy… no idea where to from there

No luck with that:

~ $ docker exec home assistant /bin/bash
-bash: docker: command not found

You need to do it via ssh to the host… it’s impossible that you don’t have a docker command.

Note no space in homeassistant- auto mangle…

Docker exec -it homeassistant /bin/bash

I was missing the -it… but it should not give the error you reported…

solution at 3° post (mikkajo)

Are you referring to the gmusicproxy url? If your not using gmusicproxy, I recommend that you give that try first – It is possible that alone could fix your issue – You will likely need gmusicproxy anyways to prevent tracks from cutting off in the middle of a song


If that does not work…

From my point, it is easier to add the local setting for the Oauth login – I still can not say if the local setting will even fix the url issue ( hopefully gmusicproxy will fix ) I switch to using Oauth login about year ago and it does work with 2-factor enabled. But now, I’m having a hard time switching my account back the username and password login :thinking: I’m not going to be able to test the local setting with the username login unless I can figure out why it stopped working for me. Honestly instead of troubleshooting my own username login, I would rather help you get an Oauth login setup - If it is somehow possible

The difficulty switching to Oauth comes when trying to creating the Oauth Credentials file ( you only need to create this file once ) Creating the file itself if not terrible but I only know how to do it using the command line. If you are running Home Assistant Core in a virtualenv, I can help you create this file – But I can not help most people because I do not use the former named HassIO or any kind of docker setup. You would somehow need to get to the command line of the actual container that is running HA and I do not know how to help with that.

Another option, if you have a Linux computer, it is also possible to create a temporary virtualenv with gmusicapi installed and use that to create the Oauth Credentials file. That credentials files can then be copied to HA and used by gmusic_player.

Another option, if you have a Linux computer

I have the ‘HassIO’ running in docker, on a Linux computer, so I have a Linux computer. I only hope I’m advanced enough to follow the instructions (I’m not that good, but keep that quite :wink: )

I have setup gmusic component as per instructions
But it only showing on off
And few automations
I also added input sources to gmusic_config but my sources media player doesnt showing in sources , i have gmusic paid subscription
Whenever i start gmusic this msg popups (when click on turn on and off) its showing off by default)

Failed to call service homeassistant/turn_on. Unable to find service input_select/turn_on

Failed to call service homeassistant/turn_off. Unable to find service input_select/turn_off

Playlist and my radio not fetching, but my account configuration is correct.
Help me plz

The is alot going wrong here – Please completely remove the gmusic_player, including removal of both package files – and then restart Home Assistant before you try again.

Please try again - Please get new downloads of both package file.

Set your speakers in gmusic_config.yaml

## Use this 'package.yaml' file to configure "gmusic_player"
media_player:
  - platform: gmusic_player
    device_id: !secret gmusic_device_id
    username: !secret gmusic_username
    password: !secret gmusic_password
      
    ## Add your media_players below
    speakers: # Example media_players
      - bedroom_stereo
      - workshop_stereo
      
    ## Optional: enable streaming from gmusicproxy (Workaround for issue #6)
    ## https://github.com/tprelog/homeassistant-gmusic_player/issues/6
    #gmusicproxy: !secret gmusic_proxy

Do not edit - gmusic_player.yaml


After new packages files are placed

  • Reinstall gmusic_player
  • Restart HA

HA 0.107 changes everything! - more on that in a later post


Just to recap - I have mentioned this a few places before

You see I am not a programmer. Honestly my only initial intention was just trying to keep the original gmusic switch working. I never thought I would even get this far. So bottom line is, getting gmusic to work in HA is my first attempt at any Object Oriented Programming, learning Python general, and creating a custom component for HA. I’m also not the smartest, so learning all these things from the internet is a slow for me.

I do want to keep working and moving forward with this, I just can’t do it as quick as I would like


With most of the world on pause right now, I have some free time to revisit learning python.

I still have more questions than answers but I’m happy to report I’m making some progress.

Click HERE to see spoiler

image

image

image

image

image

3 Likes

With the patience and help of @christophe.vandingel - I have finally been able to track this down. It seems to be an issue, when the track id contains a hyphen ( - ) it needs to be in quotes

  • "36b2a8ac-8bd3-3894-ac9a-8c0ece109748"

If your having this issue you can update to the latest master version using HACS to see if it helps
( Hint: Select master from the drop down menu )

:man_facepalming: Completely forgot… media_player.media_play will do what you want

  • It will turn on and start playing using whatever selections are currently made
  • entity_id: media_player.gmusic_player
1 Like

Does the Next/Previous buttons work for anyone?

Edit: I’m not sure if I am in the right forum, is this for Google Minis as players?

I think your in the wrong place but

If you are trying to use gmusic_player

There will only be working next/previous buttons for media_player.gmusic_player → It will not add these controls to the speaker ( media player ) it is connected to.

I created a group in the Google Home app that includes two chromecast audios however I can’t seem to get it added to Home Assistant. Is it possible to to do this so I can play Google Music to multiple speakers?

I actually have the same setup. I’m sorry I can’t really offer an advice on getting the group to show up in HA. I couldn’t say if it is even HA related. In my case I think the problem was my network. My network is all Ubiquiti gear. At one point I upgraded my Cloud Key ( Just a device that run the Unifi software ) anyways, with that upgrade my chromecast groups suddenly appeared in Home Assistant.

I am able to play to my chromecast group with gmusic_player but the group must show up as a media_player in Home Assistant first. You then need to add that group to your list of speakers in gmusic_config.yaml, just like you added your other media players. – To be clear, this step is only for gmusic_player. It will not help HA see the group, sorry I can’t help with that part,

Hmmm, that’s funny, I am also using Ubiquiti gear although not the cloud key. Hopefully maybe it will suddenly show up one day.

I’m guessing it something to do more with the software than the hardware it’s running on. Outside of HA but still related to chromecast discovery… My phone has never had a problem connecting to a cast device on my network. For a while after I installed unifi I was also able to see and cast to my devices from my hard wired, desktop computer.

At some point my cast devices stopped showing up to my desktop computer – Just as a matter of fact, When the cast group appeared in HA, my desktop computer was able to see all cast devices again as well

You can definitely do this, I have multiple groups of speakers set up so I can choose which areas of the house to play music. You need to have discovery: enabled for the Google speaker groups to show up in HA