home-assistant/core · error · ServiceValidationError

unsupported_sound_mode

unsupported_sound_mode

Error message

Unsupported sound mode: {sound_mode}.

What it means

ServiceValidationError with key 'unsupported_sound_mode' from arcam_fmj async_select_sound_mode: the library's set_decode_mode(sound_mode) raised KeyError or ValueError because the string does not name a decode/sound mode the AVR supports.

Source

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

            value = SourceCodes[source]
        except KeyError as exception:
            raise ServiceValidationError(
                translation_domain=DOMAIN,
                translation_key="unsupported_source",
                translation_placeholders={"source": source},
            ) from exception

        await self._state.set_source(value)
        self.async_write_ha_state()

    @convert_exception
    @override
    async def async_select_sound_mode(self, sound_mode: str) -> None:
        """Select a specific source."""
        try:
            await self._state.set_decode_mode(sound_mode)
        except (KeyError, ValueError) as exception:
            raise ServiceValidationError(
                translation_domain=DOMAIN,
                translation_key="unsupported_sound_mode",
                translation_placeholders={"sound_mode": sound_mode},
            ) from exception

        self.async_write_ha_state()

    @convert_exception
    @override
    async def async_set_volume_level(self, volume: float) -> None:
        """Set volume level, range 0..1."""
        await self._state.set_volume(round(volume * 99.0))
        self.async_write_ha_state()

    @convert_exception
    @override
    async def async_volume_up(self) -> None:
        """Turn volume up for media player."""

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Inspect sound_mode_list on the entity (Developer Tools -> states) and use one of those exact strings.
  2. Correct the automation/dashboard action that sends the invalid mode.
  3. Reload the integration after AVR firmware changes so the mode list refreshes.

Example fix

// before
data: {sound_mode: dolby_surround
// after
data: {sound_mode: Dolby Surround
Defensive patterns

Strategy: validation

Validate before calling

valid_modes = entity.sound_mode_list or []
if mode not in valid_modes:
    raise ValueError(f"Unsupported sound mode: {mode}")

Try / catch

Catch (KeyError, ValueError) around set_decode_mode and convert to ServiceValidationError with 'unsupported_sound_mode', chaining the original exception.

Prevention

When it happens

Trigger: media_player.select_sound_mode is called with a mode string that set_decode_mode cannot resolve (unknown enum key or invalid value for the connected model).

Common situations: Sound mode names copied from another brand (e.g. 'DTS:Neural:X' vs Arcam's naming); stale YAML after firmware changed available modes; typo in a dashboard selector.

Related errors


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