{"record":{"id":"9eb516b856d0e17d","repo":"home-assistant/core","slug":"no-radiofrequency-code-received-within-learning-t","errorCode":null,"errorMessage":"No radiofrequency code received within {LEARNING_TIMEOUT.total_seconds()} seconds","messagePattern":"No radiofrequency code received within (.+?) seconds","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/broadlink/remote.py","lineNumber":429,"sourceCode":"\n        persistent_notification.async_create(\n            self.hass,\n            f\"Press the '{command}' button again.\",\n            title=\"Learn command\",\n            notification_id=\"learn_command\",\n        )\n\n        try:\n            start_time = dt_util.utcnow()\n            while (dt_util.utcnow() - start_time) < LEARNING_TIMEOUT:\n                await asyncio.sleep(1)\n                try:\n                    code = await device.async_request(device.api.check_data)\n                except ReadError, StorageError:\n                    continue\n                return b64encode(code).decode(\"utf8\")\n\n            raise TimeoutError(\n                \"No radiofrequency code received within \"\n                f\"{LEARNING_TIMEOUT.total_seconds()} seconds\"\n            )\n\n        finally:\n            persistent_notification.async_dismiss(\n                self.hass, notification_id=\"learn_command\"\n            )\n\n    @override\n    async def async_delete_command(self, **kwargs: Any) -> None:\n        \"\"\"Delete a list of commands from a remote.\"\"\"\n        kwargs = SERVICE_DELETE_SCHEMA(kwargs)\n        commands = kwargs[ATTR_COMMAND]\n        subdevice = kwargs[ATTR_DEVICE]\n        service = f\"{RM_DOMAIN}.{SERVICE_DELETE_COMMAND}\"\n\n        if not self._attr_is_on:","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/broadlink/remote.py#L411-L447","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Repeat the learn_command call and press and hold the RF remote button for the entire learning window as soon as the notification appears","Verify the remote transmits RF (test with another receiver) and replace batteries if weak","Confirm the Broadlink device is online (available) and its model supports RF learning","Move the remote close to the Broadlink device and remove interference sources","Catch TimeoutError in automations calling learn_command and surface a retry prompt to the user"],"exampleFix":"# before\nawait remote.async_learn_command()\n\n# after\ntry:\n    await remote.async_learn_command()\nexcept TimeoutError:\n    # notify user to hold the RF button during the whole learning window\n    await notify_service.async_call(message='Press and hold the remote button during the learning window')","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await remote.async_learn_command()\nexcept TimeoutError:\n    # RF code not captured in time; retry and hold the button longer\n    await retry_with_notification()","preventionTips":["Press and hold the RF remote button for the entire learning window, starting immediately when the notification appears","Use fresh batteries in the remote before learning RF codes","Wrap learn_command automations in TimeoutError handling that prompts the user to retry"],"tags":["broadlink","rf-learning","timeout","remote","home-assistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}