Use Home Assistant to Control Infrared (IR) and Radio Frequency (RF) Devices

When setting up a smart home – especially in the early stages – there will be many “non-smart” devices in the house. An option is to replace them with newer “smart versions”. But that’s costly and in some instances, not possible to find smart options – or safe/wise ones to purchase. So what is a person to do – how can the “dumb devices” in the “soon-to-be-smart-home” become smart? Easy (and inexpensive) – add an IR / RF Blaster to Home Assistant.

An IR / RF Blaster sends Infrared (IR) and Radio Frequency (RF) signals to the “dumb-devices” in the “smart-home”. In other words, it takes the remote control that came with the TV, heater, lights, etc. in the house and puts them into Home Assistant. How cool is that?

Control Infrared and Radio Frequency Devices with Home Assistant

Why Use an IR / RF Blaster

Many perfectly good devices within a home use the older non-smart technologies – Infrared (IR) and Radio Frequency (RF). One option to make these devices controllable by Home Assistant is to replace them. This means spending more money, creating e-waste in disposing of what is likely a perfectly good device, and a lot of hassle. Additionally, there’s a chance that a smart version of this device doesn’t exist on the market place yet. If it does, it’s most likely priced substantially higher.

For a marginal investment (particularly when considering the cost to replace existing devices) an IR / RF blaster can be added to Home Assistant to make those devices controllable by Home Assistant. And as new devices get added to the home they can be easily setup on the same IR blaster.

A Home Assistant Universal Remote

To be clear – an IR / RF Blaster is really just a Home Assistant universal remote. It’s like the old universal remotes you’d buy at Radio Shack back in the day to control all of your devices (is it just me that remembers those beasts?). But this is better. Why?

  • Because it’s part of Home Assistant (who doesn’t love that!)
  • An IR / RF Blaster is a universal remote for ANY IR / RF device – not just your TV
  • The IR Blaster is custom-programmed to whatever device it is needed to control

This is the universal remote to rule all universal remotes – built into Home Assistant (and your smart phone if you’ve set it up there as well)!

IR / RF Blaster Options for Home Assistant

There are a few options on the market of IR blasters for Home Assistant. The BroadLink devices are very well put together and thus the focus of this post. There are some older versions that are still available for purchase at the time of writing, however the focus will be on the current version – the RM4 series. The BroadLink seems to be as minimal-cloud-based as a modern IOT device comes. For that reason this is a wise choice to add to the network.

RM4 MiniRM4 Pro
BrandBroadLinkBroadLink
Price$21.99 RM4 Mini Only
$29.90 RM4 Mini with HTS2 Sensor
$44.90 RM4 Pro Only
$49.90 RM4 Pro with HTS2 Sensor
Purchase LinkRM4 Mini Only
RM4 Mini with HTS2 Sensor
RM4 Pro Only
RM4 Pro with HTS2 Sensor
IR (Infrared)YesYes
IR Range8 meters
IR Frequency38kHz38kHz
RF (Radio Frequency)NoYes
RF FrequencyN/A433MHz [2]
Temperature SensorOptional [1]Optional [1]
Humidity SensorOptional [1]Optional [1]
WiFiWi-Fi 802.11b/g/n 2.4GHz onlyWi-Fi 802.11b/g/n 2.4GHz only
Power SourceUSB (5V DC 1A)USB (5V DC 1A)
Dimensions1 7/8″ x 1 7/8″ x 1 3/4″3 7/16″ x 3 7/16″ x 1 1/4″
Weight3.7 ounces5.3 ounces
Mounting Plate IncludedYesYes
Supported UntilJuly 31st, 2025July 31st, 2025

[1] Temperature and humidity sensors are available via the optional sensor in the HTS2 power cord. This cord can be purchased in a bundle with the device at an often lower price than buying them separately. The HTS2 power cord is used instead of the standard USB cord. It has a rectangular sensor attached to it that detects temperature and humidity.

[2] 433Mhz fixed code only supported. 315Mhz and rolling codes not supported. This product supports 305~355Mhz and 430~440Mhz. However, in some countries such as the United States, Canada, Australia, and all EU countries the 303~335Mhz band is not available.

NOTEs:

  • A USB power brick / adapter is not included with the BroadLink RM4 devices.
  • The BroadLink RM4 devices are designed for indoor dry environment use only

BroadLink RM4 Mini

BroadLink RM4 mini shown to scale
RM4 Mini

If space is a consideration, the RM4 Mini is the device to go with. This small unit will do a great job of managing the IR devices in your home while taking up about as little space as you could expect.

This device can have the HTS2 power cable added to it to expose the temperature and humidity of the room it’s in to Home Assistant – thus allowing for some dynamic automations.

BroadLink RM4 Pro

This is quite the all-in-one package – control IR and RF devices from the same unit. With the added HTS2 cable (really cheap enough to add on it feels like a no-brainer to not…) to monitor temperature and humidity so much more can be done like trigger fans, air conditioners, blinds, heaters, etc. to be turned on or off as needed.

RM4 Pro mounted on the wall
RM4 Pro

Setup the BroadLink RM4 Pro IR Blaster Device

  1. Unpackage the IR blaster
  2. Connect the USB cord to a USB power source and plug into the IR Blaster.
    • BroadLink RM4 Pro IR Blaster status light indicates it's connected to power source

Sadly there isn’t a way to setup the BroadLink RM4 Pro without creating an account with BroadLink and setting up the device through their app. But once this step is done, the device can be managed through Home Assistant and the BroadLink app won’t be needed.

  1. Install the Broadlink app from the app store on your mobile device:
  2. Set the country in the app on your mobile device
  3. Login to your BroadLink account or create one if needed.
    • BroadLink app login screen
  4. From the apps homepage after logging in, tap the + Add device button.
    • BroadLink app home screen
  5. Tap the Add A New Device button
    • BroadLink App Add Device menu
  6. Tap the IR and RF devices button
    • BroadLink App Device Type menu
  7. Tap the Universal Remote button
    • BroadLink App Device Sub-Type menu
  8. Choose the device you wish to setup
    • BroadLink App Add Universal Remote menu
  9. At this point the app will walk through a series of steps to connect the device to the WIFI network. Follow the on screen directions.
  10. Set the name of the device and sub-devices (temperature and humidity sensors from the HST2 if added). This name will carry through to Home Assistant so wise to set it accurately here.
    • BroadLink App set name of devices menu
  11. Setup is now complete in the BroadLink app.
  12. Click on the Use Device Now button
    • BroadLink App setup complete page
  13. The IP address of this device will be needed to connect the device to Home Assistant. Click on the icon in the top right and choose Property
    • BroadLink app RM4 device page
  14. Choose Device info. The IP address can be found in the Device IP entry. Note this for the Home Assistant setup section.
    • BroadLink app RM4 device properties page

WIFI Network IP Address

When the BroadLink RM4 Pro IR Blaster or the networks router restart, it’ll likely hand out a random available IP address to this device. This will disrupt the connection of this device to Home Assistant as the BroadLink Home Assistant integration connects via an IP address.

To prevent this issue from happening, the IP address should be reserved in the networks router. Each network is going to be different on how to configure this so the specifics of this setup will not be covered here. But these screenshots are an example of how the dynamic DHCP configuration was changed to a static IP.

Home Assistant Integration to BroadLink RM4 Mini/Pro IR Blaster

The Broadlink Home Assistant integration provided by BroadLink is used to connect the RM4 Pro (among other BroadLink devices) to Home Assistant.

  1. Click on Settings
  2. Click on Devices & Services
  3. Click the + ADD INTEGRATION button
  4. Search for Broadlink
    • Add BroadLink integration in Home Assistant
  5. Click on the Broadlink integration
  6. Enter the IP address found in section Connect the BroadLink RM4 Pro to WIFI Network step 13. Click Submit.
    • Configure the host for the Home Assistant BroadLink integration
  7. If the RM4 Pro device is locked, a warning will be displayed. If not, this screen will not be displayed.
    • Home Assistant warning that the BroadLink device is locked
    • In the BroadLink mobile app, navigate to the device and change this setting. Then click the SUBMIT button in the Home Assistant integration to proceed.
    • Unlock the RM4 Pro in the Broadlink mobile app
  8. Chose a name for the BroadLink RM4 Pro in Home Assistant and click SUBMIT.
    • Set the BroadLink RM4 Pro name in the Home Assistant integration
  9. Set the area for the BroadLink RM4 Pro in Home Assistant. Then click FINISH.
    • Set the area for the RM4 Pro in Home Assistant

Now that the BroadLink RM4 Pro has been integrated into Home Assistant one device was added with 3 entities:

  • Controls
    • Remote
  • Sensors
    • Humidity
    • Temperature
BroadLink RM4 Pro integration displayed in Home Assistant
RM4 Pro integration in Home Assistant
Entities exposed to Home Assistant for BroadLink RM4 Pro via the Broadlink integration
BroadLink RM4 Pro entities integrated into Home Assistant via the Broadlink integration

Learning IR and RF Codes in Home Assistant

Now that the RM4 Pro is connected to Home Assistant, the next step is to learn the codes emitted by the IR and RF remote controls that will now be controllable by Home Assistant. This is a manual process and can be a bit tedious, but once this one-time setup is completed Home Assistant will be able to control non-smart devices moving forward. The code learning process will be done in Home Assistant.

  1. In Home Assistant, click on Developer Tools
  2. Click on the Services tab
  3. In the Service input, choose Remote: Learn Command
    • Home Assistant Developer Tools Services tab, select the service
  4. In the Targets section click on the + Choose device button and select the RM4 device.
    • Home Assistant Developer Tools Services tab, select the device
  5. Check the checkbox for the Device section. In the input box type the name of the device to learn codes for. For example: Lasko Space Heater 5132
    • Home Assistant name the device to learn IR or RF codes for
  6. Check the checkbox for the Command section. In the input box type the name of the button(s) to learn codes for.
    • If learning only one code at a time, enter the name only. Example: Power
    • If learning more than one code at a time, enter the names on their own line preceded with - . Example:
      • Specify the commands to have Home Assistant learn when programming a BroadLink IR Blaster
  7. Check the checkbox for the Command Type section. Select the respective radio button for the remote type being programmed.
    • ir for Infrared remotes
    • rf for Radio Frequency remotes
    • Specify the remote type to program to the BroadLink RM4 IR / RF Blaster
  8. Click the CALL SERVICE button to start the remote control code learning process in Home Assistant. If multiple buttons were defined in the Command section, Home Assistant will walk through that list one by one in the order the buttons were specified.
    • A message will be added to the Notifications section of Home Assistant indicating which button it is attempting to learn and provides instructions on what to do next. Additionally you’ll notice the light on the front of the RM4 IR Blaster is turns solid red. At this time, point the remote directly at the RM4 IR blaster and press the respective button.
    • Home Assistant notification prompting which button to press on the remote for the IR blaster to learn
    • Programming a remote to Home Assistant through the BroadLink RM4 Pro IR Blaster
    • No visual or audio indications will be shown after each button is programmed – other than a new notification is added to Home Assistant after each action. Go through each button until all are completed.
    • After the codes have been learned by Home Assistant, they are written to a file in JSON on the file system located in the hidden .storage/ directory in a file named broadlink_remote_<hash>_codes. Example:

This process will need to be repeated for each of the remote controls for each of the devices that need to be programmed into Home Assistant. Keep in mind this programming process is a one time task.

Testing Programmed Remote Control Codes with the IR Blaster

Now that the codes are programmed, the part we all are excited for can be done – test triggering a device from Home Assistant without the physical remote. This is a very gratifying step!

  1. In Home Assistant, click on Developer Tools
  2. Click on the Services tab
  3. In the Service input, choose Remote: Send Command
  4. In the Targets section click on the + Choose device button and select the RM4 device.
  5. Check the checkbox for the Device section. In the input box type the name of the device to learn codes for. For example: Lasko Space Heater 5132
  6. In the input box for the Command section type the name of the button to delete the code for. This should exactly match one of the codes learned in the prior section. Only delete one code at a time.
    • If calling only one code at a time, enter the name only. Example: Power
    • If calling more than one code at a time, enter the names on their own line preceded with - . Example:
  7. Click the CALL SERVICE button.
Sending codes from Home Assistant to a non-smart device through the BroadLink RM4 Pro IR Blaster

There are other useful controls that can be triggered here as well such as a repeat or delay between commands as well as holding the button down for a specified number of seconds.

Options for sending commands.  Repeats, delay, and hold for number of seconds.

Deleting IR and RF Codes in Home Assistant

If a wrong button was pressed when learning codes, that button can be deleted through the Home Assistant Services tab in the Developer Tools section.

  1. In Home Assistant, click on Developer Tools
  2. Click on the Services tab
  3. In the Service input, choose Remote: Learn Command
  4. In the Targets section click on the + Choose device button and select the RM4 device.
  5. Check the checkbox for the Device section. In the input box type the name of the device to learn codes for. For example: Lasko Space Heater 5132
  6. In the input box for the Command section type the name of the button to delete the code for. This should exactly match one of the codes learned in the prior section. Only delete one code at a time.
  7. Click the CALL SERVICE button.
Delete a learned code in Home Assistant from the BroadLink RM4 Pro

Optionally, to confirm that the code has been deleted, read the BroadLink code file located in the Home Assistant file system in the .storage/ directory, file named broadlink_remote_<hash>_codes. and notice the code is no longer present.

Using BroadLink RM4 Programmed Codes with Home Assistant

Now that the IR and RF codes have been programmed into the Home Assistant BroadLink integration, there are several ways to utilize these in Home Assistant. All that needs to be done is to call the Remote: Send Command service to trigger the BroadLink RM4 to send the proper code(s) to the RM4 IR Blaster, thus triggering the device to do the specified actions.

This can be done through Automations directly using the Call Service action. The downside here is that there are several settings to configure, and if a sequence of buttons is desired to be pressed at once, this is additional configuration. If this is only going to be used in one instance that might be passable.

But to make the IR Blaster more reusable – or to use in a Dashboard, it’s best to create an Entity that can then be reused throughout Home Assistant. This is done using the Scripts section of Home Assistant.

Create a Custom Home Assistant Entity for the RM4 IR / RF Blaster

Create a script that calls the IR Blaster commands through the Remote: Send Command action to make a reusable Entity in Home Assistant. This is required to use the RM4 IR / RF Blaster on a dashboard.

  1. In Home Assistant, click on Settings
  2. Click on Automations & Scenes
  3. Click on Scripts at the top of the page
  4. Click the + Add Script button
  5. Enter a Name for this script (example: Space Heater Power)
  6. Select an Icon for the script
  7. Home Assistant will auto-fill in an Entity ID. This can be edited as needed.
  8. Select the Mode. Determine the correct mode to choose depending on the desired actions.
  9. Under the Sequence section, click the + ADD ACTION button
  10. Choose Call service from the selection menu
  11. In the Service dropdown, pick Remote: Send Command
  12. In the Targets section click on the + Choose device button and select the RM4 device.
  13. Check the checkbox for the Device section. In the input box type the name of the device to call codes for. This must exactly match the name used when programming the codes.
  14. Check the checkbox for the Command section. In the input box type the actions to run.
    • If only one command will be run, enter the code name only. Example: Power
    • If more than one code will be called, enter the code names on their own line preceded with - . Example:
    • NOTE: The command names used here must exactly match the command names used when programming the codes.
  15. Optionally configure the Repeats, Delay Seconds, and Hold Seconds sections as needed.
  16. Click the SAVE SCRIPT button.
Example script to create a Home Assistant entity

The Entity is now created in Home Assistant. To confirm the entity was created:

  1. In Home Assistant, click on Settings
  2. Click on Devices & Services
  3. Click on Entities at the top of the page
  4. In the search box at the top, search for the Entity ID created in the above steps.

Create a Home Assistant Automation

This is not an all-inclusive tutorial on how to create an automation. This tutorial will show the two methods that can be used to call the IR / RF Blaster through an Automation in Home Assistant.

The initial steps to setup the Automation are:

  1. In Home Assistant, click on Settings
  2. Click on Automations & Scenes
  3. Click on Automations at the top of the page
  4. Click the + CREATE AUTOMATION button
  5. Click Start with an empty automation
  6. Configure the Triggers section as needed
  7. Configure the Conditions section as needed
  8. In the Actions section click the + ADD ACTION button
  9. Choose Call service

How to configure the service depends on if an entity was created using the above steps or not. If not, calling the service directly can be used as well.

Using a Custom Entity

  1. In the Service dropdown select the Entity created above.

Directly Calling the Service

  1. In the Service dropdown, pick Remote: Send Command
  2. In the Targets section click on the + Choose device button and select the RM4 device.
  3. Check the checkbox for the Device section. In the input box type the name of the device to call codes for. This must exactly match the name used when programming the codes.
  4. Check the checkbox for the Command section. In the input box type the actions to run.
    • If only one command will be run, enter the code name only. Example: Power
    • If more than one code will be called, enter the code names on their own line preceded with - . Example:
    • NOTE: The command names used here must exactly match the command names used when programming the codes.
  5. Optionally configure the Repeats, Delay Seconds, and Hold Seconds sections as needed.

Add to Dashboards

The IR / RF blaster commands can be called from a dashboard, thus making it convenient and easy to control things like TVs remote-based lighting from a dashboard.

  1. Open a dashboard in Home Assistant
  2. Click the three dots in the top right and choose Edit Dashboard
  3. Click the + ADD CARD button
  4. Choose the Button card
  5. In the Entity dropdown, select the Entity created above
  6. Click the SAVE button
  7. Click the DONE button to save the dashboard

Changing WIFI Network in Broadlink RM4 Pro

If the networks WIFI equipment is changed, it’s best to re-use the SSID (network name) and password for the new network equipment. This is a smart choice to ensure the Broadlink RM4 devices seamlessly connect to the new network equipment without any issues. However there are times/situations where this isn’t possible and thus the networks SSID or password change and you’re left without an option but to reset the network the RM4 is connected. Like many IoT devices, this isn’t as easy as saying “change the connection”.

In the Broadlink app on your mobile device is where the network connection needs to be reset. This will require deleting and re-adding the device sadly. The app does provide an export method for any settings and devices that may have been added to the IR Blaster through the app which helps to reset things quicker.

  1. Open the Broadlink app on a mobile device
  2. Select the RM4 device from the main page
    • Network connection status in Broadlink app for RM4 Pro is offline due to changed network SSID
  3. Tap the ... icon in the top right
  4. Tap the Backup option
  5. Tap the Backup now option
  6. Once the backup is complete, tap OK
    • Backup of the RM4 Pro in the Broadlink app is now complete
  7. Tap the ... icon in the top right
  8. Tap the Property option
  9. Tap the Delete device option and delete the device.
  10. On the RM4 device itself, use a paperclip or wire to press and hold the Reset button on the back of the device for 5-10 seconds until the blue light on the front rapidly blinks
    • Reset the RM4 pro via the reset button on the back of the device
  11. In the Broadlink app on the mobile device, go back to the main page and press the + icon in the top right
  12. Tap the Scan QR code option
  13. Scan the QR code on the bottom of the RM4 (under the mounting plate) and proceed through the setup steps to get the device added back into the app. This is where the network connection will be set.
    • NOTE: Once this is complete the device will be added back but without the custom settings. Thats where the backup comes in handy and will be applied next
  14. In the Broadlink App from the home screen, tap the RM4 device
  15. Tap the ... icon in the top right
  16. Tap the Restore option
  17. Tap the name of the backup from they My backup list
    • Select backup to recover in the Broadlink app for the RM4 Pro
  18. Once the backup process is complete, close the app and reopen it. The custom settings from the backup will now show.
    • Network connection status in Broadlink app for RM4 Pro is good

NOTES

  • The IR / RF Blaster makes the non-smart devices smart. Sort of. A command is sent to the device via Infrared or Radio Frequency communications. However, given the communication protocols used, the device can not communicate back to Home Assistant to report it’s state. So Home Assistant doesn’t know if a device is powered on or off, the volume level, open vs closed state, etc. Home Assistant will merely send a one way communication to the IR / RF device and trigger that action. This isn’t overly ideal, but it’s better than having no communication with the device from Home Assistant at all.
  • I personally had an issue accessing the Developer Tools -> Services tab in Home Assistant when using Chrome. A Javascript error was thrown by Home Assistant. I initially was on Home Assistant version 2022.6 and tested updating to 2022.11.5 but the issue persisted. I was however able to use Firefox to get the page to render correctly.

Resources

This post may contain affiliate links, which means I'll receive a commission if you purchase through my links, at no extra cost to you. Please read full disclosure for more information.