Giter VIP home page Giter VIP logo

spotcast's Introduction

Spotcast

hacs_badge spotcast Maintenance

Home Assistant custom component to start Spotify playback on an idle chromecast device or a Spotify Connect device (thanks to @kleinc80) which means that you can target your automation for chromecast as well as connect devices.

Spotcast implements a cast platform (requires Home Assistant Core 2022.2.0 or later), which enables Google Cast media player entities to play Spotify URI as well as to browse the Spotify library.

This component is not meant to be a full Spotify chromecast media_player but only serves to start the playback. Controlling the chromecast device and the Spotify playback after the initial start is done in their respective components. Because starting playback using the API requires more powerful token the username and password used for browser login is used.

Used by Spotify-Card.

Community post

Installation

HACS

This component is easiest installed using HACS.

Manual installation

Copy all files from custom_components/spotcast/ to custom_components/spotcast/ inside your config Home Assistant directory.

Configuration

Minimum Home Assistant version

Spotcast is compatible with any version since 2021.12.0.

Official Spotify Integration

Note that as of v3.5.2 you must also have the official Home Assistant Spotify Integration installed and configured for this custom component to work. This is because it provides the correct device list which has the correct scopes in its token.

Obtaining sp_dc and sp_key cookies

Spotcast uses two cookies to authenticate against Spotify in order to have access to the required services.

To obtain the cookies, these different methods can be used:

Chrome based browser

Chrome web console
  1. Open a new Incognito window at https://open.spotify.com and login to Spotify.
  2. Press Command+Option+I (Mac) or Control+Shift+I or F12. This should open the developer tools menu of your browser.
  3. Go into the application section.
  4. In the menu on the left go int Storage/Cookies/open.spotify.com.
  5. Find the sp_dc and sp_key and copy the values.
  6. Close the window without logging out (Otherwise the cookies are made invalid).

cookie in chrome developer tools

Firefox based browser

Firefox web console
  1. Open a new Incognito window at https://open.spotify.com and login to Spotify.
  2. Press Command+Option+I (Mac) or Control+Shift+I or F12. This should open the developer tools menu of your browser.
  3. Go into the Storage section. (You might have to click on the right arrows to reveal the section).
  4. Select the Cookies sub-menu and then https://open.spotify.com.
  5. Find the sp_dc and sp_key and copy the values.
  6. Close the window without logging out (Otherwise the cookies are made invalid).

Firefox developer tool

Single account

Add the following to your configuration.yaml:

spotcast:
  sp_dc: !secret sp_dc
  sp_key: !secret sp_key
  country: SE #optional, added in 3.6.24

Multiple accounts

Add accounts dict to the configuration and populate with a list of accounts to be able to initiate playback using diffferent accounts than the default.

If you are using v3.5.2 or greater and thus also have the core Spotify Integration installed, then the additional accounts will also need to be added there as well for multiple accounts to work.

spotcast:
  sp_dc: !secret primary_sp_dc
  sp_key: !secret primary_sp_key
  country: SE #optional, added in 3.6.24
  accounts:
    niklas:
      sp_dc: !secret niklas_sp_dc
      sp_key: !secret niklas_sp_key
    ming:
      sp_dc: !secret ming_sp_dc
      sp_key: !secret ming_sp_key

Edit secrets.yaml

Please note: configuration.yaml is a plain text file and it is not recommended to store your passwords in this file.

By using the !secret tag you are directing Home Assistant to look inside the secrets.yaml file for your key instead.

For a single account add the following to your secrets.yaml file:

sp_dc: [your sp_dc here]
sp_key: [your sp_key here]

For multiple accounts add the corresponding entries to your secrets.yaml file. For example, using the same accounts as above:

primary_sp_dc: [your sp_dc here]
primary_sp_key: [your sp_key here]
niklas_sp_dc: [niklas sp_dc here]
niklas_sp_key: [niklas sp_key here]
ming_sp_dc: [ming sp_dc here]
ming_sp_key: [ming sp_key here]

Call the service

The spotcast custom component creates a service called 'spotcast.start' in Home Assistant.

Start playback on Spotify connect device

- service: spotcast.start
  data:
    spotify_device_id: "ab123c5d7347324c2b1234567890f8d6dc40350"
    uri: "spotify:playlist:5xddIVAtLrZKtt4YGLM1SQ"
    random_song: true

Start playback on a device with default account

- service: spotcast.start
  data:
    device_name: "Kitchen"
    uri: "spotify:playlist:5xddIVAtLrZKtt4YGLM1SQ"
    random_song: true

where:

  • spotify_device_id is the device ID of the Spotify Connect device
  • device_name is the friendly name of the chromecast device
  • uri is the Spotify uri, supports all uris including track (limit to one track)
  • search is a search query to resolve into a uri. This parameter will be overlooked if a uri is provided
  • category let spotify pick a random playlist inside a given category
  • country restrict country to use when looking for playlists inside a category
  • limit restrict number of playlists to return when looking in a category. Note that only a single playlist will be chosen randomly from them.
  • random_song optional parameter that starts the playback at a random position in the playlist
  • repeat optional parameter that repeats the playlist/track (track|context|off)
  • shuffle optional parameter to set shuffle mode for playback
  • offset optional parameter to set offset mode for playback. 0 is the first song

Optionally you can specify the entity_id of an existing Home Assistant chromecast media-player like:

- service: spotcast.start
  data:
    entity_id: "media_player.vardagsrum"
    uri: "spotify:playlist:5xddIVAtLrZKtt4YGLM1SQ"

Find Spotify Device ID

To use the Spotcast service with a Spotify Connect device, you need the spotify_device_id. To find the spotify_device_id, multiple option are available.

With Spotify developer portal

  1. Go to Spotify developer console
  2. Click GET TOKEN
    get_token
  3. Select user-read-playback-state as a scope
    select_scope
  4. If prompt give permission to your Spotify profile
  5. For chromecast devices, make sure to play media on the device prior to checking the logs as they will not show unless active
  6. Press the option Try it
  7. Read the result in the console in the right.
    device_id

Through Spotcast log

  1. Enable the debug logs (instructions are in section Enabling Debug Log in this README)
  2. Reboot Home Assistant
  3. Go to Configuration >> Logs >> Load Full Home Assistant Log.
  4. For chromecast devices, make sure to play media on the device prior to checking the logs as they will not show unless active
  5. Find the log entry get_spotify_devices and look for the device ID.

Sonos Device ID

  1. Open the Spotify Web Player and sign in if needed
  2. Make sure you see your Sonos devices in the Connect popup
  3. Open your browser's DevTools (F12 for Chrome)
  4. Navigate to the Network tab
  5. Connect to the desired Sonos device in the Web Player
  6. Find the associated request in your DevTools
  7. The request URL looks something like this: https://gew1-spclient.spotify.com/connect-state/v1/connect/transfer/from/my_web_player_device_id/to/my_sonos_device_id
  8. The my_sonos_device_id is the spotify_device_id you are looking for.
Log example
2022-01-13 19:10:35 DEBUG (SyncWorker_0) [custom_components.spotcast.helpers] get_spotify_devices: media_player.spotify_felix: Spotify Félix Cusson: [{'id': '################################', 'is_active': True, 'is_private_session': False, 'is_restricted': False, 'name': 'Salon', 'type': 'CastAudio', 'volume_percent': 16}]
2022-01-13 19:10:35 DEBUG (SyncWorker_0) [custom_components.spotcast.helpers] get_spotify_devices: {'devices': [{'id': '###############################', 'is_active': False, 'is_private_session': False, 'is_restricted': False, 'name': 'Salon', 'type': 'CastAudio', 'volume_percent': 16}]}

# Look for
<...> Spotify Félix Cusson: [{'id': '################################', <- This is the device ID

Automation example

- id: 'christmas_play_christmas_music'
  alias: Christmas play Christmas music
  initial_state: 'on'
  trigger:
  - event_data:
      id: remote_windowlamps
      event: 5002
    platform: event
    event_type: deconz_event
  condition: []
  action:
  - service: spotcast.start
    data:
      uri: 'spotify:playlist:56Bor5fbMJlJV7oryb2p3k'
      random_song: true
      shuffle: true
      start_volume: 50
      entity_id: media_player.kitchen
- service: spotcast.start
  data:
    search: "Brown Bird" # resolves to spotify:artist:5zzbSFZMVpvxSlWAkqqtHP at the time of writing
    random_song: true
    shuffle: true
    start_volume: 50
    entity_id: media_player.kitchen

Transfer current playback for the account

Omitting uri will transfer the playback to the specified device.

- service: spotcast.start
  data:
    device_name: "Speaker kitchen"

Use the parameter force_playback to continue the user's playback even if nothing is currently playing.

- service: spotcast.start
  data:
    device_name: "Speaker kitchen"
    force_playback: true

where:

  • device_name is the friendly name of the chromecast
  • force_playback (optional) true or false, true to continue the user's playback even if nothing is currently playing

Start playback on a device with non default account

- service: spotcast.start
  data:
    account: "niklas"
    device_name: "Speaker kitchen"
    uri: "spotify:playlist:5xddIVAtLrZKtt4YGLM1SQ"

where:

  • account is the name of account key in the accounts dictionary in the configuration
  • device_name is the friendly name of the chromecast
  • uri is the Spotify uri, supports all uris including track (limit to one track)

Start podcast playback

Play the latest episode of a given podcast show.

- service: spotcast.start
  data:
    account: "niklas"
    device_name: "Speaker kitchen"
    uri: "spotify:show:6PeAI9SHRZhghU7NRPXvT3"
    ignore_fully_played: true

where

  • account is the name of account key in the accounts dictionary in the configuration
  • device_name is the friendly name of the Chromecast
  • uri is the spotify uri, (podcasts use the 'show' uri)
  • ignore_fully_played (optional) true or false, true to ignore already fully played episodes (defaults to false and plays the latest released episode)

Use the sensor

The sensor has the discovered chromecasts as both json and an array of objects. Since v3.4.0 it does not do its own discovery but relies on data from core cast. Add the following to the sensor section of the configuration:

sensor:
  - platform: spotcast
    country: SE

The country tag was added in v3.6.24. This tag is optional. If ommited or if you haven't updated the configuration since the update, it will default to "SE" (which it always did before)

Sensor name:

sensor.chromecast_devices

Attributes

devices_json: [
  {
    "name": "Speaker kitchen",
    "cast_type": "audio",
    "model_name": "Google Home",
    "uuid": "xxxxx",
    "manufacturer": "Google Inc."
  },
  {
    "name": "Speakers upstairs",
    "cast_type": "group",
    "model_name": "Google Cast Group",
    "uuid": "xxxx",
    "manufacturer": "Google Inc."
  },
  {
    "name": "Living room",
    "cast_type": "cast",
    "model_name": "HK Citation 300",
    "uuid": "xxxx",
    "manufacturer":"Harman Kardon"
    }
  ]

last_update: 2019-05-01T15:27:49.828553+02:00

friendly_name: Chromecast Devices

Websocket API

The components websocket api.

Method: spotcast/playlist supporting different playlist_types.

  • user, or default for user chosen saved playlists
  • featured for spotify "featured" playlists (not personalized)
  • discover-weekly for personalized "Made for _____" (includes daily mixes)
  • recently-played for "Recently Played"
  • ... any other view id as found in the API at https://api.spotify.com/v1/views/personalized-recommendations

Example usage:

// Retrieve playlists
const res = await this.props.hass.callWS({
  type: 'spotcast/playlists',
  playlist_type: 'featured', // 'user' for saved playlists, 'featured' for spotify featured, or personalized view id
  country_code: 'SV', // Optional country code used by featured playlists
  limit: 20, // Optional limit, default is 10
  account: 'ming' // optional account name
});

// Retrieve devices
const res = await this.props.hass.callWS({
  type: 'spotcast/devices',
  account: 'ming' // optional account name
});

// Retrieve player
const res = await this.props.hass.callWS({
  type: 'spotcast/player',
  account: 'ming' // optional account name
});

Enabling debug log

In configuration.yaml for you HA add and attach those the relevant logs. Be sure to disable it later as it is quite noisy.

logger:
  default: info
  logs:
    custom_components.spotcast: debug

Contribute

Please do! Open a Pull Request with your improvements.

This project was made possible by the original creator Niklas Fondberg. All your great work are greatly appreciated.

License

Apache 2.0

spotcast's People

Contributors

bendikrb avatar dependabot[bot] avatar dnguyen800 avatar emontnemery avatar fcusson avatar fondberg avatar gmcmicken avatar gramatus avatar hmmbob avatar icarome avatar illuzn avatar ionshard avatar jaburges avatar jes1417 avatar justincrosby avatar kleinc80 avatar logan893 avatar maxenced avatar rileymd88 avatar robtesch avatar rohankapoorcom avatar seraphimserapis avatar soldag avatar tahutipai avatar tigattack avatar tubalainen avatar victorwinberg avatar wannesmarynen avatar wrt54g avatar yuvalabou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotcast's Issues

wp_access_token error

I cannot play music anymore. I'm using version v2.2 of Spotcast and Home Assistent 0.99.3.

I get the following error using services under developertools in Home Assistent and using spotify-card.

Log Details (ERROR) Sun Sep 29 2019 17:33:52 GMT+0200 (centraleuropeisk sommartid) "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 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"

This is added to configuration.yaml

spotcast:

username: myusername
password: mypassword
accounts:
fredrik:
username: myusername
password: mypassword
philip:
username: myusername2
password: mypassword2

custom-cards:spotify-card

client_id: mycliendid
limit: 25
random_song: true
transfer_playback: true
type: 'custom:spotify-card'

Broken on Home Assistant 0.99b0

I just installed the Home Assistant 0.99b0 and Spotcast was broken. It seemed to have also caused an invalid config on the core "cast" integration too.

2019-09-12 13:10:12 ERROR (MainThread) [homeassistant.config] Unable to import cast: cannot import name 'APP_HOME_ASSISTANT' from 'pychromecast.config' (/usr/local/lib/python3.7/site-packages/pychromecast/config.py)
2019-09-12 13:10:12 ERROR (MainThread) [homeassistant.setup] Setup failed for cast: Invalid config.

and when I checked my config in "Server Control" panel it appears Spotcast was the cause:

Package spotcast setup failed. Component spotcast No module named 'pychromecast.controllers.homeassistant'

In the beta channel of Discord somebody told me a fix:

Froz Today at 4:59 PM
@Sean I edited the manifest.json for spotcast to use pychromecast 4.0.1 and it fixed the problem

Just wanted to report this asap so you could maybe roll out an update before the stable version releases in under a week.

usage of data_template in script

When I use the data_template in a script to start playing some music I get the following error message:

[homeassistant.core] Error executing service <ServiceCall script.chromecast_spotify (c:01e0ac4fe7644f7995ab2faab6e7e8f0)>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1234, in _safe_execute
await self._execute_service(handler, service_call)
File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 137, in service_handler
await script.async_turn_on(variables=service.data, context=service.context)
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 209, in async_turn_on
raise err
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 204, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 189, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 272, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 96, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
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'

So when I try the following script doesn't work:

chromecast_spotify:
alias: Play Spotify
sequence:
- service: spotcast.start
data_template:
device_name: >
{% if is_state("input_select.chromecast_radio", "Home Group") %} "Home group"
{% elif is_state("input_select.chromecast_radio", "Keuken") %} "Kitchen display"
{% elif is_state("input_select.chromecast_radio", "Living") %} "SoundBar"
{% elif is_state("input_select.chromecast_radio", "Slaapkamer") %} "Bedroom speaker"
{% elif is_state("input_select.chromecast_radio", "Badkamer") %} "Bathroom speaker"
{% elif is_state("input_select.chromecast_radio", "Boven") %} "Boven"
{% endif %}
uri: "valid spotify uri"

When I change data_template: to data: and hard-code the device name, the music starts.

chromecast_spotify:
alias: Play Spotify
sequence:
- service: spotcast.start
data:
device_name: "Home group"
uri: "valid spotify uri"

My template is valid, when I try the template tester from HA, I receive the valid device_name with quotes.

Is data_template not supported? Or am I doing something wrong?

Failure when trying to update

You are running Home Assistant version '0.105.2', but this repository requires minimum version 'null' to be installed.

Random song won't work with albums

When using the random_song parameter the current implementation will always call user_playlist_tracks(uri) regardless if a playlist or an album was provided using uri. Consequently the call will fail for album uris like 'spotify:album:5wuthq3XXmrpwlowdNxsBf' and execution will stop.

Quick fix I did for myself:

           if random_song:
                if uri.find('album') > 0:
                    results = client.album_tracks(uri)
                if uri.find('playlist') > 0:
                    results = client.playlist_tracks(uri)
                position = random.randint(0, results['total'] - 1)
                _LOGGER.debug('Start playback at random position: %s', position)
                kwargs['offset'] = {'position': position}

Btw, user_playlist_tracks() is deprecated, that's why I changed it to playlist_tracks().

Thank's for your great component!

Setup failed for spotcast: No setup function defined.

Hi,

Since this morning, I get the error 'Setup failed for spotcast: No setup function defined.'
I'm using Hassio, spotcast 2.9.0 and just upgraded to HA 0.108.2.
I installed spotcast via HACS (I tried reinstalling several times).

My config is pretty simple:

spotcast:
  username: !secret spotify_username
  password: !secret spotify_password

I can't understand what's happening. Config is definitely valid, and I didn't touch Spotcast at all...
Any idea?

Thanks,
Eric

Stop playing spotify

Maybe is something easy I have miss but I can now play spotify with service:spotcast.start.
But how do I stop it, there is no service:spotcast.stop?

Failed to call service spotcast/start 'NoneType' object has no attribute 'host'

Hi when i try to call spotcast/start with this service:
entity_id: media_player.vardagsrum_speaker uri: 'spotify:playlist:XXXXXXXXXXXXXXX'
I got this error:
2020-02-06 17:47:53 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.XXXXXXXXXXXXX] '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'

auth scopes to wide

Hi,

Looking at your great card and I’m wondering a bit about the scopes that the .js file is requesting access to.
Why do you need access to all these scopes?
“user-read-private”, “user-read-email”, “playlist-read-private”, “user-read-birthdate”, “user-read-playback-state”, “user-modify-playback-state”

Why do you need access to “user-read-private”, “user-read-email” and “user-read-birthdate”?
Seems to me that you app should be able to do what it does(listing playlists and playing them on connected devices) without needing access to those scopes?

Please correct me if I’m wrong.

(Edit…)
Deleted my Spotify app on https://developer.spotify.com/ 1, edited your .js file to only include scopes “playlist-read-private”, “user-read-playback-state”, “user-modify-playback-state”, and then I re-authenticated with Spotify(The scopes requested now, was only the 3 from the .js file, so the changes was picked up).
All is working fine, I’m able to see my playlists and devices and start playing on the devices, so I’m still wondering why you need access to private account info like email, username and birthday?

ping @fondberg

Entity for daily mix playlists?

I want to create a script in home assistant that plays daily mix's. In order to do so it would be useful if there was a spotcast entity with the daily mixes and the relevant playlist ID's. I can do the work of creating it but I wanted to get your input on how you would like it to be structured in your code base.

Can't update to 2.7.1

I just get the error:
"You are running Home Assistant version '0.105.2', but this repository requires minimum version 'null' to be installed."
Tried multiple times.

No device with id "" known by Spotify and Failed to get device id from Spotify

Logger: custom_components.spotcast
Source: custom_components/spotcast/init.py:184
First occurred: 下午11:16:32 (2 occurrences)
Last logged: 下午11:16:32

No device with id "7260b349a0fc9f487fc190c7941466da" known by Spotify
Known devices: []

Logger: homeassistant.components.websocket_api.http.connection.140124176598800
Source: custom_components/spotcast/init.py:291
Integration: websocket_api (documentation, issues)
First occurred: 下午11:19:13 (1 occurrences)
Last logged: 下午11:19:13

Failed to get device id from Spotify
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 184, in start_casting
spotify_device_id = spotify_cast_device.getSpotifyDeviceId(client)
File "/config/custom_components/spotcast/init.py", line 291, in getSpotifyDeviceId
raise HomeAssistantError('Failed to get device id from Spotify')
homeassistant.exceptions.HomeAssistantError: Failed to get device id from Spotify

One of four chromecast devices does not work

Spotcast: v2.8.0
Home Assistant: v0.106.5

I have one chromecast and three Google Home devices. All are integrated with my HA, e.g. playing voice commands for all four of them works fine. Somehow, running spotcast does not work only for entity media_player.googlehome9038; however, the exact same service call does work perfectly e.g. for entity media_player.googlehome3459.

When I run spotcast.start with this service data I receive the following stack trace:

service data:

entity_id: media_player.googlehome9038
uri: 'spotify:playlist:...'

Home Assistant Logs:

2020-03-08 02:30:25 ERROR (MainThread) [custom_components.spotcast] Could not find device Bad from hass.data, falling back to pychromecast scan
2020-03-08 02:30:33 INFO (MainThread) [pychromecast] Querying device status
2020-03-08 02:30:33 INFO (MainThread) [pychromecast] Querying device status
2020-03-08 02:30:33 INFO (MainThread) [pychromecast] Querying device status
2020-03-08 02:30:33 INFO (MainThread) [pychromecast] Querying device status
2020-03-08 02:30:33 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1838148368] Could not find device with name Bad
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 1230, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, 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 Bad

With the other entities, the playlist starts playing and I find the following log messages:

2020-03-08 02:36:27 INFO (MainThread) [pychromecast] Querying device status
2020-03-08 02:36:27 INFO (Thread-11) [pychromecast.controllers] Receiver:Launching app CC32E753

What could be the reason for it to fail?

Spotcast turns all cast devices unavailable after upgrading to 0.109.0b

I opened a bug report on core repo home-assistant/core#34620 about Google Homes all going unavailable after upgrading to Home Assistant 0.109.0b0 (beta).

With the help of Paulus, found out that Spotcast was causing it because it bundles an older version of pychromecast or something. After removing pychromecast==4.1.1 line from the /custom_components/spotcast/manifest.json file and restarting, all of my Google Cast devices returned again.

So this is just a heads up that this component requires a change to be compatible with upcoming 0.109. Thanks.

Random volumes when starting spotcast

I noticed a bug with the latest .9 update. When I start a spotcast service call, the volume is randomized every time. This happens on all speakers and groups (also between speakers inside the same group). This behaviour is not present when casting using Google Assistant or the Spotify apps (official).

Note: this occurs when using either force_playback: true or false. Both give the same result, so can’t say if the issue lies there or with something else that has changed.

Cannot find device with name ...

Hi, Spotcast is failing to work for me for some time now. I cannot start playback with when calling the service. The media_player entity itself is working properly and it even shows up in the Spotify Playlist Player.

image

Could not find device with name Google Home Mini
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1236, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1263, 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 155, in start_casting
    cast = get_chromecast_device(device_name)
  File "/config/custom_components/spotcast/__init__.py", line 82, in get_chromecast_device
    raise HomeAssistantError('Could not find device with name {}'.format(device_name))
homeassistant.exceptions.HomeAssistantError: Could not find device with name Google Home Mini
Could not find device Google Home Mini from hass.data, falling back to pychromecast scan

extra keys not allowed @ data['transfer_playback']

Hi,

I configured the spotify component, and installed spotcast and the custom spotify card. The connection with spotify works. However if I choose a mediaplayer (within the spotify card) from the list of chromecast devices I get the following error message and log.

image

2020-03-30 09:40:31 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1545439056] extra keys not allowed @ data['transfer_playback']
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py", line 1212, in async_call
    processed_data = handler.schema(service_data)
  File "/srv/homeassistant/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/srv/homeassistant/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/srv/homeassistant/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['transfer_playback']

spotcast stopped working (404) code -1

Running latest version spotcast and Hass it stopped working for me.
When executing:

device_name: Kök
uri: 'spotify:playlist:37i9dQZF1DX3yvAYDslnv8'
random_song: true
repeat: track

I get an error message:
image

Any idea?

Async executing of spotcast.start

The service spotcast.start is executed synchronously. I can confirm that if I call the service and try to switch some entities while the spotcast.start service is still executing. All my switched entities will be executed right after the spotcast.start service has finished, but not meanwhile. By calling e.g. media_player.play_media, this is not the case (my entities are switched directly while the service is still executing).

The problem is, if spotcast.start fails, the service is never finished, causing home assistant to be completely unresponsive, the only solution is to completely restart home assistant. This is very bad as all my lights, automations etc won't work anymore.

I believe this is a new issue, with previous versions of spotcast/home assistant this was not the case. Unfortunately I can't tell you the exact version when this issue raised, but must be in the last 2 or 3 months. Maybe some dependencies have changed...

Related to this comment: #44 (comment)

If you need any further information, please let me know :)

Support transfer ongoing playback.

Spotifys API has support for transferring ongoing playback to other known devices.
This can be implemented into spotcast with the help of spotipys method transfer_playback() as I've done to my fork which makes up for some pretty smooth automation possibilites.

I have for instance automated so that IF Im listening to Spotify when I come home spotcast will transfer my ongoing playback to my Chromecast Group.

https://github.com/phr0z/spotcast

I saw your suggestion on automatically transfer playback but I can't come up with any good solutions to this as you might want to actually have control over this and switch playlists/tracks in some cases. Don't really know how this logic would go. Maybe you have some ideas? :-)

Not able to use spotify artist URIs for spotcast.start service

Tried to use an artist URI (eg. spotify:artist:abcde....xyz) in the start service but returned a 400 error:

http status: 400, code:-1 - https://api.spotify.com/v1/me/player/play?device_id=redacted:
 Can't have offset for context type: ARTIST
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 137, in _internal_call
    r.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.spotify.com/v1/me/player/play?device_id=redacted

During handling of the above exception, another exception occurred:

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 1230, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in _execute_service
    await handler.func(service_call)
  File "/config/custom_components/spotcast/__init__.py", line 196, in start_casting
    play(client, spotify_device_id, uri, random_song, repeat, shuffle, position)
  File "/config/custom_components/spotcast/__init__.py", line 119, in play
    client.start_playback(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 1057, in start_playback
    "me/player/play", device_id), payload=data)
  File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 207, in _put
    return self._internal_call('PUT', url, payload, kwargs)
  File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 145, in _internal_call
    headers=r.headers)
spotipy.client.SpotifyException: http status: 400, code:-1 - https://api.spotify.com/v1/me/player/play?device_id=redacted:
 Can't have offset for context type: ARTIST

Is it possible to fix the request to enable using of artist URIs?

When start stream after media_player.turn_off the controlls stop working

I'm trying to turn on and off my TV with Chromecast and Sony Bravia PSK working together.
It all works fine but when i turn on the tv and chromecast again the graphics wont update so the Chromecast appers to be off but the music is streaming through the tv.

When Sony Bravia changes state to off the turn_off service gets triggerd in HA.
To wake the TV up again I call media_player.turn_on and the tv starts but the state dont change so the controlls wont work - meanwhile music works perfect.

If i restart the HA the controlls and graphic comes back and works perfectly.

EDIT:
Sorry, you can remove this. I figured that no need for turn_on service, i just start stream with the regular spotcast.start and the signal triggers the CEC in HDMI.

cast group issue

That is weird... unless you have a cast group you have created which you cast to...

Which version of HA and the component are you running? It might be related to a dependency.

Hi, I have a cast group in my google home(3 for now) and everytime I try change the playback to group, the music pauses.
So changing between google home devices is working very well, but not in a group.
Any tip?
EDIT:
Using mini-media-player w/ transfer_playback: true in all devices:

      - type: entities
        entities:
          - type: custom:mini-media-player
            entity: media_player.spotify
            group: true
            hide:
              power: true
            shortcuts:
              columns: 4 
              buttons:
                - name: All
                  type: service
                  id: spotcast.start
                  data:
                    device_name: All
                    transfer_playback: true
                - name: Dovakin
                  type: service
                  id: spotcast.start
                  data:
                    transfer_playback: true
                    entity_id: media_player.dovakin
                - name: Jorgin
                  type: service
                  id: spotcast.start
                  data:
                    transfer_playback: true
                    device_name: Jorgin
                - name: Enzo
                  type: service
                  id: spotcast.start
                  data:
                    transfer_playback: true
                    device_name: Enzo

Originally posted by @neomvll in #25 (comment)

Update of sensor.chromecast_devices is taking over 10 seconds

Error

I'm getting the following error message in homeassistant.log very frequently:

`2019-05-11 12:40:09 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 13:08:03 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 13:10:07 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 13:25:06 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 13:41:07 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 13:55:04 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 14:10:02 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 14:25:01 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 14:32:15 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds

2019-05-11 14:40:00 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.chromecast_devices is taking over 10 seconds`

The sensor itself works however, all my Google Homes are listed.

Setup

Hass.io with Home Assistant 0.93
spotcast version released May 15 2019
Google Home, Google Home Mini, Google Home Max (one of each)
Raspberry Pi connected via ethernet

Workaround

Commenting out a line in init.py makes the error disappear. But you loose the sensor altogether,

Failed to call service spotcast/start (400 Client Error)

Hi,

I'm unable to call the spotcast.start service on Home Assistant 0.99.3 docker image and spotcast 2.2 (installed via HACS 0.14.2) due to the following error Failed to call service spotcast/start. 400 Client Error: Bad Request for url: https://accounts.spotify.com/api/login

The service parameters I tried:

{
  "entity_id": "media_player.chromecast",
  "uri": "spotify:playlist:37i9dQZF1DWXRqgorJj26U"
}

Previously I had no issue setting up the Spotify media player component (https://www.home-assistant.io/components/spotify/) and can control the playback on my chromecast source. Googling around show this past issue that has been resolved home-assistant-libs/pychromecast#264.

Please find the following error log upon the spotcast.start service:


2019-09-26 19:11:52 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1852038640] 400 Client Error: Bad Request for url: https://accounts.spotify.com/api/login,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service,
  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,
  File "/config/custom_components/spotcast/__init__.py", line 162, in start_casting,
    access_token, expires = get_spotify_token(username=user, password=pwd),
    data = st.start_session(username, password),
  File "/usr/local/lib/python3.7/site-packages/spotify_token.py", line 69, in start_session,
    _login(session, cookies, username, password, token),
  File "/usr/local/lib/python3.7/site-packages/spotify_token.py", line 31, in _login,
    response.raise_for_status(),
    raise HTTPError(http_error_msg, response=self),
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://accounts.spotify.com/api/login

Cheers

Component spotcast Integration 'spotcast' not found.

When installing the custom_component manually and trying to set a config I get the following error:

- Package spotcast setup failed. Component spotcast Integration 'spotcast' not found.

I believe this is related to an update to HA that you may not have accounted for.

Install issues

Hi!

Thanks so much for the awesome component BUT
I can't finish the install. I manage to get the files into the custom folder, and a succesful restart. afterwards when I edit the config I can't access hass, and have to delete the component and restart.

Thanks in advance from a total noobie...

Invalid data for call_service at pos X: value should be a string for dictionary value @ data['entity_id']

When I try to include a Call Service action for the spotcast.start service in a HomeAssistant automation (specifying media_player.upstairs as the entity_id, which points to a speaker group called upstairs and is a functional entity everywhere else), it fails to call the service with the following error:

Error while executing automation automation.playlist. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['entity_id']

Making the same exact call from the Developer Tools > Services page works, but there seems to be a problem when doing this as an automation. I'm using the correct Entity ID for the player in question (I've tried with both a speaker group and an individual Google Home device), so that's not the issue.

HA is 0.105.2.

Starting spotify on a chromecast device with non-default account

Reported first here: https://community.home-assistant.io/t/spotcast-custom-component-to-start-playback-on-an-idle-chromecast-device/114232/60 by Bart van Soest

Bart, can you add a logline on line 103 so it looks like this:

        _LOGGER.info('requesting token for user: %s', user)
        # login as real browser to get powerful token
        access_token, expires = get_spotify_token(username=user, password=pwd)

Then check you logs to see which user the token is requested for

pychromecast: failed to connect.

Could not find anything similiar on the net so I'm posting this as an issue here:
When running spotcast.start with an existing device (as per sensor) or using the lovelace component pychromecast logs the following:

ERROR (Thread-239) [pychromecast.socket_client] [record[a,in-unique,f1fadb91-446e-6e5a-e5d8-668776a5c754.local.]=120/119,192.168.1.22:8009] Failed to connect, retrying in 5.0s

Using another device didn't work either.
Connecting with the Spotify app works fine.

Could not find device with name [friendly_name]

Hello,

I've been having difficulties to get this component to start for a while now.
Whenever I call the service,

service: spotcast.start 
   uri: 'spotify:user:spotify:playlist:37i9dQZF1DX2FsCLsHeMrM'
   entity_id: media_player.bedroom_speaker

it seems to search for the friendly_name of the chromecast device, but fails to find it.

Could not find device Google Home Mini from hass.data, falling back to pychromecast scan
Could not find device with name Google Home Mini
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 233, in getChromecastDevice
    raise HomeAssistantError('Could not find device with name {}'.format(device_name))
homeassistant.exceptions.HomeAssistantError: Could not find device with name Google Home Mini

This has been going on for me since V2 onwards.

Needs to be updated

Home-assistant is now installing spotipy 2.10.0
And this integration is installing 2.7.1 causing reboots to take unnecessarily long.

Component sends command but nothing happens

After sometime, the component seems to run in some sort of timeout. While the component sends the request without throwing an error, the cast will not react. After a restart of HA this is fixed.

Spotify account connected with Facebook

Since my Spotify account is connected with Facebook, I don't have normal login details like the username and password, is there a way to still use Spotcast?

Music was stopped because spotify was used at a different device.

I have noticed that after some time when playing on Chromecast & Google Home Groups, that my playback stopped and the Google Home said: Playback stopped because spotify was used somewhere else. (It wasnt though). It didnt happend again after i commented out the sensor.
Not sure yet why this could happen.

Facebook OAuth login?

I see how to use this plugin, but I login to Spotify using Facebook OAuth. Does this plugin support this currently?

Transfert playback only add another device

Hi ! your component is awesome I try to achieve this since a have a google home ( like 3 year ago )

I have a lite automation that allow me to switch music between device. but let say the music is playing in the kitchen and I want to switch it to the bedroom then It will play in the bedroom AND in the kitchen ... is it normal ? this is my automation : ( I have the same automation for every google home that I can select with a input select )

  • alias: transfer_playbackChambre_GH
    trigger:
    platform: state
    entity_id: input_select.spot_device
    to: 'Bedroom GoogleHome'
    action:
    • service: spotcast.start
      data:
      device_name: 'Bedroom GoogleHome'
      transfer_playback: true

Draw order

Maybe this is a greater issue with HA, but I haven't seen it before. When hovering to select a mediaplayer, the menu is shown under the adjacent card.
image

Unmet dependencies (bs4 and lxml)

I installed spotcast trough hacs. After installing and configuring, I got the following error when calling spotcast.start: No module named 'bs4'

After installing BeautifulSoup4 in the virtualenv, I received the following error: bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?

After installing this one in the virtualenv and restarting homeassistant, everything is working.

I kinda expected that these dependencies would be solved by hacs or otherwise get mentioned in the readme.

Everything is working now, so I'm happy :).

Component error: spotcast

i install it via hacs then restarted and after that i add the lines to the configuration.yaml
and when e make the Configuration validation e get this error:

Component error: spotcast - Requirements for spotcast not found: ['fondberg-spotipy==2.4.5-dev2'].

Possibility to "Transfer Playback" even when there is nothing currently playing

Transfer Playback works great when something is already playing (or was playing very recently).
However, if there is no active session, nothing will start when transfer playback is sent.

The behaviour of Google Home when i ask to play Music from Spotify is that it will always continue on where i last stopped. Even if there is a long time between the last time i listened to something on Spotify.

Is it possible to copy this behaviour?

HASSIO error: Don't use 'server_host' options with Hass.io

First off, I'm new to HASSIO in the first place so forgive me if I ask dumb questions.

I installed HACS in order to get Spotcast (your documentation recommended this). HACS installed fine from what I can tell. Reboot no warning. Install Spotcast via HACS seems fine. Edit my configuration.yml and add these EXACT lines:

spotcast:
username: !secret spotify_username
password: !secret spotify_password

Reboot and I get the warning in HASSIO stating we are now running in safe-mode: Don't use 'server_host' options with Hass.io

Remove entries from configuration.yml, reboot and warning goes away. Odd.

Googling the error indicated most people having trouble with IOS Dark Theme and recommended uninstalling it, but that was not installed at that point. So, today I installed the theme (basically doing the opposite advice) to see what would happen. It did not help. I still get the warning. Thoughts?

Attached is my configuration.yml (redacted personal stuff).

configuration.yml.txt

I just installed HASSIO for the first time on a VM like two weeks ago so it is really new.

HassOS 3.12
Supervisor: Version 209

Could not find device with name ...

Anybody know why I can't send a playlist to my Google Home? I use this service:

uri: spotify:playlist:1gtrESi2ZEgPE8hEMd9Oka
entity_id: media_player.gh_servicio

It detects the friendly name of the entity, but i get this error and it does not work :-(

20-03-27 14:36:08 DEBUG (MainThread) [custom_components.spotcast] cast info: None
2020-03-27 14:36:08 ERROR (MainThread) [custom_components.spotcast] Could not find device Google Home Mini Servicio from hass.data, falling back to pychromecast scan
2020-03-27 14:36:16 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1870603568] Could not find device with name Google Home Mini Servicio
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 Home Mini Servicio

TTS from Home Assistant works good, but i cannot get this working. Thanks and sorry for disturbances :-(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.