{"record":{"id":"342d3615a8e63d43","repo":"home-assistant/core","slug":"source-source-not-found","errorCode":null,"errorMessage":"Source {source} not found","messagePattern":"Source (.+?) not found","errorType":"validation","errorClass":"ServiceValidationError","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/bluesound/media_player.py","lineNumber":655,"sourceCode":"        await self._player.shuffle(shuffle)\n\n    @override\n    async def async_select_source(self, source: str) -> None:\n        \"\"\"Select input source.\"\"\"\n        if self.is_grouped and not self.is_leader:\n            return\n\n        # presets and inputs might have the same name; presets have priority\n        for input_ in self._inputs:\n            if source in (input_.text, input_.id):\n                await self._player.play_url(input_.url)\n                return\n        for preset in self._presets:\n            if preset.name == source:\n                await self._player.load_preset(preset.id)\n                return\n\n        raise ServiceValidationError(f\"Source {source} not found\")\n\n    @override\n    async def async_clear_playlist(self) -> None:\n        \"\"\"Clear players playlist.\"\"\"\n        if self.is_grouped and not self.is_leader:\n            return\n\n        await self._player.clear()\n\n    @override\n    async def async_media_next_track(self) -> None:\n        \"\"\"Send media_next command to media player.\"\"\"\n        if self.is_grouped and not self.is_leader:\n            return\n\n        await self._player.skip()\n\n    @override","sourceCodeStart":637,"sourceCodeEnd":673,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bluesound/media_player.py#L637-L673","documentation":"ServiceValidationError from async_select_source: the requested source name matches neither any input's text/id nor any preset name on the player. Presets take priority when names collide. The call aborts without changing playback.","triggerScenarios":"Calling media_player.select_source with a name that is not in the player's current inputs list or presets list — e.g. a source removed on the device, a typo, or a source list that has not synced yet after startup.","commonSituations":"Automation hardcodes a source name the user later renamed in the Bluesound app; source selected right after HA restart before the coordinator fetched inputs/presets; using the input's URL/id instead of its display text.","solutions":["Check the entity's source_list attribute and use one of those exact strings (or the input id)","If presets/inputs recently changed on the device, wait for the next coordinator refresh or call the entity's update before selecting","Parameterize the source name via a blueprint input or helper so renames only need one edit"],"exampleFix":"# before\n- action: media_player.select_source\n  target:\n    entity_id: media_player.living_room\n  data:\n    source: Spottify\n\n# after (match the exact name in source_list)\n- action: media_player.select_source\n  target:\n    entity_id: media_player.living_room\n  data:\n    source: Spotify","handlingStrategy":"validation","validationCode":"def source_available(entity, source: str) -> bool:\n    sources = set(entity.source_list or [])\n    inputs = {i.text for i in entity._inputs} | {i.id for i in entity._inputs}\n    presets = {p.name for p in entity._presets}\n    return source in sources or source in inputs or source in presets","typeGuard":null,"tryCatchPattern":"from homeassistant.exceptions import ServiceValidationError\ntry:\n    await entity.async_select_source(source)\nexcept ServiceValidationError as err:\n    if \"not found\" in str(err):\n        # refresh source_list and prompt user to pick a valid source","preventionTips":["Drive select_source from the entity's source_list attribute, not hardcoded strings","After renaming presets/inputs on the device, update automations that reference them"],"tags":["bluesound","media-player","source","service-validation"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}