{"record":{"id":"37680262291359f0","repo":"home-assistant/core","slug":"cannot-connect-376802","errorCode":"cannot_connect","errorMessage":"cannot_connect","messagePattern":"cannot_connect","errorType":"exception","errorClass":"ConfigEntryNotReady","httpStatus":null,"severity":"error","filePath":"homeassistant/components/bosch_alarm/__init__.py","lineNumber":54,"sourceCode":"\n    panel = Panel(\n        host=entry.data[CONF_HOST],\n        port=entry.data[CONF_PORT],\n        automation_code=entry.data.get(CONF_PASSWORD),\n        installer_or_user_code=entry.data.get(\n            CONF_INSTALLER_CODE, entry.data.get(CONF_USER_CODE)\n        ),\n    )\n    try:\n        await panel.connect()\n    except (PermissionError, ValueError) as err:\n        await panel.disconnect()\n        raise ConfigEntryAuthFailed(\n            translation_domain=DOMAIN, translation_key=\"authentication_failed\"\n        ) from err\n    except (TimeoutError, OSError, ConnectionRefusedError, SSLError) as err:\n        await panel.disconnect()\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"cannot_connect\",\n        ) from err\n\n    entry.runtime_data = panel\n\n    device_registry = dr.async_get(hass)\n\n    mac = entry.data.get(CONF_MAC)\n\n    device_registry.async_get_or_create(\n        config_entry_id=entry.entry_id,\n        connections={(CONNECTION_NETWORK_MAC, mac)} if mac else set(),\n        identifiers={(DOMAIN, entry.unique_id or entry.entry_id)},\n        name=f\"Bosch {panel.model.name}\",\n        manufacturer=\"Bosch Security Systems\",\n        model=panel.model.name,\n        sw_version=panel.firmware_version,","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bosch_alarm/__init__.py#L36-L72","documentation":"Raised during bosch_alarm setup when panel.connect() fails with TimeoutError, OSError, ConnectionRefusedError, or SSLError. The integration calls panel.disconnect() to clean up and raises ConfigEntryNotReady with translation_key 'cannot_connect', so Home Assistant retries setup with backoff instead of failing permanently.","triggerScenarios":"Wrong host/port in entry data, panel unreachable on the LAN, port not the panel's API port (default 7700 series depend on model), TLS mismatch triggering SSLError, connection refused because the panel's network interface is down.","commonSituations":"Panel IP changed via DHCP, port-forward/NAT rule misconfigured, panel rebooting, VLAN blocking the panel, APNIC/IT-settings disabling network access.","solutions":["Verify reachability: ping the panel and confirm the configured port (test with a raw TCP connect, e.g. nc <host> <port>).","Fix CONF_HOST/CONF_PORT in the integration entry if the panel moved or the port is wrong.","Check firewall/VLAN rules between Home Assistant and the panel.","Let ConfigEntryNotReady retry with backoff — if the panel was rebooting it will recover on its own."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"async def panel_reachable(host: str, port: int, timeout: float = 3.0) -> bool:\n    try:\n        _, w = await asyncio.wait_for(asyncio.open_connection(host, port), timeout)\n        w.close()\n        return True\n    except (OSError, asyncio.TimeoutError):\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    await panel.connect()\nexcept (TimeoutError, OSError, ConnectionRefusedError, SSLError) as err:\n    await panel.disconnect()\n    raise ConfigEntryNotReady(...) from err  # HA retries with backoff automatically","preventionTips":["Pin the panel's IP with a DHCP reservation.","Confirm host and port in the entry after any network change.","Rely on ConfigEntryNotReady backoff rather than manual reload storms."],"tags":["bosch-alarm","network","config-entry","retry","home-assistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}