Mastering Legacy Device Control: Integrating Broadlink with Home Assistant for Universal IR/RF Automation

NGC 224
DIY Smart Home Creator
Mastering Legacy Device Control: Integrating Broadlink with Home Assistant for Universal IR/RF Automation
In the quest for a fully integrated smart home, you inevitably encounter the challenge of legacy devices – your trusty old TV, a classic air conditioner, or that ceiling fan with only an IR remote. These devices lack modern connectivity, leaving them outside the reach of your smart ecosystem. This is where Broadlink devices, specifically their IR/RF blasters, become indispensable. By acting as a universal remote bridge, Broadlink allows Home Assistant to command these 'dumb' appliances, bringing them into the fold of your automated world.
This guide will walk you through the entire process: from setting up your Broadlink device and integrating it with Home Assistant, to learning IR and RF codes, creating actionable controls, exploring real-world use cases, and finally, troubleshooting common pitfalls. Prepare to unlock a new level of control over your home!
Supported Broadlink Devices for Home Assistant
While Broadlink offers several models, the most popular and versatile for Home Assistant integration are:
- Broadlink RM Mini 3/4: Excellent for InfraRed (IR) control. Compact and cost-effective.
- Broadlink RM Pro 3/4: The powerhouse, offering both InfraRed (IR) and Radio Frequency (RF) control. Essential for devices like ceiling fans, electric blinds, or older garage door openers that use RF.
For RF control, ensure you purchase a 'Pro' model. This guide will cover both IR and RF learning.
Step-by-Step Integration Guide
1. Initial Broadlink Device Setup
- Download the Broadlink App: Install the official "Broadlink" app (not "IHC" or "Broadlink BLE") from your smartphone's app store (iOS or Android).
- Connect to Wi-Fi: Follow the in-app instructions to power on your Broadlink device and connect it to your 2.4 GHz Wi-Fi network. Ensure your phone is also on the 2.4 GHz band during this process.
- Assign a Static IP Address: Immediately after setup, go into your router's administration interface and assign a static IP address to your Broadlink device. This is crucial for reliable Home Assistant integration, preventing network disruptions if its IP changes.
- Lock Device from Cloud (Crucial!): In the Broadlink app, navigate to your device settings (often by tapping the device icon, then the three dots or settings gear). Look for an option like "Lock device," "Prevent remote access," or "Keep device local." Enable this! This prevents the device from constantly trying to connect to Broadlink's cloud services, which can interfere with Home Assistant's local control and improve responsiveness and privacy.
2. Home Assistant Configuration
The broadlink
integration is native to Home Assistant and is often auto-discovered. If not, or if you prefer explicit configuration, add the following to your configuration.yaml
:
broadlink:
- host: 192.168.1.100 # Your Broadlink's static IP
mac: 'XX:XX:XX:XX:XX:XX' # MAC address of your Broadlink device (find in router or Broadlink app)
type: rm4_pro # e.g., rm4_pro, rm4_mini, rm3_mini, rm_pro
Replace the example IP and MAC address with your device's details. Save the file and restart Home Assistant.
3. Learning IR Codes (InfraRed)
IR codes are straightforward to learn and are used for most TVs, set-top boxes, and older AC units.
- Navigate to Developer Tools: In your Home Assistant UI, go to Developer Tools > Services.
- Select the Service: Choose
remote.learn_command
. - Configure the Service:
- Target: Select your Broadlink remote entity (e.g.,
remote.broadlink_rm4_pro_remote
). - Command: (Optional) Provide a name for the command you are learning, like
tv_power_on
. This helps if you plan to learn multiple commands in one session. - Command Type: Set this to
ir
.
- Target: Select your Broadlink remote entity (e.g.,
- Call Service and Learn: Click "Call Service." The Broadlink LED should turn blue or orange. Point your physical remote at the Broadlink (ideally 1-2 inches away, directly at its IR window) and press the button you wish to learn.
- Retrieve the Code: Once learned, the Broadlink's LED will revert to its normal state. The learned code (a long string starting with
JgB...
) will appear in your Home Assistant logs (home-assistant.log
) or a persistent notification. Copy this code.
4. Learning RF Codes (Radio Frequency - RM Pro/RM4 Pro Only)
RF learning is a two-step process to account for the frequency and then the actual signal.
- Navigate to Developer Tools: In your Home Assistant UI, go to Developer Tools > Services.
- Start RF Learning - Step 1 (Frequency):
- Select the Service: Choose
remote.learn_command
. - Target: Select your Broadlink remote entity.
- Command Type: Set this to
rf
. - Click "Call Service." The Broadlink LED will turn blue.
- Hold down the button on your RF remote (e.g., ceiling fan remote) for about 3 seconds. The Broadlink will beep or flash, indicating it has learned the frequency. You might see a short code (e.g.,
JkAA...
) in the logs, signifying the frequency was detected.
- Select the Service: Choose
- Complete RF Learning - Step 2 (Signal):
- Immediately after Step 1, while the Broadlink LED is still blue, quickly press the same button on your RF remote one or more times. The Broadlink should indicate successful learning (e.g., a long beep or a different LED pattern).
- The full RF code (a very long string, also starting with
JgB...
but much longer than IR codes) will appear in your Home Assistant logs or a persistent notification. Copy this code.
Tip: If the learning process fails, ensure the remote has fresh batteries and try again, adjusting distance and angle slightly. RF signals can be more finicky.
5. Creating Control Entities (Switches and Remotes)
Once you have your codes, you can create entities in Home Assistant to send them.
Option A: Simple Switches (On/Off)
Ideal for devices where a single button acts as a toggle, or you have distinct on/off codes.
# configuration.yaml or a dedicated switches.yaml
switch:
- platform: broadlink
mac: 'XX:XX:XX:XX:XX:XX' # Your Broadlink MAC
switches:
living_room_tv_power:
friendly_name: "Living Room TV Power"
command_on: 'JgB...IR_CODE_FOR_TV_POWER_ON...'
command_off: 'JgB...IR_CODE_FOR_TV_POWER_OFF...' # Or use the same code for toggle
master_bedroom_fan:
friendly_name: "Master Bedroom Fan"
command_on: 'JgB...RF_CODE_FOR_FAN_ON...'
command_off: 'JgB...RF_CODE_FOR_FAN_OFF...'
Option B: Remote Entity (Multiple Commands)
Better for devices like TVs with many buttons (channel up/down, volume, input, etc.).
# configuration.yaml or a dedicated remotes.yaml
remote:
- platform: broadlink
mac: 'XX:XX:XX:XX:XX:XX'
name: "Living Room TV Remote"
commands:
power_on: 'JgB...TV_POWER_ON_CODE...'
power_off: 'JgB...TV_POWER_OFF_CODE...'
input_hdmi1: 'JgB...HDMI1_INPUT_CODE...'
volume_up: 'JgB...VOLUME_UP_CODE...'
volume_down: 'JgB...VOLUME_DOWN_CODE...'
channel_up: 'JgB...CHANNEL_UP_CODE...'
# Add all other necessary buttons here
After adding these configurations, restart Home Assistant to make the new entities available.
Real-World Use Cases & Automations
Now that your legacy devices are integrated, the real fun begins!
- Smart TV Control:
- Presence-Based Activation: Turn on the TV and set it to a specific input when a motion sensor detects presence in the living room after sunset, or when someone arrives home.
- Media Player Integration: When your Apple TV or Chromecast state changes to 'playing', automatically turn on the TV and switch to the correct HDMI input.
- Goodnight Routine: Include turning off the TV (and other devices) in your 'Goodnight' automation.
- Climate Control with Dumb AC/Heaters:
- Smart Thermostat Emulation: Combine a temperature/humidity sensor with Home Assistant's Generic Thermostat integration. Use the thermostat's state changes to send specific IR codes to your AC unit (e.g., turn on cool mode at 24°C, turn off at 22°C).
- Voice Control: "Hey Google, set the living room AC to 23 degrees."
- Automated Ceiling Fan / Electric Blinds:
- Temperature/Humidity Response: Turn on your ceiling fan at a low speed when the room temperature exceeds 25°C, increasing speed as it gets warmer.
- Time-Based Blinds: Open blinds at sunrise, close them at sunset or based on external light levels.
Advanced Configurations
1. Template Switches for Complex Sequences
Sometimes, a single 'on' or 'off' command isn't enough. You might need to send multiple IR/RF signals with delays. Template switches are perfect for this.
# configuration.yaml or a dedicated templateswitches.yaml
switch:
- platform: template
switches:
watch_apple_tv:
friendly_name: "Watch Apple TV"
turn_on:
- service: remote.send_command
target:
entity_id: remote.living_room_tv_remote
data:
command: power_on
- delay: "00:00:02" # Wait for TV to power on
- service: remote.send_command
target:
entity_id: remote.living_room_tv_remote
data:
command: input_hdmi1
turn_off:
- service: remote.send_command
target:
entity_id: remote.living_room_tv_remote
data:
command: power_off
This template switch creates a single entity (switch.watch_apple_tv
) that, when turned on, sends the TV power-on code, waits 2 seconds, then sends the HDMI 1 input code.
2. Integrating with Voice Assistants
Exposing your Broadlink-controlled entities to voice assistants like Google Assistant or Amazon Alexa is straightforward. If you use Home Assistant Cloud (Nabu Casa), simply enable the entities you wish to expose. For local voice solutions, refer to specific integration guides.
- "Hey Google, turn on Living Room TV."
- "Alexa, set AC to cool."
Troubleshooting Common Issues
1. Broadlink Device Not Found/Unavailable in Home Assistant
- Static IP: Confirm your Broadlink device has a static IP address assigned by your router. Dynamic IPs can change, breaking the connection.
- Network Connectivity: Ensure the Broadlink is connected to your Wi-Fi and on the same subnet as your Home Assistant instance.
- Cloud Lock: Double-check the "Lock device" setting in the Broadlink app. If it's trying to connect to Broadlink's cloud, Home Assistant might struggle to establish a local connection. Disable cloud access.
- Firewall: If you have network segmentation or a strict firewall, ensure ports required for communication (e.g., UDP port 80) are open between Home Assistant and the Broadlink device.
- Power Cycle: A quick power cycle of the Broadlink device and then Home Assistant can often resolve temporary connection glitches.
2. IR/RF Codes Not Learning Correctly
- Proximity and Angle: For IR, place the remote 1-2 inches from the Broadlink's IR receiver. For RF, proximity is less critical but ensure a clear line of signal.
- Remote Battery: A weak battery in your physical remote can lead to inconsistent or unlearnable signals. Replace batteries if in doubt.
- Timing for RF: Remember the two-step RF learning process: hold for frequency, then quick-press for the code. Ensure you follow this precisely.
- Interference: Minimize other IR/RF sources (other remotes, bright lights for IR) during the learning process.
- Check Logs: Always refer to your Home Assistant logs (
home-assistant.log
) for any errors or messages during the learning process.
3. Command Execution Issues (Intermittent or Not Working)
- IR/RF Range & Line of Sight: Ensure your Broadlink is placed optimally to have a clear line of sight to all IR-controlled devices. For RF, obstructions are less critical but range is still a factor.
- Interference: Other electronics or strong Wi-Fi signals can sometimes interfere with RF transmission.
- Code Integrity: Double-check that the copied code in your YAML configuration is exact, with no missing characters or extra spaces.
- Multiple Commands: If using a sequence (like a template switch), ensure adequate delays between commands. Some devices take a moment to process one command before being ready for the next.
Best Practices for a Scalable, Reliable, and Secure Smart Home
- Static IP for Broadlink: As mentioned, this is paramount for stability. Configure it in your router.
- Centralized & Organized Configuration: Keep your Broadlink configurations (switches, remotes, template entities) well-organized. Consider using package files or dedicated
!include
directives (e.g.,broadlink_remotes.yaml
,broadlink_switches.yaml
) to keep yourconfiguration.yaml
tidy. - Descriptive Naming: Use clear, unambiguous
friendly_name
for your Broadlink-controlled entities and distinct names for learned commands. This makes automations easier to build and debug. - Strategic Device Placement: Position your Broadlink device(s) where they can best reach their target devices. For larger rooms or rooms with multiple IR devices facing different directions, consider using multiple Broadlink units.
- Regular Configuration Backups: Implement a robust backup strategy for your Home Assistant configuration. This is vital to preserve all your learned IR/RF codes and automations.
- Limit Cloud Dependence: Actively lock your Broadlink devices from connecting to the manufacturer's cloud services. This improves local control, responsiveness, and privacy.
- Network Segmentation (Advanced): For optimal security, consider placing all your IoT devices, including Broadlink, on a separate VLAN. This isolates them from your primary network, minimizing potential attack surfaces.
Conclusion
Integrating Broadlink devices with Home Assistant is a game-changer for extending your smart home's reach to legacy IR and RF-controlled appliances. By following the steps outlined in this guide, you can transform your old TV, AC unit, or ceiling fan into an intelligent, automatable, and voice-controlled component of your modern smart ecosystem. The possibilities for creating sophisticated, seamless automations are immense, allowing you to truly master every aspect of your living space.
Start experimenting with your Broadlink and Home Assistant today, and breathe new life into your cherished, non-smart devices!

NGC 224
Author bio: DIY Smart Home Creator