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

Thank you for that… but I think that somehow just updated the default values to loading :stuck_out_tongue:

I think somehow the plugin isn’t connecting to Google Music. I had a look at the connection values for the app login. Just to confirm this is the right format?

gmusic_username: [email protected]
gmusic_password: werfrandomcrapewld
gmusic_device_id: some:11222111-2222-1111-2222-112211122211

2020-08-02 at 19.05

You need to use an android device id

gmusic_device_id: some:11222111-2222-1111-2222-112211122211

should look something like

gmusic_device_id: "3d123400daee56ff"

you can use the following to get a list of all your valid device ids, but only the 16-digit android one will work with gmusic player – You should see the device ids in the logs, they are printed in an error message

gmusic_device_id: "00"
1 Like

AHA! Ok. I did do that check to get my original device ID… BUUUT. I’m one of those Mac fanboys when it comes to mobile phones… haha. I ended up logging into my google acct on my fiances android phone & then tried to setup an app password from there… but I only get the options below… google also doesn’t seem to have a lot of context on how to get an android app password.

That being said, thank you for help so far.

Update
I looked at the plugin code you wrote & saw this lib linked in the comments.
https://unofficial-google-music-api.readthedocs.io/en/latest/reference/mobileclient.html

I think the only option I have is to setup oauth :stuck_out_tongue: since the other 2 login methods also use the device_id

Update 2
Any advice on how to setup google oauth? My google fu isn’t returning any decent results, so I’m stuck in the dark yet again.

Update 3
Found it… Installed this python package.

and then ran. google-music-auth ./oauth

Time of death…

gmusicapi.exceptions.CallFailure: GetDeviceManagementInfo: 403 Client Error: Forbidden for url: https...

Seems to do with the internals of the auth mechanic When not supplying an actual device ID… the lib uses something called the FROM_MAC_ADDRESS value, which doesn’t seem to be reliable.

Ok I learned a bit from this… but I don’t think its worth pursuing this route much further. I believe the easiest would be to get a throw away android device that can sleep in my cupboard :stuck_out_tongue:

you can try https://github.com/miikkajo/gmusicproxy to generate token with,
it has working oauth login in it

3 Likes

Gmusic works very well in HA with your proxy and Troy’s component (no timeouts or track skipping).

Sole worry is what will happen once support for Gmusic ends :frowning:

1 Like

Offtopic, does anyone intend to make a custom component for TIDAL?

It’s not the easiest approach - but I’m using a device id from an Amazon Fire 7 tablet. For some added value, you can also install Fully-Kiosk or WallPanel to make further use of the tablet.

:frowning: The end is near

Can anybody make a suggestion for a beginner based, on-line Python course? I can’t make any promises but there are several possibilities to revive this in the future.

1 Like

I’m trying to play a playlist in an automation without shuffle but it always shuffles. How can I get it to play from track 1 onwards?

I’ve tried with the shuffle: false as data for the play script.

@OptimusGREEN – I don’t think I ever got the shuffle mode working the way I intended

From the services page, please try media_player.shuffle_set

entity_id: media_player.gmusic_player
shuffle: false

I think because it’s buggy, you might need to reload the playlist after you set shuffle: false

ideal, thats it working. thanks very much

expected a dictionary for dictionary value @ data['packages']['media_player']

can someone help ;/

just a thought that hit me… anyone have an contingency plan when gmusic finally hits the grave?

just found: Youtube Music - Media Browser

resp. https://github.com/sigma67/ytmusicapi

lets hope for the best…

1 Like

There’s also a drop of hope here (but there hasn’t been any activity yet): gmusicproxy - Migrate to YouTube Music - If that happened, I might be able to make this work, since we can already play from gmusicproxy.

Honestly though, with every new release of Home Assistant, I think the more this needs this refactored from the ground up. I’d still hope someone who actually knows python will write a new integration for YouTube Music, that can also take advantage of the new media browser capabilities in Home Assistant

1 Like

It’s happening…

I have received the first report, this has stopped working due to the Google Music shutdown :sob:

I’m no help as I can’t code but I have glanced over these:
https://ytmusicapi.readthedocs.io/en/latest/

Any way they can help with a migration from Gmusic to YTM? (now seeing one has been linked already)

Hi all,

I keep getting the “Failed legacy log in, check http://unofficial-google-music-api.readthedocs.io/en/latest/reference/mobileclient.html#gmusicapi.clients.Mobileclient.login” when I login. I have created an App-password for 2FA, but still it fails.
I also tried the properties for username and password with and without ‘quotes’. No change

Can you point me in the right direction?

What can I be missing?

I installed via HACS and changed the config file:

gmusic_player.yaml:

media_player:
  - platform: gmusic_player
    device_id: 00
    username: my_google_music_account_name
    password: app_password_provided_by_google

:warning: Do not install this component

Google Music will be completely shutdown by December 2020
This component will stop working at that time.

UPDATE: 12/05/2020

Have a look at this great replacement by @JKW

1 Like

Locking this thread at OP’s request because Google Music is shut down. See the replacement in the post above this.

1 Like