In this video I'm going to show you how to use a Broadlink RM Pro in Home
Assistant. Make sure you stick around, and if you like what you see, hit subscribe
below so you don't miss out on future videos!
Hi I'm Will from Will Surridge Tech, and today we're going to be using a Broadlink
RM Pro to control both IR and RF devices straight from Home Assistant. Do
let's get going! The Broadlink RM Pro is a great way to interface with cheaper
smart tech using RF commands rather than going over Wi-Fi. You can also interface
with your entertainment system using IR to replace your TV remote. Now that Paul
Hibbert has dived into the world of Home Assistant I thought this might help him
out a little bit setting it up. This process definitely isn't as easy as
setting up other integrations in Home assistant because you're going to have
to learn each command individually, if you've already setup your Broadlink and
you're using the e-control app, there is a way to extract that information to save
you a bit of time, but that does involve needing Android or Windows to do it and
I don't have either of those, so I'm going to show you today how to set
everything up from scratch. The first thing you need to do is set up your
Broadlink device in the e-control app. This is so you can connect your device
to the Wi-Fi. If you're using one of the newer devices you need to make sure
you're not connecting it to the cloud - just connect to the Wi-Fi and leave it
there. Once it's connected, you can use the app to access the MAC address of your
device you'll then need to go into your rooter settings and give it a static IP
address so Home Assistant can interface with it. Once that's done, we can move
over to Home Assistant. What we're going to need to do is add the Broadlink to
our main configuration file. We're going to add it as a remote under the platform
Broadlink. We need to add the host IP address, the MAC address, and then we can
give it a name if we want to. Once that's done we save, we check our config, and we
restart Home Assistant. If all's gone to plan so far, under the developers tab we
can see that our new remote has been listed. Now we can move on to learning
the commands. This process is quite tedious because you've got to learn each
command individually, but it's worth it in the end. We can head over to the
services tab, and use the service remote.learn_command. In here we need to add our
entity ID, the device name, and the command name - so I'm going to use the
testivision as my device name and then I'm going to add the command which is
the button I'm going to press on these remotes. Once you've entered the
information, press call service and then you can point your remote at the RM Pro
and it will learn the command. Once you press call service you will get a
notification telling you to point the remote at their RM Pro and press the
command, and then once it's learnt the command then the notification will
disappear. You can then move on to the next one - we just need to rename the
command and then press call service again. And we rinse a repeat for all the
commands we want to learn on our remote. Now that we've learnt all the commands
we need to find them so we can do something with them in Home Assistant.
You'll find them if you go over to your file editor in the .storage folder, in
this folder you should see a file called broadlink_remote, it'll then
have the MAC address of your Broadlink device listed afterwards, so if you have
multiple Broadlink devices all the commands will be separated per which one
you learn the device from. Inside here you'll see a list of all the commands
that you've learned. We can now open a new window, go back to our file editor
and add some switches. As usual, mine are referenced in a separate file so we'll
open that up now. We're going to add new switches on the platform Broadlink,
using the host IP address, and MAC address, and then we write switches. Each
switch has a name, a friendly name, and a command on. If your switch also has a
command off, which is separate to your command on, then you can list it
separately here. For example if your power plug has an on and an off switch
separately, or your TV has an on and off switch separately. The command on is
actually the code that was listed in the other document, so we want to copy it
from the other document into here. We want to make sure we're including the
quote marks, but excluding any commas that might exist between lines. We rinse
and repeat for all the switches that we need to make. Once you've done all that,
you should have a long document with all the switches that you've learned. If
you're happy, click Save, check your config, and restart Home Assistant. We can
then head over to the developers tab and we can see that all our new switches
are listed. If we click on them we can trigger it
and it should emit the IR pulse from our Broadlink and control whichever
device is meant to! Now we can move on to the RF. Again this is quite complicated,
but when you get into it it's not too bad. We're going to need the e-control
app to make this work, but before we do that we're going to set up our call
service. This is the same command as before - so if we head over to our call
service tab, the service is remote.learn_command, then our entity is
our RM pro. We add our device, and our command name. I'm using some RF plugs for
this, so my commands are going to be on and off. But make sure you don't press call
service yet, we're just setting it up for now. Now we can head over to our e-control
app. We're going to add a new remote, select our Broadlink RM Pro, and then
choose an RF socket. In here you can see a list of buttons that we're going to
program in a minute. The first one we're going to use is plug 1 (or socket 1), and
the on one. So we click on that and then it asks us to sweep frequency. We click
sweep frequency, and then we hold down the button on our remote. Once it's swept
the frequency, it'll tell you that it's swept, and then you need to click OK, but
don't press the button on the remote again yet. Before you press the button
the remote, we're going to press call service back in Home Assistant. Once you
press call service, you should get a little notification telling you to press
the button on the remote, this is now when you can press it. Once the
remote has been recognised by the Broadlink, you should get a notification on
your e-control app saying saved successfully, and the notification in
Home Assistant should disappear. Once that's happened, we can move on to the
next button. We can just repeat the process for all our other buttons, making
sure you change the device and command in your call service, otherwise you'll
overwrite previous codes. It's very simple - we click on the new button in the
app, press sweep frequency, hold the button down on our remote, it should
sweep all the frequencies. Once the frequencies are swept in the app, then
you click done, and before you hold down the button again
you go back over to Home Assistant. Press call service, the notification should
appear in Home Assistant, and then you can press the button on your remote. This
should be recognised in Home Assistant and the app. In the app it will say saved
successfully, and in Home Assistant the notification will disappear. Once you've
done this for all your buttons, we're going to need to open up our file editor
again. Again use two windows - in the first window we're going to open up our
Broadlink codes. So they're in the .storage folder, and then the file is
named broadlink_remote and then it's got the MAC address _codes, if you open
this up you should see your new RF codes have appeared. In your other file editor
window, you're going to open up your switches - either in a separate switches
file or in your main configuration file. In our switches file, we add new
switches as we did last time - giving them a name, a friendly name, a command on
and the command off (if relevant). And then we go back to our code file and we copy
the codes from our new devices and then we can paste them in our switches file.
Remember to include the speech marks but not any commas. Once that's done, and
we're happy we've done all of our codes, we can save, check our config, and restart
Home Assistant. Once Home Assistant has fully restarted, we can see our new
integrations. If we head over to the state in the developers tab then we can
search for our switches. As you can see mine are all listed here. If you click on
them let them load a little bit, and then you can power them on and off using the
two separate commands. If that all works then we're fully integrated! So there we
go, we can control both IR and RF devices from inside Home Assistant! Make sure you
hit subscribe, and click the bell icon below, so you don't miss out on future
videos about my smart tech, and how you can build yourself the ultimate smart home!