I’m not sure if there is a bug in my code or the Spotify component, but so far it seems like it just ignores the source selection.
Observed behavior so far:
Nothing happens if i specify a Chromecast (have seen others with same problem)
If i specify my iPhone or iPad it simply just plays on the device last used by spotify, NOT the specified source, unless this this just happens to be the last used device.
This also goes for Chromecast’s, if I last used a chrome cast, then it plays there.
Maybe this error code is relevant, its been spitting out like crasy in my log.
2017-05-27 06:11:58 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.spotify fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
None, self.update)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/media_player/spotify.py", line 157, in update
devices = self._player.devices().get('devices')
AttributeError: 'NoneType' object has no attribute 'get'
The problem seems to be related to the dynamic nature of Spotify Connect, as far as I can tell the above error message is due to Spotify Connect “forgetting” all my devices.
Fixed this by opening spotify on my phone and iPad and then running the script again.
I don’t know if this can be fixed or if this is entirely an issue on Spotifys side.
I’m not a coder, sadly, so I don’t know if this is duable. But it would be nice to have the posibility of “forceing” the Spotify Component to remember devices, maybe with a config like this
@GigabitGuy You have to set logger level to info to see aliases. Unfortunately, this new version of the component generates an error every minute when all the players are disabled. I still can’t use it normally.
Are bummer, maybe you can get around that by setting the logging level for the spotify component higher than the warning? If its log spamming causing problems?
@Bieniu did you actually get the aliases to work? Mine does not seem to do anything, Spotify just re-discoveres my devices on startup like there isn’t anything in my config, but there is:
This is driving me nuts, it worked flawlessly the first time around, but now I can’t seem to get me two chromecast + their group, to stay in the source_list. The speaker group keeps resetting all the sources.
This still seems to be a problem.
I cannot play a playlist after some idle time because Spotify doesn’t know the source anymore.
Is there another fix for this?