Google music in HA

@Danielhiversen any update for this component?

Would love to have this component the default installation of HA.

2 Likes

Trying to get it set up. When I turn on the switch to play - give the following warning and turns off. Any ideas guys?
WARNING (Thread-1) [homeassistant.helpers.entity] 'update_ha_state' is deprecated. Use 'schedule_update_ha_state' instead.

I’m not seeing any of the auto-generated playlists (i.e. thumbs up). Any way to include those?

@Danielhiversen really lovely component! thanks.

Does anyone know where I went wrong in setting this up? I have the input select components created properly but I am getting the error in the logbook saying “cannot setup switch.gmusic”. I’ve run the script in the above thread and it returns true, and I have “playlist: music” set up in my config. I am on 0.47.1 and I was able to set up the test hello world custom component without any trouble. Any ideas?

@Danielhiversen it seems that the script isn’t executable for me, as I keep getting “importerror: no module named asyncio”. I’m able to use Mobileclient in ipython, but I can’t get the script to work. I have python installed

I also struggled with this in the begining, being very new to this platform.

Some tips to get it working:

  • Put the gmusic.py into a folder <config directory>/custom_components/switch
  • Make sure that custom_components/switch is owned by homeassistant (the command sudo chown -R homeassistant:homeassistant custom_components with gmusic.py already in there, should do the trick.

@Danielhiversen
Indeed, thanks a lot for this platform. Is there any way to select something else than a playlist, and are you planning to look into it? To be sure, I’m not trying to push or ask for additional features, it would just be interesting to know if you’re planning to expand this.

Kind regards,
Erwin

I do not have any plans to add any features to the component. But you or someone else are welcome to contribute.

I wish I had the knowledge to do so :stuck_out_tongue: Unfortunatly, I’m not really a programmer. But good to know, than we take this script from you as is.

Just to know, can it be done using to the gmusicapi?

Kind Regards,
Erwin

Thanks @ErwinP, unfortunately that didn’t work. I tried the chown command with pi, as homeassistant isn’t valid username for me. The script is working fine (I was dumb and running it with python, not python3). My path is /home/pi/.homeassistan/custom_components, so I tried sudo chown pi -R /home/pi/.homeassistan/custom_components but that didn’t help matters

Edit: I got the switch to show up in HASS. I didn’t realize that I had to have switch directory in the custom_component dir as well.

Would be great to see this ported as a hass.io container as well!

3 Likes

I would love that too!
@Danielhiversen: would you consider turning this into a Hass.io add-on?
Thanks!
B

1 Like

thanks a lot …works just perfect!
only thing that didn’t work was the login. I’m using two-factor-auth and had to create an app password https://myaccount.google.com/apppasswords and use it instead of my google account password.
JKW

1 Like

I am not using hass.io, so do not plan to do so

just to mention it: i’ve created a modified version of you code that will create a google music radio, based on the selected list and stream that to my chromcast … still 98% your code, so thanks again
JKW
https://github.com/KoljaWindeler/ESP8266_mqtt_pwm_pir_temp/blob/master/HA/custom_components/switch/gmusic_radio.py

2 Likes

Hello Every one i am making ios app by using rm pro and tc2 switch but i am unable to communicate them so any one who work on this tell me thanks in advace

@JKW
Hi
Does it work to select either playlists or radio stations? It seems to select only playlists

it will CREATE a radio station based on the selected playlist and play it
JKW

Now it does sound logic (I assumed initially it would feed the list of radio stations created in the account similar to the playlists)

Thanks

Really a great addition to my HA, thank you very much! But I got minor issue and was wondering if this has been happening to anybody else:

Sometimes when listening to a playlist the player will skip to next track midway in the current track. I have not been able to reproduce this issue as it will only happen sometimes. Did this happen to anyone else?