home-assistant/core · error · ServiceValidationError
invalid_sound_value
invalid_sound_value
Error message
Invalid sound {sound} specified What it means
ServiceValidationError with translation key alexa_devices/invalid_sound_value, raised in _async_execute_action when the ATTR_SOUND value of a send_sound service call is not in SOUNDS_LIST — the fixed set of sound names the Alexa API accepts.
Source
Thrown at homeassistant/components/alexa_devices/services.py:87
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="config_entry_not_found",
translation_placeholders={"device_id": device_id},
)
async def _async_execute_action(call: ServiceCall, attribute: str) -> None:
"""Execute action on the device."""
device, config_entry = async_get_entry_id_for_service_call(call)
assert device.serial_number
value: str = call.data[attribute]
coordinator = config_entry.runtime_data
if attribute == ATTR_SOUND:
if value not in SOUNDS_LIST:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="invalid_sound_value",
translation_placeholders={"sound": value},
)
async with alexa_api_call():
await coordinator.api.call_alexa_sound(
coordinator.data[device.serial_number], value
)
elif attribute == ATTR_TEXT_COMMAND:
async with alexa_api_call():
await coordinator.api.call_alexa_text_command(
coordinator.data[device.serial_number], value
)
elif attribute == ATTR_INFO_SKILL:
info_skill = INFO_SKILLS_MAPPING.get(value)
if info_skill not in ALEXA_INFO_SKILLS:
raise ServiceValidationError(
translation_domain=DOMAIN,View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Use the value selector in the UI (dropdown) which only offers valid sounds from SOUNDS_LIST
- Check the SOUNDS_LIST in the alexa_devices integration (or alexapy) for the exact accepted spellings and correct the YAML/script
- Remove trailing/leading whitespace and match casing exactly
- After upgrading Home Assistant, re-check the list in case sounds were added/removed
Example fix
// before
action:
domain: alexa_devices
data:
device_id: "..."
sound: "my_sound"
// after
action:
domain: alexa_devices
data:
device_id: "..."
sound: "classic_alarm" # must be an entry of SOUNDS_LIST Defensive patterns
Strategy: validation
Validate before calling
from homeassistant.components.alexa_devices.const import SOUNDS_LIST
if sound not in SOUNDS_LIST:
_LOGGER.warning("Unsupported sound %r; valid: %s", sound, sorted(SOUNDS_LIST))
return Type guard
def is_valid_sound(value: str) -> bool:
"""True when value is an accepted Alexa sound name."""
return value in SOUNDS_LIST Try / catch
try:
await hass.services.async_call(DOMAIN, "send_sound", service_data, blocking=True)
except ServiceValidationError as err:
if err.translation_key == "invalid_sound_value":
_LOGGER.warning("Invalid sound; pick from SOUNDS_LIST") Prevention
- Use the UI dropdown selector for the sound field
- Validate against SOUNDS_LIST in custom scripts before calling
- Re-check the list after HA upgrades; sounds can be added or removed
When it happens
Trigger: Calling the alexa_devices sound/notification service with a sound string outside SOUNDS_LIST, e.g. 'custom_alarm' or a typo like 'classic_alarm ' (trailing space), or casing that does not match the list entries.
Common situations: Users guessing sound names instead of picking from the service selector's dropdown, YAML automations written before a sound-list change, or copy-pasting names from Amazon's app that differ from alexapy's list.
Related errors
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/8ca68734de0922fe.
Report an issue: GitHub.