{"record":{"id":"7af885c24119442f","repo":"home-assistant/core","slug":"connection-to-pro-unit-lost-err","errorCode":null,"errorMessage":"Connection to Pro unit lost: {err}","messagePattern":"Connection to Pro unit lost: (.+?)","errorType":"exception","errorClass":"UpdateFailed","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/airvisual_pro/coordinator.py","lineNumber":74,"sourceCode":"        self.reload_task: asyncio.Task[bool] | None = None\n\n    @override\n    async def _async_update_data(self) -> dict[str, Any]:\n        \"\"\"Get data from the device.\"\"\"\n        try:\n            data = await self._node.async_get_latest_measurements()\n            data[\"history\"] = {}\n            if data[\"settings\"].get(\"follow_mode\") == \"device\":\n                history = await self._node.async_get_history(include_trends=False)\n                data[\"history\"] = history.get(\"measurements\", [])[-1]\n        except InvalidAuthenticationError as err:\n            raise ConfigEntryAuthFailed(\"Invalid Samba password\") from err\n        except NodeConnectionError as err:\n            if self.reload_task is None:\n                self.reload_task = self.hass.async_create_task(\n                    self.hass.config_entries.async_reload(self.config_entry.entry_id)\n                )\n            raise UpdateFailed(f\"Connection to Pro unit lost: {err}\") from err\n        except NodeProError as err:\n            raise UpdateFailed(f\"Error while retrieving data: {err}\") from err\n\n        return data\n","sourceCodeStart":56,"sourceCodeEnd":79,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/airvisual_pro/coordinator.py#L56-L79","documentation":"UpdateFailed raised when the Samba connection to the AirVisual Pro unit drops mid-operation (NodeConnectionError). Distinctively, the coordinator also schedules a one-shot config entry reload in the background (guarded by reload_task being None) to re-establish the connection, so this error both marks the update failed and triggers self-healing.","triggerScenarios":"async_get_latest_measurements() or async_get_history() raises NodeConnectionError: unit powered off, network drop to the unit, SMB session terminated by the device (idle timeout, reboot), or unit IP changed so the connection target is stale.","commonSituations":"Pro unit rebooting or power-cycled, WiFi instability, DHCP address change making the stored connection invalid, or long gaps between polls exceeding the unit's SMB session timeout.","solutions":["Confirm the Pro unit is powered on and its web dashboard loads.","Fix the unit's IP with a DHCP reservation or correct the config entry host.","Let the automatic reload task run — it re-establishes the session without user action.","Check network stability between Home Assistant and the unit if drops recur.","Shorten the update interval if SMB idle timeouts are disconnecting the session."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"def is_airvisual_pro_connection_lost(err: Exception) -> bool:\n    return isinstance(err, UpdateFailed) and str(err).startswith(\"Connection to Pro unit lost\")","tryCatchPattern":"try:\n    await coordinator.async_refresh()\nexcept UpdateFailed as err:\n    if str(err).startswith(\"Connection to Pro unit lost\"):\n        # coordinator already schedules a self-reload; just wait for the next cycle\n        pass\n    raise","preventionTips":["Give the AirVisual Pro unit a DHCP reservation so the Samba target never changes.","Keep the unit on wired/stable network — WiFi dropouts are the top cause of NodeConnectionError.","Trust the built-in reload task: do not stack manual reloads on top of it."],"tags":["home-assistant","airvisual-pro","samba","network","auto-reload"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}