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

I upgraded HACS to 0.14.2 an hour ago or so. So I am already running on that version.

https://github.com/custom-components/hacs/issues/new?template=issue.md then :wink:

1 Like

I saw the .DS_store sneeked in. I removed it and will do a new release tomorrow as I canā€™t do it on mobile for some reason (girhub hides it I guess)

1 Like

Iā€™ve now released 2.2 which should work with HACS (deleted the .DS_Store). I donā€™t know if it fixes it yet because I need to upgrade HACS and wait for it to update the data.
If some kind soul can test it and update it here I would be greatful as I need to rush away for some hours

It works for HACS 0.14.2 at least, but so does 2.1 so that was probably not a good test :confused:

1 Like

2.1 didnā€™t work to me on hacs 14.2 BUT 2.2 does. So great work! :slight_smile:

2 Likes

2.2 works fine! Thanks!

1 Like

Great job on this custom component! New shuffle and " transfer current playback" is great!

1 Like

Thanks for the nice feedback. There is a hidden feature Iā€™m random playlist if you are interested (search this topic. It is not that secret :wink:

If everybody that liked the component can star it on github it would be great

1 Like

Ahhh. Thanks for the tip. Random playlist may be useful. Why isnt it documented?

@fondberg hey mate! First, thanks a lot for the awesome work. This component is a game changer.

On to the bad stuff:
Is there any issue with the component on the latest release of Hassio? Iā€™ve been getting this error: "name='wp_access_token', domain=None, path=None" whenever I try to use spotcast.start, on previously tested and working stuff.

Cheers!

@vlad.bisceanu I have the same issue, driving me nuts. @fondberg what to do?
Running hass.io 0.99.3 and spotcast 2.2

Tbh I think this might be related to Spotify making a change, rather than this component. Iā€™ve just today noticed that the Spotify player doesnā€™t show any cast devices on my network anymore as options to cast to.

@Catt00 can you check and see if this is also true for you?

Cheers!

My SpotifyConnect devices are working and showing as before. And no errors when i playing on those.

Same problem here, running Hass.io 0.99.3 and spotcast 2.2.

This is the full traceback:

"name='wp_access_token', domain=None, path=None"
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, 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 1259, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 142, in service_handler
    await script.async_turn_on(variables=service.data, context=service.context)
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 214, in async_turn_on
    raise err
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 209, in async_turn_on
    await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 162, in async_run
    await self._handle_action(action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 246, in _handle_action
    await self._actions[_determine_action(action)](action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 329, in _async_call_service
    context=context,
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 98, in async_call_from_config
    domain, service_name, service_data, blocking=blocking, context=context
  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 162, in start_casting
    access_token, expires = get_spotify_token(username=user, password=pwd)
  File "/config/custom_components/spotcast/__init__.py", line 85, in get_spotify_token
    data = st.start_session(username, password)
  File "/usr/local/lib/python3.7/site-packages/spotify_token.py", line 70, in start_session
    access_token, expiration_date = _get_access_token(session, cookies)
  File "/usr/local/lib/python3.7/site-packages/spotify_token.py", line 42, in _get_access_token
    access_token = response.cookies['wp_access_token']
  File "/usr/local/lib/python3.7/site-packages/requests/cookies.py", line 328, in __getitem__
    return self._find_no_duplicates(name)
  File "/usr/local/lib/python3.7/site-packages/requests/cookies.py", line 399, in _find_no_duplicates
    raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='wp_access_token', domain=None, path=None"

Great component, thanks. The spotify app on Chromecast does not seem to load properly sometimes, or most of the times when it just starts. I see the Spotify logo and after a while the Chromecast goed back to the ā€˜desktopā€™ screen. I think it has to do with the Chromecast, and not this component. Does anyone has the same issue?
(If I relaunch the service call it show the Spotify logo again and it starts playing almost immediately)

Hi, I have a question, I love your component but the Spotify part is driving me crazy. Could I use your component with Google Music? Since I have google assistant webserver installed and working, could I use your component to start a playlist defined with this addon? I mean, can I give the order "http://localhassioip:5000/command?message=play%someplaylist%20% and somehow use your component to select where? I know I could include the rest of the instruction in the command, but I have almost 10 chromecasts + groups, so it would be better if I can send the ā€œwhereā€ part with your component. Tks

Thanks for a great component!

Getting similar errors as bruring and vlad.bisceanu mentions above.

Running .99.0 and have tried Spotcast 2.2 and 2.1

I have the same issue as Bruring and Vlad. I opened a issue on github. Feel free to add information there.

Hi, unfortunately some time over the last few days Spotcast has stopped working. It has been working flawlessly for ages. Iā€™m running Hassio 0.98 so I dont think it is the new Hassio. Not sure how to check which version of spotcast iā€™m running.

Cheers