{"record":{"id":"6ed8d73ccda23917","repo":"home-assistant/core","slug":"frequency-not-supported","errorCode":null,"errorMessage":"frequency_not_supported","messagePattern":"frequency_not_supported","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/broadlink/radio_frequency.py","lineNumber":40,"sourceCode":"\n_TICK_US = 32.84\n\n_RF_433_TYPE_BYTE = 0xB2\n_RF_315_TYPE_BYTE = 0xB4\n\n_RF_433_RANGE = (433_050_000, 434_790_000)\n_RF_315_RANGE = (314_950_000, 315_250_000)\n\nSUPPORTED_FREQUENCY_RANGES: list[tuple[int, int]] = [_RF_433_RANGE, _RF_315_RANGE]\n\n\ndef _type_byte_for_frequency(frequency: int) -> int:\n    \"\"\"Return the Broadlink RF type byte for a given carrier frequency.\"\"\"\n    if _RF_433_RANGE[0] <= frequency <= _RF_433_RANGE[1]:\n        return _RF_433_TYPE_BYTE\n    if _RF_315_RANGE[0] <= frequency <= _RF_315_RANGE[1]:\n        return _RF_315_TYPE_BYTE\n    raise HomeAssistantError(\n        translation_domain=DOMAIN,\n        translation_key=\"frequency_not_supported\",\n        translation_placeholders={\"frequency\": f\"{frequency / 1_000_000:g}\"},\n    )\n\n\ndef encode_rf_packet(\n    *,\n    type_byte: int,\n    repeat_count: int,\n    timings_us: list[int],\n) -> bytes:\n    \"\"\"Encode raw OOK timings as a Broadlink RF pulse-length packet.\n\n    The layout is::\n\n        byte 0           type byte (0xB2 for 433 MHz, 0xB4 for 315 MHz)\n        byte 1           repeat count (additional transmissions after the first)","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/broadlink/radio_frequency.py#L22-L58","documentation":"HomeAssistantError with key frequency_not_supported, raised by _type_byte_for_frequency when the requested RF carrier frequency falls outside both supported ranges: 433.05–434.79 MHz and 314.95–315.25 MHz. The placeholder 'frequency' is the value formatted in MHz. It is a pre-transmit validation error: no packet is sent to the device.","triggerScenarios":"Sending an RF command via the radio_frequency platform with command.frequency outside _RF_433_RANGE/_RF_315_RANGE — e.g. 435 MHz, 315.5 MHz (just above the 315 band), 868 MHz, or 0 (unset frequency in user-provided raw data).","commonSituations":"Imported/learned codes with wrong frequency metadata, hand-written RF payloads copied from 868 MHz (EU) device docs, or default/zero frequency fields from a caller that never set command.frequency.","solutions":["Set command.frequency to a value inside 433.05–434.79 MHz or 314.95–315.25 MHz.","Verify the frequency encoded by the original remote (most Broadlink-compatible consumer gear is 433.92 MHz).","If your gear is 868 MHz or another band, Broadlink devices cannot transmit it — use a dedicated transmitter.","Check callers that construct InfraredCommand/RF commands to ensure frequency is populated, not 0."],"exampleFix":"// before\ncommand.frequency = 435_000_000  # outside supported range\n\n// after\ncommand.frequency = 433_920_000  # 433.92 MHz, inside _RF_433_RANGE","handlingStrategy":"validation","validationCode":"SUPPORTED_RF_RANGES = [(433_050_000, 434_790_000), (314_950_000, 315_250_000)]\n\ndef is_supported_frequency(freq: int) -> bool:\n    \"\"\"Check the RF carrier is in a Broadlink-transmittable band.\"\"\"\n    return any(lo <= freq <= hi for lo, hi in SUPPORTED_RF_RANGES)","typeGuard":"def is_rf_frequency(value: object) -> bool:\n    \"\"\"Narrow to ints inside the supported 433/315 MHz ranges.\"\"\"\n    return isinstance(value, int) and any(lo <= value <= hi for lo, hi in SUPPORTED_RF_RANGES)","tryCatchPattern":"from homeassistant.exceptions import HomeAssistantError\n\ntry:\n    await rf_entity.async_send_command(command)\nexcept HomeAssistantError as err:\n    if err.translation_key == \"frequency_not_supported\":\n        command.frequency = 433_920_000  # correct the band and retry\n        await rf_entity.async_send_command(command)\n    else:\n        raise","preventionTips":["Always set an explicit frequency when constructing RF commands; never rely on defaults of 0.","Confirm the remote's band (usually 433.92 MHz) before learning/sending.","Centralize the supported-range check where commands are built, not where they are sent."],"tags":["home-assistant","broadlink","radio-frequency","validation"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}