Repository navigation
Releases
v6.6.8
Fixes
- Spotcast now recovers on its own when Spotify cannot be reached while Home Assistant starts. A timeout, a DNS or connection error, or a server error from Spotify during setup left the integration in "Failed to set up", Home Assistant never retried it, and every
spotcast.*action failed with "Action spotcast.play_media not found" until the integration was reloaded by hand or Home Assistant restarted. Spotcast now tells Home Assistant to retry the setup in these cases, and it loads as soon as Spotify answers again. This covers the Spotify API, the token endpoint and Spotify rate limits; an authorization error still stops the setup, since a retry would not fix it (thanks @michaelarnauts, #92).
Pull requests
Full Changelog: v6.6.7...v6.6.8
v6.6.7
Fixes
- Home Assistant 2026.11 no longer logs "The deprecated constant CONN_CLASS_CLOUD_POLL was used from spotcast" at startup. The config flow still declared a connection class that Home Assistant stopped reading long ago (it comes from
iot_classin the manifest), and the constant it used is removed in Home Assistant 2027.5.0, which would have stopped Spotcast from loading. The declaration is gone and nothing else changes (thanks @tschoehuijs, #83).
Pull requests
Full Changelog: v6.6.5...v6.6.7
v6.6.5
Fixes
- Casting to a Google Cast device no longer leaves a connection open on the device after every call. Each play service call that targeted a Cast entity opened a new connection to the device to launch Spotify, and nothing ever closed it, so the connection kept reconnecting in the background for as long as Home Assistant ran. A speaker that received a few plays a day collected dozens of them, until it refused new connections and every later cast to it failed until Home Assistant was restarted. Spotcast now closes the connection once Spotify has taken over playback, and also when the launch or the playback request fails. Spotify keeps playing on the device after the connection closes (thanks @algovera, #80).
Project changes
- HACS now installs Spotcast from a
spotcast.zipfile attached to each GitHub release instead of the source archive of the tag. Nothing changes for users, and the download count of that file shows how many installs and updates each release gets (#79).
Pull requests
Full Changelog: v6.6.4...v6.6.5
v6.6.4
Fixes
- Targeting a
*_spotcastmedia player with a Spotcast account it does not belong to now fails immediately with "media_player.xis the Spotify Connect device of accountAand cannot be used by accountB" and points at the device's Google Cast entity. A Spotify Connect device is signed in to a single account, so the other account's command got a 404 from Spotify, and Spotcast waited 12 seconds for the device to appear before giving up with "not available on Spotify Connect" (or, fortransfer_playback, the raw "Device not found"). The transfer path now also waits and retries once when a device is still registering, asplay_mediaalready did, and the timeout message names the account (#76, #77). - Newly created
*_spotcastentities get a valid entity id when the Spotify account id contains a dot or a dash: an id likefirst.last-xxproducedmedia_player.<device>_first.last-xx_spotcast, which Home Assistant flags as invalid and will refuse from 2027.2. Entities already in the registry keep their stored entity id (#76, #77).
To switch a Chromecast between two Spotcast accounts, target its Google Cast media_player entity rather than a *_spotcast entity: Spotcast relaunches the Spotify app there, signed in with the calling account. See the README for details.
Full Changelog: v6.6.3...v6.6.4
v6.6.3
Fixes
- A wrong Client ID or Client Secret no longer strands the setup on Spotify's error page. Home Assistant stores application credentials outside the integration and never checks them, so a typo sent the user to Spotify's own "INVALID_CLIENT" page, the flow never heard back, and reinstalling Spotcast did not bring the credentials form back. Spotcast now asks Spotify to validate the stored pair before the redirect, both on setup and on reauthentication, and aborts with "Spotify rejected the Client ID or Client Secret stored in Home Assistant" plus a direct link to the Application credentials panel where they can be deleted. The first setup screen also links to the new changing or resetting the application credentials section of the guide (#73, #74).
Full Changelog: v6.6.2...v6.6.3
v6.6.2
Fixes
- A cast to an unreachable or refusing Chromecast now fails with a clear error instead of hanging the service call. Spotcast waited on the device with no timeout, both when building the player and again inside the app launch, so a powered-down or unreachable device blocked
spotcast.playindefinitely. Every wait is now bounded to 20 seconds and reports "Could not connect to<device>within 20s". Separately, when the device refused the Spotify credentials, the refusal was raised on pychromecast's socket thread where it was logged and discarded, and the launch loop kept polling for an answer that had already arrived, so the caller only ever saw "Timeout when waiting for status response from Spotify app". The refusal is now recorded and raised to the caller with the device's own account of it, for example "Spotify refused the credentials for this device (status=108, statusString=ERROR-CANNOT-LOAD, spotifyError=409)" (thanks @chsienki, #67, #71).
Project changes
- The development environment now tracks Home Assistant 2026.9.1 (from 2026.7.2) and the PyJWT override in
pyproject.tomlis gone, since Home Assistant pins PyJWT 2.13.0 itself from 2026.8.0 onward. A dependency audit of the locked environment found no known vulnerabilities, and every runtime dependency (spotipy 2.26.0, RapidFuzz 3.14.6, PyChromecast 14.0.10) is at its latest release.
v6.6.1
Fixes
- A Spotify rate limit (
429) no longer blocks Home Assistant for hours. spotipy retried a429by sleeping the fullRetry-After(up to 6 hours, up to 3 times) inside a Home Assistant worker thread, once per account and once per action call, so a rate limit left coordinator refreshes andplay_mediacalls hanging for hours and every waking thread immediately re-knocked on a door that had already said no. Spotcast now disables spotipy's429retry, readsRetry-Afteronce and pauses every account sharing the client id until the window expires: refreshes fail fast with "Spotify rate limit active ... paused for N s (until HH:MM:SS)", action calls return "Spotify is rate limiting this client id. Try again in N s", system health shows aRate Limitrow, and everything resumes on its own (#68, #69).
Note
Spotify enforces its rate limit per application (client id), not per Spotify account. Every account configured in Spotcast shares the quota, and so does any other integration using the same application (for example the core Spotify integration). If you run several accounts or hit the limit regularly, raise the base refresh rate and give other integrations their own Spotify application.
Full Changelog: v6.6.0...v6.6.1
v6.6.0
Spotcast is now available in German.
Changes
- The integration is now available in German. The configuration flow, the options form and all ten service definitions are translated, bringing the shipped languages to English, French and German (thanks @vlntnwbr, #63).
Project changes
- Translation files are covered by a consistency test.
strings.jsonandtranslations/en.jsonmust stay identical, and every other language file must expose the same keys with the same{placeholder}tokens and no blank strings. New languages are picked up automatically, so a missing key can no longer fall back to English unnoticed (#64).
Adding a language
Copy custom_components/spotcast/translations/en.json to <code>.json, translate the values, and open a pull request. The consistency test will tell you if a key or a {placeholder} went missing.
Full changelog: v6.5.4...v6.6.0
v6.5.4
Fixes
-
A
401from the Spotify API on a token the session still considers valid no longer surfaces as a coordinator error: the account forces a token refresh and retries the call once. Spotify occasionally rejects a freshly refreshed token (Access token missing), which previously failed the whole update cycle:HTTP Error for GET to .../v1/me/player/devices returned 401 due to Access token missing Unexpected error fetching spotcast_... dataA
401means the request never executed, so the retry is safe for the playback writes too. If the rejection is ever caused by Spotcast rather than Spotify, the newSpotify rejected the access token for <url>warning makes it visible. -
The desktop session keeps its refresh token when Spotify omits
refresh_tokenfrom a refresh response. The response previously replaced the stored token wholesale, which would have left the session unable to refresh at all.
Full changelog: v6.5.3...v6.5.4
v6.5.3
Hardening against Spotify server instability, migration off the Web API endpoints removed by the February 2026 platform changes, and new device management options.
Fixes
- The playlists and liked songs count lookups are cached (5 minutes at the default refresh rate) instead of hitting the Spotify API on every update cycle, cutting steady-state API calls per account by roughly 40% (#54).
- When Spotify's API returns repeated server errors, the coordinator reports "Spotify API temporarily unavailable (server errors)" instead of the misleading
http status: 429that the spotipy library hard-codes on retry exhaustion (#54, spotipy-dev/spotipy#805). Genuine rate limits keep the previous message. - A server error (5xx) from Spotify's token endpoint (
accounts.spotify.com) is treated as a temporary outage like any other Spotify 5xx: one clear error line and a 30 second refresh backoff, instead ofToken request for spotcast failed (unknown): unknown_errorfollowed by a raw503, message='Service Unavailable'error on every cycle. Genuine token failures (4xx) now include the HTTP status in the log. - The device manager applies the same 30 second backoff after a failed device refresh instead of retrying every cycle during an outage.
- A failed refresh logs one error instead of two: the profile malfunction binary sensor no longer duplicates the coordinator's error line (#54).
- The stale-device purge survives Home Assistant restarts (unavailability timestamps are persisted) and also removes devices left over from previous Spotcast versions once they exceed the timeout (#56).
- System health no longer leaks Spotify account ids or usernames into bug reports, and the
Device Registration Endpointcheck reports real reachability instead of alwaysunreachable.
Changes
- New per-account options: the number of days before unavailable devices are removed (default 7, 0 = immediately), and a device filter (deny or allow mode, with case-insensitive name patterns such as
*Jam*) controlling which Spotify Connect devices get amedia_playerentity (#56). See the configuration guide. - Migrated off the Spotify Web API endpoints removed by the February 2026 platform changes, which are rejected for Spotify applications created after 2026-02-11 (#57):
like_media/unlike_medianow use/me/library, and playlist track listing uses/playlists/{id}/items. Both replacements also work for older applications. - Removed the unused artist top-tracks helper; its endpoint was removed by Spotify with no replacement.
Deprecations
- The
spotcast/categoriesWebSocket endpoint is deprecated: Spotify removed Browse categories with no replacement for applications created after 2026-02-11 (older applications are grandfathered for now). The endpoint returns an empty list with a warning instead of raising, and will be removed in a future release.
Housekeeping
- The codebase is pylint-clean (10.00/10) and the dependency security alerts (PyJWT in the dev lock, CairoSVG in the dev requirements) are resolved.
Full changelog: v6.5.2...v6.5.3