{"record":{"id":"b2a709054919f039","repo":"home-assistant/core","slug":"unsupported-media","errorCode":"unsupported_media","errorMessage":"Unsupported media: {media}.","messagePattern":"Unsupported media: (.+?)\\.","errorType":"validation","errorClass":"ServiceValidationError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/arcam_fmj/media_player.py","lineNumber":203,"sourceCode":"            media_content_id=\"root\",\n            media_content_type=\"library\",\n            can_play=False,\n            can_expand=True,\n            children=radio,\n        )\n\n    @convert_exception\n    @override\n    async def async_play_media(\n        self, media_type: MediaType | str, media_id: str, **kwargs: Any\n    ) -> None:\n        \"\"\"Play media.\"\"\"\n\n        if media_id.startswith(\"preset:\"):\n            preset = int(media_id[7:])\n            await self._state.set_tuner_preset(preset)\n        else:\n            raise ServiceValidationError(\n                translation_domain=DOMAIN,\n                translation_key=\"unsupported_media\",\n                translation_placeholders={\"media\": media_id},\n            )\n\n    @property\n    @override\n    def source(self) -> str | None:\n        \"\"\"Return the current input source.\"\"\"\n        if (value := self._state.get_source()) is None:\n            return None\n        return value.name\n\n    @property\n    @override\n    def source_list(self) -> list[str]:\n        \"\"\"List of available input sources.\"\"\"\n        return [x.name for x in self._state.get_source_list()]","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/arcam_fmj/media_player.py#L185-L221","documentation":"ServiceValidationError with key 'unsupported_media' from arcam_fmj async_play_media: the media_id does not start with 'preset:', which is the only playable media scheme this integration supports (tuner presets generated by async_browse_media).","triggerScenarios":"media_player.play_media is called with a media_id like a URL, Spotify URI, or arbitrary string; the else-branch raises with the offending media_id as placeholder.","commonSituations":"Generic automations or scripts that assume media players accept URLs/TTS; users trying to stream to an AVR that only supports preset switching through this integration.","solutions":["Use ids from the entity's browse_media tree, i.e. media_type music with media_id 'preset:<index>'.","Remove play_media calls that pass URLs/stream URIs to this device.","For streaming, use a different source on the AVR (e.g. a streamer input) selected via select_source instead."],"exampleFix":"// before\nservice: media_player.play_media\ndata: {media_content_type: url, media_content_id: http://stream.example.com/aac\n// after\nservice: media_player.play_media\ndata: {media_content_type: music, media_content_id: \"preset:3\"}","handlingStrategy":"validation","validationCode":"def is_playable_media(media_id: str) -> bool:\n    return media_id.startswith(\"preset:\") and media_id[7:].isdigit()","typeGuard":null,"tryCatchPattern":"Guard before calling: check the preset: prefix, else raise/return early; the integration itself converts this to ServiceValidationError 'unsupported_media' for UI callers.","preventionTips":["Source play_media ids from browse_media output only.","Do not send URLs or app URIs to this media player.","Keep media_type consistent with browse results (music)."],"tags":["home-assistant","arcam-fmj","media-player","validation","service-action"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}