{"record":{"id":"c69a82441c569201","repo":"home-assistant/core","slug":"no-radiofrequency-found-within-learning-timeout-t","errorCode":null,"errorMessage":"No radiofrequency found within {LEARNING_TIMEOUT.total_seconds()} seconds","messagePattern":"No radiofrequency found within (.+?) seconds","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/broadlink/remote.py","lineNumber":393,"sourceCode":"            self.hass,\n            f\"Press and hold the '{command}' button.\",\n            title=\"Sweep frequency\",\n            notification_id=\"sweep_frequency\",\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                is_found, frequency = await device.async_request(\n                    device.api.check_frequency\n                )\n                if is_found:\n                    _LOGGER.debug(\"Radiofrequency detected: %s MHz\", frequency)\n                    break\n            else:\n                await device.async_request(device.api.cancel_sweep_frequency)\n                raise TimeoutError(\n                    \"No radiofrequency found within \"\n                    f\"{LEARNING_TIMEOUT.total_seconds()} seconds\"\n                )\n\n        finally:\n            persistent_notification.async_dismiss(\n                self.hass, notification_id=\"sweep_frequency\"\n            )\n\n        await asyncio.sleep(1)\n\n        try:\n            await device.async_request(device.api.find_rf_packet)\n\n        except (BroadlinkException, OSError) as err:\n            _LOGGER.debug(\"Failed to enter learning mode: %s\", err)\n            raise\n","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/broadlink/remote.py#L375-L411","documentation":"TimeoutError raised by _async_learn_rf_command: during the RF sweep the loop polls device.api.check_frequency every second; if the while loop exhausts LEARNING_TIMEOUT without a detected frequency, it cancels the sweep (cancel_sweep_frequency) and raises. Note it is the loop's else branch, so it only fires when is_found never became True.","triggerScenarios":"remote.learn_command with command_type rf where the original remote never transmits during the sweep window — user does not press the button, remote is 868/2.4 GHz (out of sweep range), or signal too weak for the Broadlink to lock a frequency.","commonSituations":"Learning rolling-code or non-433/315 remotes (garage openers on other bands), walking away during sweep, holding the remote too far away, depleted remote battery.","solutions":["Retry and hold the original remote right next to the Broadlink, pressing repeatedly throughout the whole sweep window.","Verify the remote operates on 433/315 MHz — Broadlink cannot sweep 868 MHz or 2.4 GHz protocols.","For rolling-code garage doors prefer the vendor's integration rather than learned codes.","Keep other 433 transmitters quiet during learning to avoid locking onto the wrong signal."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"SUPPORTED_RF_RANGES = [(433_050_000, 434_790_000), (314_950_000, 315_250_000)]\n\ndef remote_band_supported(freq_hz: int) -> bool:\n    \"\"\"Cheap pre-check that learning can possibly succeed for this band.\"\"\"\n    return any(lo <= freq_hz <= hi for lo, hi in SUPPORTED_RF_RANGES)","typeGuard":null,"tryCatchPattern":"try:\n    code = await remote._async_learn_rf_command(command)\nexcept TimeoutError as err:\n    _LOGGER.warning(\"RF sweep timed out: %s\", err)\n    # sweep already cancelled by the integration; instruct the user and retry once\n    raise HomeAssistantError(\"Hold the remote next to the device and keep pressing during the sweep\") from err","preventionTips":["Keep pressing the original remote button throughout the entire sweep window, held close to the Broadlink.","Confirm the remote uses 433/315 MHz before attempting RF learning.","Silence other 433 MHz transmitters during learning to avoid locking the wrong frequency."],"tags":["home-assistant","broadlink","radio-frequency","learning","timeout"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}