home-assistant/core · error · HomeAssistantError

command_error

Error message

command_error

What it means

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.

Source

Thrown at homeassistant/components/braviatv/coordinator.py:74

            await func(self, *args, **kwargs)
        except BraviaNotFound as err:
            raise HomeAssistantError(
                translation_domain=DOMAIN,
                translation_key="command_error_not_found",
                translation_placeholders={
                    "device": self.config_entry.title,
                },
            ) from err
        except (BraviaConnectionError, BraviaConnectionTimeout, BraviaTurnedOff) as err:
            raise HomeAssistantError(
                translation_domain=DOMAIN,
                translation_key="command_error_offline",
                translation_placeholders={
                    "device": self.config_entry.title,
                },
            ) from err
        except BraviaError as err:
            raise HomeAssistantError(
                translation_domain=DOMAIN,
                translation_key="command_error",
                translation_placeholders={
                    "device": self.config_entry.title,
                    "error": repr(err),
                },
            ) from err
        await self.async_request_refresh()

    return wrapper


class BraviaTVCoordinator(DataUpdateCoordinator[None]):
    """Representation of a Bravia TV Coordinator."""

    config_entry: BraviaTVConfigEntry

    def __init__(

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Inspect the {error} (repr) portion of the message — it carries the underlying BraviaError details that identify the real cause.
  2. Retry the command a few seconds later; transient API errors during TV reboots self-heal.
  3. If an IRCC/send_command code fails, verify the code is valid for the model (not all buttons exist on all remotes).
  4. Update the bravia-tv dependency / Home Assistant to pick up API fixes, then reload the integration.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    await coordinator.async_send_command(["AAAAAQAAAAEAAAAAAw"], 1)
except HomeAssistantError as err:
    logger.warning("Bravia command failed: %s", err)

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/96ea639d05c71966. Report an issue: GitHub.