Control your home’s heating, cooling and more via IR with Google Home and RM3 Mini

Google Home has been available in ‘straya for a couple of months now, and it works well at controlling new “smart” wifi LED bulbs and power points. What if you want to use it to voice-control your other appliances – the ones that are not wifi-enabled and are too dumb to talk to Google?

unnamed

This walk-through will show you the step-by-step way to get any IR-controlled appliance to be voice-controlled by Google Home. All you need is a cheap IR-blaster called the RM3 Mini, plus an Android phone/tablet/TV box as a local server, and a number of free web-services.

screenshot_2017-09-11_15-25-31__10794-1505107563-220-220

In summary, you get to teach the RM3 Mini the IR codes once for each button you want to use on any IR remote, and you then make an action for that button using IFTTT on the web – you call the action with a Google Home voice command, and it’s sent through the web and the Android local bridge to the IR blaster.

Untitled

You’ll need the following hardware:

Google Home (GH) smart speaker, setup and connected to your Google account
Broadlink RM3 Mini (RM3), currently $38.50 delivered next-business-day, and USB power for it
A spare Android (‘Droid) phone/tablet/TV box with wifi that can be left on 24/7

You’ll need access to the following:

A wifi router that you have admin rights to (GH, ‘Droid and RM3 connect to the Internet via the router)
An iOs or Android device (for GH/RM3 Wifi pairing) and a tablet/notebook/PC (for copy-pasting commands)
The original remotes for the appliances you want to control.

You’ll need to setup the following free software / webservices:

An IFTTT account (responds to GH commands by sending text to RM3 via your router)
The RM3 Mini iOS or Android app (to connect the RM3 to your Wifi once only)
A dynamic DNS that gives a permanent IP address mapping to your router’s external IP
The RM Bridge Plugin on a spare ‘Droid

Lets get started!

For all these steps, I am assuming that you know your router’s wifi login SSID and password, have admin access to the router, and that all the devices (PC / Phone / tablet + GH + RM3) are going to be connected to the same router/network in your home. If you have a router with multiple wifi access points, put all these things on one AP by themselves, for better security, as they will be exposed to the web. Links in bold will open in a new tab to pages elsewhere that cover setup of individual devices.

 

Step 1 – prerequisites:

Get your Google Home connected to your Google account

Make an account at IFTTT. Connect your GH to IFTTT Google Assistant.

Setup dynamic DNS for your router. If you have a static external IP, you could skip this step.

Download and install the RM Bridge Plugin to the spare ‘Droid

Download and install the RM3 iOS or Android app on a phone or tablet (or scan QR code on it’s box).

 

Step 2 – connecting RM3 to your Wifi:

Open the e-Control RM3 app on your wifi-connected phone/tablet. You don’t need to create an account or sign in, so skip that prompt. Plug the RM3 into a USB power port and wait for it to blink rapidly blue.

Choose “add devices” from the app “+” menu, and give it your wifi password when prompted, then press “configure”. The RM3 should stop blinking when it’s successfully connected. Press “eRemote” on this screen to select the RM3 you just added.

Now update the RM3 firmware (press the cog, then settings, device info, firmware update). The app is not needed any more after this point, and can be uninstalled unless you want to pair more RM3s to your wifi.

 

Step 3 – setup the local bridge: Open the RM Bridge app on the spare ‘Droid, start the server, press the three dots to enter settings, and tick the option to make it run at boot, and specify a username/password if you want (this makes any outside sites/queries require the user/pass to manage it’s command codes). The app’ll display the IP and port number you can use to access it remotely.

Make sure the ‘Droid doesn’t turn off it’s wifi when sleeping (Android Settings-Wifi-Advanced). Test that you can get to RM Bridge by putting the webaddress:port number from RM Bridge’s opening screen in another local device’s browser – it should return a blank page with “invalid request” at the top if it’s working. FYI, the app stores all the raw codes, and lets you refer to the commands by using just a shortcut URL, as you’ll see later on.

 

Step 4 – Configure the router:  Now, go to the Wifi Clients page of your router and find the entries for the RM3 and ‘Droid running RM Bridge, it should look something like this:

You need to reserve the IP addresses of the RM3 and the ‘Droid running RM Bridge as static IPs, so that they won’t change if they get powered-off. In the screenshot below, the first line is the ‘Droid and the next two are RM3s.

Now go to the port-forward page of the router. Setup the port-forward for the RM Bridge port on your external IP to the ‘Droid’s local IP and port. This way, requests sent to your router’s external IP / dynamic DNS IP and RM Bridge’s port number will be forwarded on to the internal IP:port held by the ‘Droid.

Step 5 – Find the RM3 online and make it ready to learn codes: Open a browser, click here go to fun2code.de and do Step 1. Paste in your external IP / dynamic DNS name and port number for RM Bridge, and then fill in the section below with the RM3 name and mac address (from your router’s client list), type RM2 in the “Type” box, and press “Add manually”. Your RM3 should appear in the dropdown where you can select it in Step 2.

Step 6 – Teach the codes: Type in the name of the first IR command you want to learn, point the old remote at the top of the RM3, press “Learn Code” in the browser, then press the button on the old remote that you want to learn – the RM3’s led should turn white during the “learn code” period, and the server prints a response below if successful. Press the Test button – RM3 should respond with a white led flash, and the device should operate just as if you had used it’s remote.

In the screenshot above, I’ve named the button for turning-on a Samsung aircon, and the returned info includes that as part of the URL so you can identify this function. This website doesn’t store your details, and is used only to generate and display the codes for your RM Bridge. Copy the contents of “Shortcut URL” and leave this page for now.

Step 7 – build the webservice for the learned code: In a new tab, open IFTTT, click “My Applets”, then “New Applet”, and then click the blue “+this”. You can also get to New Applet from your username on the top-right.

Type “google” or “ass” in the box, click on “Google Assistant” (you should have configured this once beforehand, see here).

Choose “Say a simple phrase”, the left-most option.

Fill in the fields for what you want to say to your GH, and press “Create trigger”.

Now click the blue “+THAT”

Type “web”, click “Webhooks” (if you haven’t used this before, it’ll prompt you to click “Connect” first).

Then click “Make a web request”.

Paste the Shortcut URL from your fun2code.de results, as in the screenshot below:

Method is GET, and Content Type is Application/JSON. If you enabled the password option in RM Bridge, you need to modify the URL to make it in the form of http://username:password@ipaddress:port/code/xxxxx

Press “Create action”, then “Finish”, and you are done here. If you need to revisit the commands, press the cog on the top-right of your applet to edit it.

Step 9 – test it out: Give GH your command phrase and wait for the response – it can take 3-4 seconds (this delay comes from IFTTT, as the response from testing the codes at fun2code.de is instant. Again, the RM3 should blink white as it sends the command, and your device should respond.

Step 10: Repeat steps 6->9 for additional remote buttons you want to learn, making a new IFTTT recipe for each one.

Once you get the hang of this, the fastest way to do this is teach all your device IR codes in a batch at fun2code.de, then go to the “Manage Codes” page, which displays all the IR codes stored by your RM Bridge, and build all your IFTTT applets in one hit by copy/pasting from just those two pages.

Update 21/09: I’ve tried this with the Broadlink RM Pro RF and IR blaster, and it works just as well learning the codes at Fun2Code.De for an RF-controlled Arlec fan.

Simple devices like heaters and lights may use the same IR command for on/off (you can tell by comparing the text strings when you teach their codes), so you could get away with only one command recipe to switch them.

However, some aircon remote controllers send a command that is a snapshot of the current remote state (power+temperature+mode+fan speed) rather than a simple “power” command. You’ll know if yours is one of these, as testing the “On” command will not power the unit off when you trigger it a second time. For those, you will have to teach the On and Off commands separately at fun2code.de, and make separate IFTTT recipes for each On and Off press of the button.

Troubleshooting

If Google says “I don’t know what to do with that” in response to your command, give it some time to sync with IFTTT.

If the applet fails to run (click it’s cog and then the View Activity link to see it’s log), try editing and saving it again, to prompt a sync. If the log says “there was an problem with the webhooks service”, the RM Bridge is not externally accessible/responding, or you have enabled authentication and not included the username/password in your Webhooks URL.

If Fun2code.de returns “404/error” on the top-right when you are adding the RM3, it can’t get to the RM Bridge, so check RM Bridge is running, server is started, and you can get to it from another device on your network. If that’s all fine, try to get to it from a device outside your network (eg a phone browser connected to your Telco, not wifi). if that fails, there is a problem with your port-forward or your dynamic DNS (if configured).

If Fun2code.de says “failed to study code”, update the firmware in the RM3. If you have already done this, try repositioning the remote / RM3 so that there are no other IR sources interfering (nearby TV, bright sun etc). You have only a 4-5 second window to press the remote button after pressing “Learn Code”.

 

  1. #1 by Jerico on November 29, 2017 - 10:15 pm

    Nice tutorial! I get an error though whenever I create a webhooks action: Tag ‘{%’ was not properly terminated with regexp: /\%\}/ Any ideas how to fix this?

    Like

    • #2 by Michael on December 7, 2017 - 12:56 pm

      Haven’t seen that one, sorry. Make sure the text is exactly like mine, no extra code.

      Like

  2. #3 by Calvin on December 1, 2017 - 7:48 pm

    Great tutorial.
    Do you know how to make it work with the Broadlink TC2 switches?
    I cannot learn codes because these are indeed in the rm pro.

    Like

    • #4 by Michael on December 7, 2017 - 12:55 pm

      Nope, sorry – have not tried one.

      Like

  3. #5 by osprentice on December 6, 2017 - 6:43 am

    HI,

    Thank you very much for the tutorial. I’m having one issue. The shortcut URL works perfectly when I click ‘test code’ on fun2code.com, but when I create it in ifttt, it responds with applet skipped in the log. The Google home responds to the query, but the rm mini 3 does not do the action.

    Thanks for the help.

    Like

    • #6 by Michael on December 7, 2017 - 12:55 pm

      IFTTT can’t get to your Android. Test that you can get to it from outside your network.

      Like

      • #7 by osprentice on December 7, 2017 - 6:38 pm

        Thanks Michael, turns out that my ISP hyperoptic closed all ports unless I had a static IP. which they want to charge me an additional £5 a month for. ☹️

        They gave me a 7 day trial, and it now all works correctly.

        Like

      • #8 by Cunners on December 11, 2017 - 10:47 pm

        Hi, i’m having the same issue. The test code works within the network but when disconnected from the LAN it won’t run – obviously the problem with IFTTT. Can you give me a quick pointer of where I’m going wrong? I’m assuming somewhere in the dynamic DNS? My ip4 address is the same as RMLink. I’m using DYNU and just setting up Manage Dynamic DNS Service and that’s all… sorry for the dumb question – great tutorial, learning lots!

        Like

      • #9 by Michael on December 12, 2017 - 7:09 am

        Try connecting to the RMBridge via your external IP itself from outside your network – that will eliminate the DNS as an issue. If you can’t get to it, check ports are open, RM bridge is running.

        Like

  4. #10 by ratchetraindrop on December 8, 2017 - 6:16 pm

    Hi, thanks for the tutorial! I keep getting the “Error learning code: mac:xx:xx:xx:xx:xx:xx not rm2” message that I’ve seen some other users get with other models. On the code learning page I can either access the device by adding it manually or by loading devices, but as soon as I try and learn any codes I get that error. I’ve updated the firmware on the device to v20028 which is the latest at this time. Any advice?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: