home-assistant/core · error · InvalidSource

Source {source} not found

Error message

Source {source} not found

What it means

InvalidSource raised by config_entry_id_to_source when the config entry exists but its unique_id (the adapter MAC used as scanner source) has no active scanner registered in the Bluetooth manager. The entry was found, but no remote/local scanner currently provides data for that source address.

Source

Thrown at homeassistant/components/bluetooth/util.py:135


@callback
def adapter_title(adapter: str, details: AdapterDetails) -> str:
    """Return the adapter title."""
    unique_name = adapter_unique_name(adapter, details[ADAPTER_ADDRESS])
    model = details.get(ADAPTER_PRODUCT, "Unknown")
    manufacturer = details[ADAPTER_MANUFACTURER] or "Unknown"
    return f"{manufacturer} {model} ({unique_name})"


def config_entry_id_to_source(hass: HomeAssistant, config_entry_id: str) -> str:
    """Convert a config entry id to a source."""
    if not (entry := hass.config_entries.async_get_entry(config_entry_id)):
        raise InvalidConfigEntryID(f"Config entry {config_entry_id} not found")
    source = entry.unique_id
    assert source is not None
    if not get_manager().async_scanner_by_source(source):
        raise InvalidSource(f"Source {source} not found")
    return source

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Ensure the Bluetooth adapter/proxy providing that source is enabled and healthy (see Settings > Devices & Services)
  2. If a proxy went offline, bring it back and retry once the scanner re-registers
  3. Defer the call until after the bluetooth integration's scanners are set up (e.g. wait for the bluetooth integration to pass its setup phase)
Defensive patterns

Strategy: validation

Validate before calling

def source_available(hass, source: str) -> bool:
    entry = hass.config_entries.async_get_entry(config_entry_id)
    return bool(entry and get_manager().async_scanner_by_source(entry.unique_id))

Try / catch

from homeassistant.components.bluetooth.util import InvalidSource
try:
    source = config_entry_id_to_source(hass, entry_id)
except InvalidSource:
    # adapter/proxy not loaded yet: wait for bluetooth setup then retry once

Prevention

When it happens

Trigger: The Bluetooth config entry for that adapter is not loaded (disabled, failed setup, adapter unplugged), or a remote proxy that supplied the source went offline; called during processing of an advertisement-bearing API right after startup before scanners registered.

Common situations: Bluetooth adapter entry disabled or in setup-retry; ESPHome Bluetooth proxy offline; code running early in startup before the scanner registered its source.

Related errors


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