{"record":{"id":"7b5eb9ca7c832a37","repo":"home-assistant/core","slug":"error-in-altruist-setup","errorCode":null,"errorMessage":"Error in Altruist setup","messagePattern":"Error in Altruist setup","errorType":"exception","errorClass":"ConfigEntryNotReady","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/altruist/coordinator.py","lineNumber":56,"sourceCode":"        device_id = config_entry.unique_id\n        super().__init__(\n            hass,\n            logger=_LOGGER,\n            config_entry=config_entry,\n            name=f\"Altruist {device_id}\",\n            update_interval=UPDATE_INTERVAL,\n        )\n        self._ip_address = config_entry.data[CONF_HOST]\n\n    @override\n    async def _async_setup(self) -> None:\n        try:\n            self.client = await AltruistClient.from_ip_address(\n                async_get_clientsession(self.hass), self._ip_address\n            )\n            await self.client.fetch_data()\n        except AltruistError as e:\n            raise ConfigEntryNotReady(\"Error in Altruist setup\") from e\n\n    @override\n    async def _async_update_data(self) -> dict[str, str]:\n        try:\n            fetched_data = await self.client.fetch_data()\n        except AltruistError as ex:\n            raise UpdateFailed(\n                f\"The Altruist {self.client.device_id} is unavailable: {ex}\"\n            ) from ex\n        return {item[\"value_type\"]: item[\"value\"] for item in fetched_data}\n","sourceCodeStart":38,"sourceCodeEnd":67,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/altruist/coordinator.py#L38-L67","documentation":"ConfigEntryNotReady('Error in Altruist setup') raised in AltruistCoordinator._async_setup when AltruistClient.from_ip_address() or the initial fetch_data() raises AltruistError (base class of the altruist-client library: connection, timeout, or bad response). Home Assistant will retry setup with backoff; the integration stays unavailable meanwhile.","triggerScenarios":"Config entry setup where the local Altruist sensor device at config_entry.data[CONF_HOST] cannot be reached (wrong IP, device offline, HTTP error) or does not respond with valid data — any AltruistError during client construction or first fetch.","commonSituations":"Static-IP Altruist device got a new DHCP address, device powered off or booting when HA starts, firewall blocking the local HTTP API, or a firmware change altering responses.","solutions":["Confirm the Altruist device is powered on and reachable at the configured IP (ping / curl its HTTP endpoint)","If the device IP changed, update the config entry host or assign a static DHCP lease","Fix local network/firewall issues blocking the host","Wait for automatic retry or reload the integration once the device is up"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import socket\n# Pre-flight reachability check before (re)loading the entry\ntry:\n    socket.getaddrinfo(host, 80)\nexcept socket.gaierror:\n    _LOGGER.warning(\"Altruist host %s does not resolve\", host)","typeGuard":null,"tryCatchPattern":"# ConfigEntryNotReady is retried by HA with backoff; in custom setup code:\ntry:\n    client = await AltruistClient.from_ip_address(session, host)\nexcept AltruistError as e:\n    raise ConfigEntryNotReady(\"Error in Altruist setup\") from e","preventionTips":["Assign the Altruist device a static DHCP reservation so the configured IP stays valid","Ensure the device is powered before HA restarts","Allow local HTTP access on the LAN (no client isolation on the Wi-Fi)"],"tags":["altruist","local-device","config-entry","retry","homeassistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}