Spotcast - custom component to start playback on an idle chromecast device

Meh, it doesn’t work because spotify free account, with premium and spotify-card it plays. But that error still persist in HA logs and media_player.spotify entity doesn’t exist.

I’m seeing a lot of bugs with entities with the latest update on different topics. I think I’ll hold out on updating from 102.3 (103 had a bug with Zwave Radiators and I had to roll back then).

Downgrading zeroconf (with custom component as I’m using Docker) didn’t solve the problem for me. It’s pychromecast that throws an error in the log.

Spotify-card and spotcast does not use mediaplayer SELECT_SOURCE so you must be following some old setup for the built in spotify mediaplayer

Anyone with the problem of Failed to connect, retrying in 5.0s should try this: balloob/pychromecast#332

Actually that is only a rewrite. The purpose of spotcast is to start playback on a chromecast which requires the more powerful browser login token. It has always been my goal to make spotcast redundant but that would require that the spotify integration in home assistant would make it possible to use the browser token which I doubt would happen as it is scraped and unofficial

Just released v.2.6.0 which pins the zero conf version to 0.24.3 which should make it work again. 0.24.4 didn’t contain that much so I think it is safe to use 0.24.3.
It is kind of a rewrite so please help test it.

And now 2.6.1 which should work with the normal zeroconf shipped with hass

2 Likes

It’s working over here! Thanks!

1 Like

Hi
Did you solve this issue ?

I upgrade now , and have same issue

Updating the custom component using the HACS panel to version 2.6.1 fixed it for me!

thanks @fondberg!

it works again with 2.6.1.

I have just a question : when i choose the player (i have 4 google home), each time it’s the first playlist that start and if i clik on “play” on another playlist, the “play” become green but a second after its the first “play” of the first playlist that come back green…in simple word, i cant choose to start a different playlist, except the first one…

Any idea?

Thanks

Did you mean to post this in spotify-card thread?
This component doesn’t have a UI…

1 Like

yes of course…sorry :wink:

Hey @fondberg

I was reading about https://github.com/home-assistant/home-assistant/pull/30717, and saw your comments to the new Spotify intergration (About the more “powerful” token via OAuth). However I don’t quite seem to understand whether this makes it possible to play playlists on idle chromecasts devices? Did you manage to understand that? Have a great weekend :smiley:

See Spotcast - custom component to start playback on an idle chromecast device

Thanks for this great component!

I have a question. The component did work great but since a few days I get the following error when I call the service: spotcast.start:

‘NoneType’ object has no attribute ‘host’

I use the latest version 2.6.1. Does anybody know what could be the problem?

Thanks in advance!

That is weird. Seems like it is similar to what 2.6.1 should fix.

Can you send the debug log after enabling debug on spotcast as well as what version of home assiatant you are running (or hassio version)

Hello all,
Thank you for the component @fondberg , it works great!!!

I am now experiencing a weird issue with the state of the media player on each cast sent. These are the steps to replicate the issue:

  1. The Google home is on ‘idle’ state and I call the spotcast.start service

  2. The Media Player changes its state to ‘off’ (instead to ‘playing’), but the music starts playing on the Google home:

Testing the issue, I have discovered that changing the source of the cast (sending spotify music with my cell phone instead of the HA service) the media player recovers the correct state ‘playing’. It could be related to the change of the internal app ID which the media_player handles: CC32E753 from Spotcast and other different app Id from my cell phone

Anyone knows about this topic or has a similar issue?
Thank you very much for your time

1 Like

Thank you for your response :grinning:
I run HA 104.3 (Hassio sv 195; HassOS 3.5).

This shows up in my log:

'NoneType' object has no attribute 'host'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
    await handler.func(service_call)
  File "/config/custom_components/spotcast/__init__.py", line 156, in start_casting
    spotify_cast_device = SpotifyCastDevice(hass, call.data.get(CONF_DEVICE_NAME), call.data.get(CONF_ENTITY_ID))
  File "/config/custom_components/spotcast/__init__.py", line 207, in __init__
    self.castDevice = self.getChromecastDevice(device_name)
  File "/config/custom_components/spotcast/__init__.py", line 218, in getChromecastDevice
    host = str(cast_info.host)
AttributeError: 'NoneType' object has no attribute 'host'