home-assistant/core · error · ServiceValidationError
unsupported_source
unsupported_source
Error message
Unsupported source: {source}. What it means
ServiceValidationError with key 'unsupported_source' from arcam_fmj async_select_source: the requested source name is not a member of the SourceCodes enum in the arcam-fmj library, so it cannot be mapped to a command for the AVR.
Source
Thrown at homeassistant/components/arcam_fmj/media_player.py:94
if power is None:
return None
return MediaPlayerState.ON if power else MediaPlayerState.OFF
@convert_exception
@override
async def async_mute_volume(self, mute: bool) -> None:
"""Send mute command."""
await self._state.set_mute(mute)
self.async_write_ha_state()
@convert_exception
@override
async def async_select_source(self, source: str) -> None:
"""Select a specific source."""
try:
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",View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Call the media player's source_list / browse sources in Developer Tools to see valid names and use exactly those.
- Fix the typo/casing in the automation or script that invokes select_source.
- Update the arcam-fmj library if your model's source codes were added after your installed version.
Example fix
// before
action:
- service: media_player.select_source
target: {entity_id: media_player.arcam
data: {source: Tv
// after
action:
- service: media_player.select_source
target: {entity_id: media_player.arcam
data: {source: TV} Defensive patterns
Strategy: validation
Validate before calling
from arcam_fmj.source_codes import SourceCodes # or the library's enum module
def is_valid_source(source: str) -> bool:
return source in SourceCodes.__members__ Try / catch
Catch KeyError on SourceCodes[source] and raise ServiceValidationError with translation_placeholders={'source': source} (integration pattern) so the UI shows which value failed. Prevention
- Drive select_source automations from the entity's live source_list rather than hardcoded strings.
- Validate source names against SourceCodes members before calling.
- Watch for casing differences; enum keys are case-sensitive.
When it happens
Trigger: media_player.select_source is called with a string that is not a valid SourceCodes key (KeyError on SourceCodes[source]); e.g. a source name from a template/script typo or one that exists on a different AVR generation.
Common situations: Hardcoded source names in scripts/automations that drift from the device's actual source list; copied YAML between different Arcam models; case-sensitive mismatch ('TV' vs 'tv').
Related errors
- unsupported_sound_mode
- unsupported_media
- connection_failed
- Media not found: {media_content_type} / {media_content_id}
- end_time_before_start_time
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/eb60eb5eaf608ca6.
Report an issue: GitHub.