home-assistant/core · error · ServiceValidationError

unsupported_media

unsupported_media

Error message

Unsupported media: {media}.

What it means

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).

Source

Thrown at homeassistant/components/arcam_fmj/media_player.py:203

            media_content_id="root",
            media_content_type="library",
            can_play=False,
            can_expand=True,
            children=radio,
        )

    @convert_exception
    @override
    async def async_play_media(
        self, media_type: MediaType | str, media_id: str, **kwargs: Any
    ) -> None:
        """Play media."""

        if media_id.startswith("preset:"):
            preset = int(media_id[7:])
            await self._state.set_tuner_preset(preset)
        else:
            raise ServiceValidationError(
                translation_domain=DOMAIN,
                translation_key="unsupported_media",
                translation_placeholders={"media": media_id},
            )

    @property
    @override
    def source(self) -> str | None:
        """Return the current input source."""
        if (value := self._state.get_source()) is None:
            return None
        return value.name

    @property
    @override
    def source_list(self) -> list[str]:
        """List of available input sources."""
        return [x.name for x in self._state.get_source_list()]

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Use ids from the entity's browse_media tree, i.e. media_type music with media_id 'preset:<index>'.
  2. Remove play_media calls that pass URLs/stream URIs to this device.
  3. For streaming, use a different source on the AVR (e.g. a streamer input) selected via select_source instead.

Example fix

// before
service: media_player.play_media
data: {media_content_type: url, media_content_id: http://stream.example.com/aac
// after
service: media_player.play_media
data: {media_content_type: music, media_content_id: "preset:3"}
Defensive patterns

Strategy: validation

Validate before calling

def is_playable_media(media_id: str) -> bool:
    return media_id.startswith("preset:") and media_id[7:].isdigit()

Try / catch

Guard before calling: check the preset: prefix, else raise/return early; the integration itself converts this to ServiceValidationError 'unsupported_media' for UI callers.

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/b2a709054919f039. Report an issue: GitHub.