{"record":{"id":"59626009119b5fb5","repo":"home-assistant/core","slug":"source-source-not-found-596260","errorCode":null,"errorMessage":"Source {source} not found","messagePattern":"Source (.+?) not found","errorType":"exception","errorClass":"InvalidSource","httpStatus":null,"severity":"error","filePath":"homeassistant/components/bluetooth/util.py","lineNumber":135,"sourceCode":"\n\n@callback\ndef adapter_title(adapter: str, details: AdapterDetails) -> str:\n    \"\"\"Return the adapter title.\"\"\"\n    unique_name = adapter_unique_name(adapter, details[ADAPTER_ADDRESS])\n    model = details.get(ADAPTER_PRODUCT, \"Unknown\")\n    manufacturer = details[ADAPTER_MANUFACTURER] or \"Unknown\"\n    return f\"{manufacturer} {model} ({unique_name})\"\n\n\ndef config_entry_id_to_source(hass: HomeAssistant, config_entry_id: str) -> str:\n    \"\"\"Convert a config entry id to a source.\"\"\"\n    if not (entry := hass.config_entries.async_get_entry(config_entry_id)):\n        raise InvalidConfigEntryID(f\"Config entry {config_entry_id} not found\")\n    source = entry.unique_id\n    assert source is not None\n    if not get_manager().async_scanner_by_source(source):\n        raise InvalidSource(f\"Source {source} not found\")\n    return source\n","sourceCodeStart":117,"sourceCodeEnd":137,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bluetooth/util.py#L117-L137","documentation":"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.","triggerScenarios":"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.","commonSituations":"Bluetooth adapter entry disabled or in setup-retry; ESPHome Bluetooth proxy offline; code running early in startup before the scanner registered its source.","solutions":["Ensure the Bluetooth adapter/proxy providing that source is enabled and healthy (see Settings > Devices & Services)","If a proxy went offline, bring it back and retry once the scanner re-registers","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)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"def source_available(hass, source: str) -> bool:\n    entry = hass.config_entries.async_get_entry(config_entry_id)\n    return bool(entry and get_manager().async_scanner_by_source(entry.unique_id))","typeGuard":null,"tryCatchPattern":"from homeassistant.components.bluetooth.util import InvalidSource\ntry:\n    source = config_entry_id_to_source(hass, entry_id)\nexcept InvalidSource:\n    # adapter/proxy not loaded yet: wait for bluetooth setup then retry once","preventionTips":["Call source-dependent APIs only after the bluetooth integration reports ready","Keep the adapter or proxy providing the source enabled and online"],"tags":["bluetooth","scanner","source","proxy"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}