{"record":{"id":"96ea639d05c71966","repo":"home-assistant/core","slug":"command-error","errorCode":null,"errorMessage":"command_error","messagePattern":"command_error","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/braviatv/coordinator.py","lineNumber":74,"sourceCode":"            await func(self, *args, **kwargs)\n        except BraviaNotFound as err:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"command_error_not_found\",\n                translation_placeholders={\n                    \"device\": self.config_entry.title,\n                },\n            ) from err\n        except (BraviaConnectionError, BraviaConnectionTimeout, BraviaTurnedOff) as err:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"command_error_offline\",\n                translation_placeholders={\n                    \"device\": self.config_entry.title,\n                },\n            ) from err\n        except BraviaError as err:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"command_error\",\n                translation_placeholders={\n                    \"device\": self.config_entry.title,\n                    \"error\": repr(err),\n                },\n            ) from err\n        await self.async_request_refresh()\n\n    return wrapper\n\n\nclass BraviaTVCoordinator(DataUpdateCoordinator[None]):\n    \"\"\"Representation of a Bravia TV Coordinator.\"\"\"\n\n    config_entry: BraviaTVConfigEntry\n\n    def __init__(","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/braviatv/coordinator.py#L56-L92","documentation":"The catch-all branch of @catch_braviatv_errors (coordinator.py:74): any BraviaError that is not NotFound/ConnectionError/ConnectionTimeout/TurnedOff is re-raised as HomeAssistantError with translation_key command_error, rendered as 'Error sending command to {device}: {error}' where {error} is repr(err). It wraps unexpected Bravia API failures during command execution and triggers a coordinator refresh afterwards.","triggerScenarios":"Any client call inside a decorated command method (turn_on, turn_off, volume set, source start, send_command with IRCC codes) raising a generic BraviaError — e.g. the TV returned a malformed/error JSON-RPC response, an unsupported IRCC code, or the API rejected the request while rebooting.","commonSituations":"Sending remote button codes the model does not support; issuing commands exactly while the TV firmware applies an update; library version mismatch between the bravia-tv client and the TV's API; race right after power-on when the API service is not fully started.","solutions":["Inspect the {error} (repr) portion of the message — it carries the underlying BraviaError details that identify the real cause.","Retry the command a few seconds later; transient API errors during TV reboots self-heal.","If an IRCC/send_command code fails, verify the code is valid for the model (not all buttons exist on all remotes).","Update the bravia-tv dependency / Home Assistant to pick up API fixes, then reload the integration."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await coordinator.async_send_command([\"AAAAAQAAAAEAAAAAAw\"], 1)\nexcept HomeAssistantError as err:\n    logger.warning(\"Bravia command failed: %s\", err)","preventionTips":["Log the repr(err) payload — it distinguishes unsupported IRCC codes from API malfunctions.","Retry once after a short delay for transient API errors during TV reboots.","Keep bravia-tv and HA core updated in tandem."],"tags":["braviatv","home-assistant","api-error","media-player"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}