This is a pretty stupid DH as far as DH’s go but gets the job done, not proud of it; but hey. And there is something to be said about getting something working in under an hour. Figured someone may find it useful so sharing. Don’t beat me up on code quality etc. Would have liked a prettier screen and more feedback on buttons, but it would take more work. This doesn’t have to be strictly a TV remote and can be used as a multi-media remote, with buttons programmed for different devices.
I have RM Pro 2 and Mini 3 works with both -
Pre-Requisite
- A Broadlink RM device Pro or Mini
- RM Bridge - http://rm-bridge.fun2code.de/
Broadlink RM devices are cheap, if you have one you already know that the only way to talk to them is either via HA-Bridge or Android. There are 2 different mechanisms for Android - RM Lite plugin for tasker, costs $4.99, and RM Bridge (linked above). There are other DHs that use both or even support HA-Bridge. I chose RM Bridge because I find HA-Bridge quite heavy and hard to install, I have an instance running on my Pi but too much to figure out. Although I have a subscription to RM Lite plugin, and use it for Alexa integration, but I have read that it leaks info outside the network. Don’t know the details on what it leaks. I decided to keep it simple and go with RM Bridge
Features
- This is based on the TV template that is included in the IDE
- Clicking on the main button in the Things list allows you turn On/Off all devices with one click (3 devices are supported, TV, Sound & STB)
- Allows you to associate a single command with each button.
- Level command is supported and tied to Volume commands so external devices can set volue - tested with Alexa, may work with Google Home
- Multiple commands are not supported
- Authentication is not supported - although RM Bridge has basic authentication I don’t support it, its in my home lan so dont see a point for me especially for a TV remote.
A note on Volume level control
The volume up and down works as expected - they will fire a Volume up or down command when pressed.
Volume controls also work with Alexa - and will respond as expected to commands like:
Alexa set or make TV higher
Alexa turn up TV
Alexa set or make TV lower
Alexa turn down TV
However, is a just since we fire and are not really connected to the real device, Discrete volume level controls like sliders work a little funny. For example Alexa app has a level UI and as you change level it will only lower or raise the volume only once or twice. And behaviour will be dependent on slider implementation if you connect this to another smartapp or external control.
What Volume does is that every time it receives a level higher or equal to current level it sends to Volume Up button twice otherwise it sends Volume Down button. So in case of Alexa even after internally reaching 100% the volume control still responds to ‘make higher’ command and keeps firing Volume Up button code, it does the same thing at 0% for ‘make lower’ and keeps firing the Volume Down command,
RM Bridge Installation
Download and install RM Bridge on an android device and run it. It will show the device IP address and port.
Links to Google Play store or apk are all here: http://rm-bridge.fun2code.de/ . I would assign a static IP to the android device by setting it in your DHCP server. You will need this baby to stick one address.
Please note you don’t need the Broadlink e-remote software after initial installation and adding your remote control device on the network. That software is nothing to write home about, and I wouldn’t trust it on my primary phone. I installed it on a burner and use it to only to initialize new devices, resetting etc. I have accepted NSA snooping as a fact of life, but letting PLA in my house is a bit much (though who knows what RM Bridge is doing)
Setting up remote codes
- Run the RM Bridge web app
You can either go click on ‘Manage Code’ link on the RM Bridge’s web site (direct link RM Bridge - Management Console) and manage the codes from there
or
Download the zip file from clicking on ‘Manage Codes Offline Version’ - If you use the offline version it will download a zip file unzip it and open index.html.
Please note: This app did not work for me remotely on Chrome for mac, worked on Safari and Firefox fine
It should look like this :
Click on ‘Create new codes’ - it should go the learning page
-
Enter the IP address and port in Step 1 section for the Android device and hit Load Device.
It usually takes a few retries for this to work the first time around. You may have to hit load devices several times.
If it doesn’t find the device enter it Manually - just use RM for as the device type.
Please note: Mini 3 is not recognized by the javascript on this page. You can either enter the mac address manually - or get the download version of the app and find the section in learn.js where devices are listed and just add “RMMini” to the list -
Then select the Device from the devices drop-down in Step 2 section
-
Now comes the important part enter the code name in Step 3 section this is code name is important this is what you will use in the ST Device configuration later. For example: I have chosen to call this button TV and will use to turn the TV on and off
-
Click on learn code - and point the remote towards the Broadlink device and press the key for your device - you may want to test the code before moving on
-
Do the previous 2 step for all the keys you want to teach the remote.
Please note: don’t put spaces or other special characters in the names, like I said its a dumb app, and these names are only read by machines, so no need to make them pretty
SmartThings Device Handler
Install the Device handler and a create a new device for your TV in the usual way here is the code for the DH
App Settings
- Now start the SmartThings app, open the detail page for your device and click on the gear icon
- Enter the IP address and the port as shown in the RM Bridge Android app
- Enter ‘Code name’ from the the RM Bridge pro that you created earlier when you captured the remote code in this example tv. Please note that the code name must match *exactly* what you put in the RM Bridge code learning page. This is case sensitive. If you forgot what you put in you can go to the ‘Manage Codes’ area in the RM Bridge web app and get a list.
Do this for every button you want to map - button names are fairly self-evident.
That’s all folks - hopefully someone else will find it useful. Otherwise documentation for myself