{"record":{"id":"f627e29ea9aa0615","repo":"home-assistant/core","slug":"cannot-connect","errorCode":"cannot_connect","errorMessage":"cannot_connect","messagePattern":"cannot_connect","errorType":"exception","errorClass":"AbortFlow","httpStatus":null,"severity":"error","filePath":"homeassistant/components/airzone/config_flow.py","lineNumber":125,"sourceCode":"        self._discovered_mac = discovery_info.macaddress\n\n        _LOGGER.debug(\n            \"DHCP discovery detected Airzone WebServer: %s\", self._discovered_mac\n        )\n\n        self._async_abort_entries_match({CONF_HOST: self._discovered_ip})\n\n        await self.async_set_unique_id(format_mac(self._discovered_mac))\n        self._abort_if_unique_id_configured()\n\n        options = ConnectionOptions(self._discovered_ip)\n        airzone = AirzoneLocalApi(\n            aiohttp_client.async_get_clientsession(self.hass), options\n        )\n        try:\n            await airzone.get_version()\n        except (AirzoneError, TimeoutError) as err:\n            raise AbortFlow(\"cannot_connect\") from err\n\n        return await self.async_step_discovered_connection()\n\n    async def async_step_discovered_connection(\n        self, user_input: dict[str, Any] | None = None\n    ) -> ConfigFlowResult:\n        \"\"\"Confirm discovery.\"\"\"\n        assert self._discovered_ip is not None\n        assert self._discovered_mac is not None\n\n        errors = {}\n        base_schema = {vol.Required(CONF_PORT, default=DEFAULT_PORT): int}\n\n        if user_input is not None:\n            airzone = AirzoneLocalApi(\n                aiohttp_client.async_get_clientsession(self.hass),\n                ConnectionOptions(\n                    self._discovered_ip,","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/airzone/config_flow.py#L107-L143","documentation":"AbortFlow with reason 'cannot_connect' raised in the Airzone local integration's config flow (discovered-connection step). After discovery finds the device, the flow calls airzone.get_version() to verify the local API is reachable; any AirzoneError or TimeoutError aborts setup with 'cannot_connect'. AbortFlow is not an error surfaced to the user as an exception — HA renders it as a discovery flow message keyed by the reason string.","triggerScenarios":"Discovery finds an Airzone WebServer at _discovered_ip but the HTTP GET to its API (get_version) fails: wrong/unreachable IP, WebServer firmware blocking the API, port 3000 not reachable (though default is checked later), device rebooting, or the request exceeding the library timeout.","commonSituations":"mDNS discovery returning a stale IP after DHCP reassignment; VLAN/IGMP isolation between the HA host and the HVAC network; Airzone WebServer with old firmware that requires a different endpoint; device powered off mid-discovery.","solutions":["Verify the Airzone WebServer is reachable from the HA host: curl http://<ip>:3000/api/v1/hvac (or the integration's documented endpoint).","Confirm no duplicate config entry already uses that host (the flow aborts for duplicates just above this code, but leftover entries cause confusion).","Check firewall/VLAN rules allowing HTTP from HA to the device, then retry discovery.","If the IP is stale, reserve a static DHCP lease for the WebServer and rediscover."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import asyncio, aiohttp\n\nasync def webserver_reachable(ip: str) -> bool:\n    try:\n        async with aiohttp.ClientSession() as s, asyncio.timeout(5):\n            async with s.get(f\"http://{ip}:3000/api/v1/hvac\") as r:\n                return r.status == 200\n    except (aiohttp.ClientError, TimeoutError):\n        return False","typeGuard":null,"tryCatchPattern":"from homeassistant.data_entry_flow import AbortFlow\n\ntry:\n    await hass.config_entries.flow.async_configure(flow_id, user_input)\nexcept AbortFlow as err:\n    if err.reason == \"cannot_connect\":\n        # prompt user to check device/network and retry discovery\n        ...","preventionTips":["Reserve a static DHCP lease for the Airzone WebServer.","Ensure HA and the HVAC bridge are on the same VLAN/subnet before discovery.","Verify the WebServer responds over HTTP before starting the flow."],"tags":["airzone","config-flow","discovery","network","abort-flow"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}