BroadLink RM mini 3 WiFi Universal Remote

Status of Wi-Fi indicator:

  • Quick blink: The device is in configuration mode (SmartConfig) and waiting for setup. This mode is enabled after the device is powered on for first time or you long press the reset button
  • Blink every sec.: The device configuration is failed. This is usually caused by incorrect input of password. Please reset the device and try again
  • Slow blink for 4 times and stop for 1 sec. and repeats the cycle: The device is in AP configuration mode. This mode is enabled after you long press the reset button when the device is already in configuration mode
  • Off: The device is configured successfully. You can view the device shortcut icon in the main control page or tap the “+” icon on top right corner and then choose “Device list” to view the device

How to use AP configuration:

  • Make sure Wi-Fi (WLAN) is enabled on your smartphone and your device is in AP configuration mode (refer to FAQ 1-3);
  • Open the app, tap the “+” icon on top right corner and then choose “Add device”;
  • In the configuration page, tap “AP mode” on top right corner and tap “OK” after you read the prompt. The app will lead you to the Wi-Fi selection page;
  • Connect to the network “BroadlinkProv” and tap to return. The app will show a Wi-Fi list. Please designate the same Wi-Fi network you used before AP configuration and input the password;
  • After configuration, the app will automatically connect to your previous Wi-Fi network and you will see the device in the list.

Scripts:

sudo apt-get install python2.7 -y
sudo apt-get install python-pip -y
sudo apt-get install python-dev libgmp-dev
 
# Python module for controlling BroadLink RM mini 3 remote controls
git clone https://github.com/mjg59/python-broadlink.git
# Install
sudo python setup.py install
# File: locate.py
# Script to locate RM mini 3
# python locate.py
#!/usr/bin/python
 
import broadlink
import time
 
print "************************************************"
print "Using python library created by Matthew Garrett"
print "https://github.com/mjg59/python-broadlink"
print "************************************************"
print "Scanning network for Broadlink devices...."
 
mydevices = broadlink.discover(timeout=5)
print "Found " + str(len(mydevices )) + " broadlink devices"
time.sleep(1)
print "..............."
 
for index, item in enumerate(mydevices):
 
  mydevices[index].auth()
 
  ipadd = mydevices[index].host
  ipadd = str(ipadd)
  print "Device " + str(index + 1) +" Host address = " + ipadd[1:19]
  macadd = ''.join(format(x, '02x') for x in mydevices[index].mac[::-1])
  macadd = str(macadd)
 
  mymacadd = macadd[:2] + " " + macadd[2:4] + " " + macadd[4:6] + " " + macadd[6:8] + " " + macadd[8:10] + " " + macadd[10:12]
  print "Device " + str(index + 1) +" MAC address = " + mymacadd
  print "..............."
# File: learn.py
# Script to put RM mini 3 into learning mode
# Python learn.py
# This script will connect and ask the name of the key you want to learn (tv_on)
# This script will then ask you to press the key for 5 seconds
# Once the code has been learned the led turns off and the script confirms that the code has been registered under the name tv_on.txt.
#!/usr/bin/python
 
import broadlink
import time
import sys
 
device = broadlink.rm(host=("192.168.0.1",80), mac=bytearray.fromhex("AA:BB:CC:DD:EE:FF"))
 
print "Connecting to Broadlink device...."
device.auth()
time.sleep(1)
print "Connected...."
 
codeName = raw_input("Please Enter Code Name  e.g. tvOff ")
time.sleep(1)
print "When Broadlink white led is lit press the button on your remote within 5 seconds"
 
device.host
device.enter_learning()
time.sleep(5)
ir_packet = device.check_data()
#convert code to hex
myhex = str(ir_packet).encode('hex'); 
 
if ir_packet == None:
   print "No button press read - quitting"
   sys.exit()
else:
 
# record learned hex code to file
   f = open(codeName +".txt",'w')
f.write(myhex)
f.close()
 
print "Hex code written to file named " + codeName + ".txt"
# send.py
# Script to send a command (tv_on) to the RM mini 3
# python send.py tv_on.txt
#!/usr/bin/python
 
import broadlink
import time
import sys
 
try:
    fileName = sys.argv[1]
except IndexError:
    fileName = 'null'
 
if fileName == 'null':
   print "Error - no file name parameter suffixed"
   sys.exit()
else:
 
   device = broadlink.rm(host=("192.168.0.1",80), mac=bytearray.fromhex("AA:BB:CC:DD:EE:FF"))
 
device.auth()
device.host
 
file = open(fileName, 'r')
 
myhex = file.read()
 
device.send_data(myhex.decode('hex'))