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

hey all,
just checking in very quickly to tell you that I am currenty sick and can’t help out with any support questions (very hard otherwise too).

I hope others with knowledge will step up and help out

Have you tried the unique username on the Spotify user panel?

1 Like

Same problem here new login email everytime i trigger. :frowning:

Hope you get better @fondberg

1 Like

We all hope you get better soon!

1 Like

Question regarding this component.
Can I use it with Amazon echo devices? I have installed Alexa media player in hassio which is working (if devices are not in standby). I’ve installed this component, and when i try to start it, i get 404 error. I’m sure that i’m doing something wrong, but i can’t figure what.


Can somebody give me some ideas? Thank you
@fondberg Get well soon

This is only for Chromecast devices. Amazon Echo devices you can call with the normal Spotify component. Simply select it as the source

1 Like

Thank you @AlmostSerious i’ve managed to do it with Spotify component. I had an issue with it until today, that’s why I tried this component (spotcast), but i managed to fix it with a ssh command. Thank again.

Hi @fondberg. First of all, thanks for working on this component. :slight_smile:

I have just installed it, but when i execute the spotcast.start service with this data:

entity_id: media_player.gh_cocina
uri: 'spotify:playlist:2zMHcb4y0hT82xARlWkV4y'

I got an error. I have put the logs of the custom in debug:

20-03-28 01:40:09 DEBUG (MainThread) [custom_components.spotcast] cast info: None
2020-03-28 01:40:09 ERROR (MainThread) [custom_components.spotcast] Could not find device Google Nest Mini Cocina from hass.data, falling back to pychromecast scan
2020-03-28 01:40:18 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1846910704] Could not find device with name Google Nest Mini Cocina
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 1234, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1257, in _execute_service
    await handler.func(service_call)
  File "/config/custom_components/spotcast/__init__.py", line 182, 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 237, in __init__
    self.castDevice = self.getChromecastDevice(device_name)
  File "/config/custom_components/spotcast/__init__.py", line 263, in getChromecastDevice
    raise HomeAssistantError('Could not find device with name {}'.format(device_name))
homeassistant.exceptions.HomeAssistantError: Could not find device with name Google Nest Mini Cocina

What i am doing wrong??

I’m using the v2.8.0

I think entity_id is broken. Try with device_name

Hi guys, since the last update I am not able to spread spotify contents to my chromecast speakers anymore. What has been changed and do u know how to fix it? Thanks!

This is the script I am running:

play_festival:
alias: Play Spotify on Riva Festival
sequence:

  • data:
    device_name: RIVA FESTIVAL
    transfer_playback: true
    service: spotcast.start

you need to include debug logs and the version of HA and spotcast you are using. Nothing has changed. Reboot your cast device usually does the trick (some are notorious for loosing the DHCP ip)

I don’t know why, but after updating spotcast the Spotify Component stopped working.
If I select a device inside the device list I see an error like this:

Fallita chiamata a servizio spotcast/start . Could not find device with name Google Home Soggiorno

Log:

Logger: homeassistant.components.websocket_api.http.connection.1837092592
Source: custom_components/spotcast/__init__.py:256
Integration: websocket_api ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 30 marzo 2020, 23:42:46 (2 occurrences)
Last logged: 0:00:29

Could not find device with name Google Home Soggiorno

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 1234, in async_call await asyncio.shield(self._execute_service(handler, service_call)) File "/usr/src/homeassistant/homeassistant/core.py", line 1261, in _execute_service await self._hass.async_add_executor_job(handler.func, service_call) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/spotcast/__init__.py", line 176, 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 230, in __init__ self.castDevice = self.getChromecastDevice(device_name) File "/config/custom_components/spotcast/__init__.py", line 256, in getChromecastDevice raise HomeAssistantError('Could not find device with name {}'.format(device_name)) homeassistant.exceptions.HomeAssistantError: Could not find device with name Google Home Soggiorno

Spotcast, Spotify component and Home assistant are updated to the last stable release.

I understand the problem. if I rename the device it doesn’t work. I need to leave the default names.
There is a possibility to add a fix to make it work also with a renamed device?
Thanks

Is there any option to invoke with spotcast without playlist/track/artist?

In my case, with Google Home, when i send a tts and the music was playing, it stops the music. After that, if i tell “Ok google, play music”, the playlist continue at the point where it stops.

I would be perfect to invoke spotcast in order to continue a playlist stopped, instead of starting again.

You can send a start command without uri and possibly add force_playback to start playing tha last played

When looking at the Spotify Developer Dashboard for the “Home Assistant” application I have created there to use this component, I see in the graphs that the number of requests are in the thousands per day despite not having used the component recently.
Do you know if these are normal numbers or if something might be configured wrong?

Spotcast should not show up in dev console as it doesn’t use the web api token.
The builtin spotify component does minimum 2 requests per minute to get the player state. But that is only around 280 requests per day.
One thing which does quite a lot of requests is the spotify card (also my project). It refreshes the state every 10 seconds.
Do you use it?

Do you mean rename the device as in the actual chromecast device and renaming it using google apps or renaming the device in HA?

What device list? Spotcast doesn’t have a device list…

Hi, I just installed Spotcast and I am trying to start a Spotify playlist on on of my Chrome Cast devices. Using the service tab:

service

Nothing happens. Then I go check the logs and I see this:
error

My Master Bedroom Chromecast device works just fine:

chrome

Did I do something wrong here? Any help would be much appreciated!!
Thank you in advance!