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

@Padrone56 Welcome :slightly_smiling_face:

:thinking: I had a look at your pictures on github. I have a guess… can you try to start playback using media_player.play_media from the services page.

Based on you pictures try one or both

playlist

entity_id: media_player.gmusic_player
media_content_id: .Koreaboo
media_content_type: playlist

station

entity_id: media_player.gmusic_player
media_content_id: I'm Feeling Lucky
media_content_type: station

No luck :confused:

image

I call this, but nothing happens and the logs are clean. The player just stays turned off.

This is my first custom component install, so I feel like I might’ve botched the installation or something. Does the Music Player require anything else to be installed?

I have a Kodi media player and it works fine. Have you setup your player correctly in gmusic_config.yaml

input_select:
  gmusic_player_speakers:
    name: Speakers
    icon: mdi:speaker
    ## Add your media_players below
    options: # Example media_players
    - mibox3
    - lounge_speaker
    - kodi

@troy I tried that, both commands, no luck :frowning:

@slipx06 Yup, here is my gmusic_config.yaml

media_player:
  - platform: gmusic_player
    username: < Username/email >
    password: < App Password, cause I have 2FactorAuth >
    device_id: 300b9038d4df4e61

input_select:
  gmusic_player_speakers:
    name: Speakers
    icon: mdi:speaker
    ## Add your media_players below
    options: # Example media_players
    - mediacenter

And this is my kodi config in configuration.yaml:

..
media_player:
  - platform: kodi
    name: mediacenter
    host: 192.168.0.101
..

I’m about to just try reinstalling the component

Hmmmm, okay, something is up. My kodi turned off due to power-saving, and now suddenly the player is playing to nothing

Power off at 5:26PM

Playback starts at 5:26PM
image

Sorry your having such a hard time with this. I can’t figure out why there is no error messages. Have you tried viewing the logs directly? I mean look at the actual log file itself. I think looking at the log from HA, you will only see a message if something actually triggers an error. I’m just wondering if there might be some logging going on that for whatever reason is just not being treated like an error (which means you don’t see it in HA)

And this is my first custom component. And it’s really more of a hack and expand job on the original gmusic_switch. There are some people using this with no issue but it’s still just as possible that your problem is caused by my lack of real programming skills. Gmusic Player can also stream from a locally running gmusicproxy but that is a workaround for skipping tracks. gproxy should not be required for the music player to function.

If you’re just troubleshooting, you can give Chromecast Radio a try. It’s basically the same thing, just different – Seriously it uses to same methods to start playback on a device, it’s just playing web radio-streams. I don’t really know anything about the stream (if there restricted to certain areas) but I grabbed the first one from the list.

Might even be able to just try a one off example to check on Kodi.

media_player.play_media

entity_id: media_player.mediacenter
media_content_id: http://vip-icecast.538.lw.triple-it.nl:80/RADIO538_MP3
media_content_type: 'audio/mp4'

I’m trying to resolve the song skipping ahead early issue. I’m running hass.io on a raspberry pi. Will I be able to use the gmusicproxy add-on http://hassio.local:8123/hassio/addon/32961a28_gmusicproxy? Would I need to install docker on the PI?

Im unable to follow your link but

Sorry I’m still running HA old school in a virtualenv. I don’t have anything docker or hassio related so I can’t say forsure but I think this just needs hassio. Plus I thought hassio is always docker. Just the OS running docker can changes ( Ubuntu , hassOS … )

Maybe at @miikkajo can offer some advice on your docker question

Hi, if you are running hassio, you are already running docker and you should be able to add add-ons.
install process is documented on:

feel free to contact if you need help

1 Like

Is there any way to use two different GPM accounts with this? My wife and I both have different playlists!

No, sorry that is something still over my skill level. I haven’t had the time to put into learning python as I had hoped. I’m still very much a beginner

No worries. I was thinking I might be able to add a second custom component with custom names

That could probably work.

I used this, my appdaemon version and the original gmusic switch all at the same time without any issues. Now in my case, I was logged in to the same account, 3 times at once using the exact same login and device id. The only restriction that always applies was that I could only stream music from one login at a time.

So I think that proves you could have multiple gmusic_players installed as you stated, they would need different name. In you case because of seperate logins I think it could work and you can both play music at once

This was my problem too for days! Thanks for the help.

I installed it yesterday, I had to put my players inside quotes for it to pick them up, is picks up the name of the Playlist that I have on Google Play Music but it does not play, it just makes to Google home speaker sound and switch off, the one that works is the station and only “I’m feeling lucky station” it does not pick up the other stations I downloaded to library. On Playlist it does not show the Playlist cover and it does not play, on station it shows and plays a song from I’m feeling lucky station, I also want to know if I can play this via an automation.

Anything in the logs when you try to play from a playlist?

Usually this is because of using the wrong type of device id –
For example a long device id like this will not work

"c0647000ae52d68000e3fbe08a559a000098b500007a00000556cd89be290007"

Make sure your using an android device id. It should be something shorter like this.

    device_id: "21150e2000000456"

It is strange the stations works but not playlist, I’ve never seen that before. But why only one station? :thinking: I know that “I’m feeling lucky” shows up because I add that from gmusic player itself.

You say you downloaded stations to your library – Do you mean added them to your library? – For example from the Google Music website – you need to add stations to your library or they will not show up in gmusic player.


Short answer is yes – but I’m sorry I don’t have a copy paste example I can provide to you.

Basically you just set the input select to the speakers you want see post here for an example
and the post just below is how someone set the speakers using Node-RED.

Once the speaker are set you can use the medai_player service to control like you control any other service from an automation. ( The first post has media_player services and how they work in gmusic_player ) but the main thing to start playing a certain playlist or station is this.

Thanks, how do I make the play ists play, the stations play but the songs advance faster, I am busy setting up gmusicproxy, so in summary here are my issues:

1.playlists not playing,
2. Which url to use for gmusic proxy, currently using the hassio one but this has stopped even the stations from playing, see attatched yaml

Seems the gmusicproxy has had the negative effect, the stations no longer play, but after removing it, they play again, but advance before the song ends, I also still have the issue with play lists

yes you are on the right path – gmusicproxy is the only solution to stop songs from advancing to fast.

Your yaml looks correct to me. I’m sorry I do not use anything docker or hassio related so I can not be of much help here. ( I run Home Assistant Core on FreeNAS )

Are there any errors produced in the Home Assistant log when you try to play a song from a playlist.

This seems to be the error:


Sun Feb 16 2020 20:07:49 GMT+0200 (South Africa Standard Time)

Out of range! Number of tracks in track_queue == (0)```