So, yesterday i received my order from Ali containing the Broadlink RM3 mini ir blaster.
First i had a nodemcu with an infrared light to control my IR devices, but for the price of €10 i might as well try this little piece of hardware.
And from the first looks, it’s a pretty great device.
So, ive found a python app to control it from commands line, in conjunction with Shellexecute plugin, we can integrate it with Pimatic.
Im going to assume you have Python PIP installed, if not, install it.
We will install the python dev kit first:
sudo apt-get install python-dev
Now, we will create a folder to work in:
mkdir /home/pi/pimatic-app/BlackbeanControl && cd /home/pi/pimatic-app/BlackbeanControl
Following are the packages needed to run this tool, and this is where PIP comes in place to install the packages.
sudo python -m pip install configparser sudo python -m pip install netaddr sudo python -m pip install pycrypto
After that is complete, we need the python-broadlink package so execute
sudo git clone https://github.com/mjg59/python-broadlink.git
Now we have to install this package:
sudo python setup.py install
Lets go back one directory:
Now we can get our controlling software:
sudo git clone https://github.com/davorf/BlackBeanControl.git
Ok, now that we have our packages and software, we can go on to configuring the device.
For this, we need to initiate the Blackbean first. For this we need the android/ios app “Broadlink e-Control”
On launch you can connect it to your wifi point and if that is okay, you can go on with this how to.
Now, we want to add the device to our config:
sudo nano BlackBeanControl.ini
Enter the RM3 mini ip address, port is 80, then the MAC of the RM3 mini and as timeout set 30.
[General] IPAddress = 192.168.xxx.xxx Port = 80 MACAddress = AA:BB:CC:DD:EE:FF Timeout = 30 [Commands]
Save the file:
CTRL+X - Y - ENTER
Now, we are going to learn a command.
sudo python BlackBeanControl.py -c YOURBUTTONNAME
If your config is right, after a couple of seconds it should go into learning mode (white led), press your button now.
If you get a time out error, this would mean your IP/Mac/Port is wrong.
When you learn a code, it will parse it to it’s config, so [Commands] will get populated by your IR code’s.
Please note, it will only go in learning mode if
-c YOURBUTTONNAMEis not known. If it is a known name, it will run the IR code.
And then ofc, integrating it is easy:
WHEN button is pressed THEN execute "sudo python /home/pi/pimatic-app/BlackbeanControl/BlackBeanControl.py -c YOUTBUTTONNAME"
After receiving my second RM3 mini i wanted to let you know that adding it is easy.
In the BlackBeanControl.ini add;
[SecondRM3] IPAddress = 192.168.x.x Port = 80 MACAddress = yo:ur:ma:ca:dd:re:ss Timeout = 10
Now, your commands will always be send to the [General] device unless you state otherwise by adding the -d syntax to the command:
sudo python BlackBeanControl.py -c YOURCOMMAND -d SecondRM3