home-assistant/core · error · ServiceValidationError

config_entry_not_found

config_entry_not_found

Error message

Config entry not found: {device_id}

What it means

ServiceValidationError with translation key alexa_devices/config_entry_not_found, raised when the device registry entry exists but none of its config_entries resolve to an alexa_devices entry — i.e. the device_id is valid but not an Alexa device managed by this integration.

Source

Thrown at homeassistant/components/alexa_devices/services.py:70

        raise ServiceValidationError(
            translation_domain=DOMAIN,
            translation_key="invalid_device_id",
            translation_placeholders={"device_id": device_id},
        )

    for entry_id in device_entry.config_entries:
        if (entry := call.hass.config_entries.async_get_entry(entry_id)) is None:
            continue
        if entry.domain == DOMAIN:
            if entry.state is not ConfigEntryState.LOADED:
                raise ServiceValidationError(
                    translation_domain=DOMAIN,
                    translation_key="entry_not_loaded",
                    translation_placeholders={"entry": entry.title},
                )
            return (device_entry, entry)

    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,

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Verify the device_id belongs to a device provided by the alexa_devices integration (check the device page's 'Provided by' link)
  2. Pick the device through the UI service selector instead of hand-typing IDs
  3. Delete orphaned device registry entries left over from removed integrations
  4. Re-add the Alexa account if its devices lost their config entry association
Defensive patterns

Strategy: validation

Validate before calling

device_entry = dr.async_get(hass).async_get(device_id, include_child_devices=False)
entries = [hass.config_entries.async_get_entry(e) for e in (device_entry.config_entries if device_entry else [])]
has_alexa = any(e and e.domain == DOMAIN for e in entries)
if not has_alexa:
    _LOGGER.warning("device_id %s is not an alexa_devices device", device_id)
    return

Try / catch

try:
    await hass.services.async_call(DOMAIN, SERVICE, service_data, blocking=True)
except ServiceValidationError as err:
    if err.translation_key == "config_entry_not_found":
        _LOGGER.warning("Device %s not managed by alexa_devices", device_id)

Prevention

When it happens

Trigger: Calling an alexa_devices service with the device_id of a device that belongs to a different integration (e.g. a Sonos or Hue device), or an Alexa device whose alexa_devices entry was removed while the device registry entry lingered.

Common situations: Users pasting the wrong device's ID, devices duplicated across integrations (e.g. Echo exposed by both alexa_devices and a Matter/AVR integration), or orphaned registry entries after integration removal.

Related errors


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