home-assistant/core · error · HomeAssistantError

send_command_failed

Error message

send_command_failed

What it means

HomeAssistantError with key send_command_failed, raised by the Broadlink IR remote entity's async_send_command (the send_ir_code / remote.send_command path) when self._device.api.send_data raises BroadlinkException or OSError. The placeholder 'error' carries the library error text. The raw timings have already been encoded into a Broadlink packet at this point, so failures are transport/device-level.

Source

Thrown at homeassistant/components/broadlink/infrared.py:64

class BroadlinkInfraredEntity(BroadlinkEntity, InfraredEmitterEntity):
    """Broadlink infrared emitter entity."""

    _attr_has_entity_name = True
    _attr_translation_key = "infrared_emitter"

    def __init__(self, device: BroadlinkDevice) -> None:
        """Initialize the entity."""
        super().__init__(device)
        self._attr_unique_id = f"{device.unique_id}-emitter"

    @override
    async def async_send_command(self, command: InfraredCommand) -> None:
        """Send an IR command via the Broadlink device."""
        packet = _timings_to_broadlink_packet(command.get_raw_timings())
        try:
            await self._device.async_request(self._device.api.send_data, packet)
        except (BroadlinkException, OSError) as err:
            raise HomeAssistantError(
                translation_domain=DOMAIN,
                translation_key="send_command_failed",
                translation_placeholders={"error": str(err)},
            ) from err

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Confirm the device is online (ping / HA device page) and retry the command.
  2. Reload the Broadlink integration so the connection and auth are re-established.
  3. Fix stale IP: set DHCP reservation or use the reconfigure flow.
  4. Check the 'error' placeholder text in the UI message for the underlying BroadlinkException reason.
Defensive patterns

Strategy: retry

Try / catch

try:
    await remote.async_send_command(command)
except HomeAssistantError as err:
    if err.translation_key == "send_command_failed":
        raise HomeAssistantErrorRetryLater from err  # device transiently unreachable
    raise

Prevention

When it happens

Trigger: Calling remote.send_command (or the infrared emitter platform) on a Broadlink IR device while send_data fails: device offline, auth state lost after reboot, network error, device returning an error status.

Common situations: Device IP changed since setup, device rebooted and dropped its auth session (needs re-setup), automation firing while Wi-Fi is down, sending very long timing arrays the device rejects.

Related errors


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