home-assistant/core · error · TimeoutError

No radiofrequency code received within {LEARNING_TIMEOUT.tot

Error message

No radiofrequency code received within {LEARNING_TIMEOUT.total_seconds()} seconds

What it means

Raised by the Broadlink remote's RF learning loop after polling device.api.check_data every second for the duration of LEARNING_TIMEOUT without receiving a radiofrequency code. The device is in learning mode but never captured a transmission before the deadline. A TimeoutError propagates to the user's learn_command service call.

Source

Thrown at homeassistant/components/broadlink/remote.py:429

        persistent_notification.async_create(
            self.hass,
            f"Press the '{command}' button again.",
            title="Learn command",
            notification_id="learn_command",
        )

        try:
            start_time = dt_util.utcnow()
            while (dt_util.utcnow() - start_time) < LEARNING_TIMEOUT:
                await asyncio.sleep(1)
                try:
                    code = await device.async_request(device.api.check_data)
                except ReadError, StorageError:
                    continue
                return b64encode(code).decode("utf8")

            raise TimeoutError(
                "No radiofrequency code received within "
                f"{LEARNING_TIMEOUT.total_seconds()} seconds"
            )

        finally:
            persistent_notification.async_dismiss(
                self.hass, notification_id="learn_command"
            )

    @override
    async def async_delete_command(self, **kwargs: Any) -> None:
        """Delete a list of commands from a remote."""
        kwargs = SERVICE_DELETE_SCHEMA(kwargs)
        commands = kwargs[ATTR_COMMAND]
        subdevice = kwargs[ATTR_DEVICE]
        service = f"{RM_DOMAIN}.{SERVICE_DELETE_COMMAND}"

        if not self._attr_is_on:

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Repeat the learn_command call and press and hold the RF remote button for the entire learning window as soon as the notification appears
  2. Verify the remote transmits RF (test with another receiver) and replace batteries if weak
  3. Confirm the Broadlink device is online (available) and its model supports RF learning
  4. Move the remote close to the Broadlink device and remove interference sources
  5. Catch TimeoutError in automations calling learn_command and surface a retry prompt to the user

Example fix

# before
await remote.async_learn_command()

# after
try:
    await remote.async_learn_command()
except TimeoutError:
    # notify user to hold the RF button during the whole learning window
    await notify_service.async_call(message='Press and hold the remote button during the learning window')
Defensive patterns

Strategy: try-catch

Try / catch

try:
    await remote.async_learn_command()
except TimeoutError:
    # RF code not captured in time; retry and hold the button longer
    await retry_with_notification()

Prevention

When it happens

Trigger: Calling the learn_command service for an RF (not IR) code and not pressing and holding the remote button during the learning window; remote batteries dead or wrong remote; Broadlink device not actually entering RF learning mode; button pressed before the loop started or after the timeout elapsed.

Common situations: User reads the persistent notification late and presses the remote after the window closed; trying to learn a 433MHz/RF code with the remote out of range; device firmware that returns no data while in RF sweep mode; holding the button too briefly for RF codes which need a long press.

Understand the failure class

Related errors


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