{"record":{"id":"6cd302ba5963da7b","repo":"home-assistant/core","slug":"unknown-error","errorCode":"unknown_error","errorMessage":"An unknown error occurred while communicating with the Airgradient device: {error}","messagePattern":"An unknown error occurred while communicating with the Airgradient device: (.+?)","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/airgradient/entity.py","lineNumber":56,"sourceCode":"    func: Callable[Concatenate[_EntityT, _P], Coroutine[Any, Any, Any]],\n) -> Callable[Concatenate[_EntityT, _P], Coroutine[Any, Any, None]]:\n    \"\"\"Decorate AirGradient calls to handle exceptions.\n\n    A decorator that wraps the passed in function, catches AirGradient errors.\n    \"\"\"\n\n    async def handler(self: _EntityT, *args: _P.args, **kwargs: _P.kwargs) -> None:\n        try:\n            await func(self, *args, **kwargs)\n        except AirGradientConnectionError as error:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"communication_error\",\n                translation_placeholders={\"error\": str(error)},\n            ) from error\n\n        except AirGradientError as error:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"unknown_error\",\n                translation_placeholders={\"error\": str(error)},\n            ) from error\n\n    return handler\n","sourceCodeStart":38,"sourceCodeEnd":63,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/airgradient/entity.py#L38-L63","documentation":"The sibling branch of the AirGradient exception_handler: a non-connection AirGradientError from a library call on an entity action becomes HomeAssistantError with translation key unknown_error. Typically this means the request reached the device but the device/library rejected it — bad payload, unsupported control on this firmware, or a malformed response.","triggerScenarios":"Entity service call raises a generic AirGradientError that is not AirGradientConnectionError — e.g. the firmware does not support the control being set, the API returned an error status, or response parsing failed.","commonSituations":"Older firmware that lacks a control endpoint the integration exposes, or a device model where a feature (e.g. fan control) is not available even though the entity was created.","solutions":["Update the AirGradient device firmware to the latest version so all control endpoints exist","Check the wrapped original error in the log to see which control call failed and what the device answered","Avoid invoking the unsupported control on this hardware model","If firmware is current, report the issue to the airgradient library maintainers with the device model"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await hass.services.async_call(DOMAIN, service, data, blocking=True)\nexcept HomeAssistantError as err:\n    # unknown_error: request reached device but was rejected; inspect chained error in logs\n    _LOGGER.warning(\"AirGradient rejected command: %s\", err)","preventionTips":["Keep device firmware current so all control endpoints exist","Check the chained AirGradientError in logs to distinguish rejection from connectivity","Do not invoke controls unsupported by the hardware model"],"tags":["airgradient","home-assistant","firmware","entity-action"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}