One of my favorite aspects of Home Assistant is its seamless integration and compatibility with a diverse collection of technologies. The open source project has grown significantly over the past few years and has 1.3k at the time of writing this article. A few examples of the different technologies it works with are:
- MQTT to connect a massive ecosystem of cheap DIY and professional devices and sensors without the need for proprietary hubs (e.g., Phillips Hues, IKEA’s Tradfri, Xiaomi)
- RTSP for streaming live camera feeds
- Connectivity & data exchange standards including Zigbee, Z-Wave, Wi-Fi, and Bluetooth
- Webhooks and APIs for integration with hundreds of unique services ranging from DarkSky localized weather to iRobot’s Roomba vacuum
- Local and cloud-enabled image processing and text to speech
Control devices using IR/RF using Broadlink and Home Assistant
It’s not unrealistic to imagine that if you can think of it and are willing to put in some time to figure out how to make it work, Home Assistant either already does or can support it. Beyond the 1.3k official components, there are hundreds of custom components the Home Assistant community offers ranging from UI tweaks to device-specific hacks.
I’ve been tinkering with Home Assistant for a couple of years now, and recently began exploring infrared and radio frequency (IR/RF) control.
The most common IR/RF device in the Home Assistant ecosystem is manufactured by Broadlink and comes in a few models including the RM Mini 3 and RM Pro. This post involves my experience with the RM Mini 3.
Broadlink’s RM Mini 3 is an inexpensive, Alexa looking device that sends and receives IR/RF packets to control devices locally via Home Assistant. This enables you to use one or more IR blasters to replace TV remotes, control lights, or control any device that can receive IR/RF commands. Broadlink is supported natively in Home Assistant, so configuration only takes a few moments. Find the device’s MAC and IP addresses and then add it to your Home Assistant config.
An example might look like the one below:
In my case, I have a couple of these and have broken them down in their own .yaml files within a Switch directory. This makes it simple to manage, especially as the number of devices, switches, and sensors balloons. Check out my GitHub’s Home Assistant repositiory for a real-world example of this.
Back to set-up… there are at least two ways to find the MAC and IP addresses :
- Use the Broadlink ‘e-control’ app which looks like it was designed by a pack of drunken llamas
- Use your router or Wi-Fi app (e.g., Google Wi-Fi) to get the details
Learning IR/RF packets
Once you’ve added your IR blaster, restart Home Assistant and go to the Services page under the Developer tools section in the front end.
You should now see a broadlink.learn service. If you don’t, check logs to see what went wrong.
This is where things get interesting.
Enter the device you’re using in the service data field and call the service.
For the next 20 seconds or so, you can point a remote or whatever native device you usually use to send commands from at the IR blaster.
If you have issues with Home Assistant failing to connect to the device, make sure it’s getting enough power. In my experience, the devices frequently dropped when powered via a USB port on my Intel NUC. Ever since I switched them over to a 5v power supply, they’ve been rock solid with no noticeable latency.
Packets are displayed within a persistent notification which is comprised of a long string. See the image below for an example of one if this doesn’t make sense. This is the command packet captured from the remote.
You can now add this command as a switch following the instructions listed here.
Whenever Home Assistant restarts, you should now see the newly added switch which you can now use to send the command directly from Home Assistant or use in a Node-RED or native automation! Each blaster has a range of ~40 ft and won’t go through walls or other obstructions.
It’s worth noting that like a lot of the inexpensive components produced by Chinese companies like Broadlink and Xiaomi, you’ll probably want to disable the device from communicating outside your network. How you do this will vary based on your setup, but know that if you don’t, these devices frequently ping their servers back in China. Additionally, there are known vulnerabilities and other risks such as out of date firmware associated with leaving the device exposed. Better yet, set up an IoT VLAN with the right rules to lock it down.
I have two IR blasters in my setup and have experimented with using them to:
- Control a Roomba by automating cleanings based on time and presence (e.g., if it’s 1 pm and no ones home, vacuum the house).
- Control a dumb TV (change the volume/power/input)
- Turn on/off under cabinet LED lights.
- Turn on/off LED candles (looks cooler than it sounds)
For entities like the TV and candles, it’s useful to be able to control the device directly from Home Assistant’s front-end while other, more routine functions like vacuuming at regular intervals belong in Node-RED or Home Assistant’s built-in automation capability.