
Ok TV - teach Google Now how to control a zombie
- Tutorial
“Ok Google, turn on the news!” It would be convenient to quickly launch a voice on any channel on a regular TV. Or control the air conditioner without having a remote control at hand.
In this article I will show how you can implement voice control of any TV without programming or using a soldering iron using the very cheap Broadlink RM controller and a couple of Android applications.
Watch a video demonstration of the result , and then read how to do it yourself.
What do we have?
- Ordinary
zombietv - Remote from him
- Android smartphone
- Broadlink RM Controller
What kind of beast is Broadlink RM?

This is such a cheap smart home controller that you can buy for just 3 thousand rubles. He can control any
In addition, he can control equipment at radio frequencies of 315 and 433 MHz - such as all kinds of switches, dimmers, and so on. In principle, all of his characteristics and skills are well written here .
This thing works like an IR blaster (not to be confused with a blaster from Star Wars and all the Terminators there). That is, the command from any smartphone, tablet or computer is transmitted to her by ordinary wi-fi, and she already "fills" the required IR signal in all directions.
What do we want in the end?
We want to make Google Now become a little (well, at least a tiny little) smarter and learn to understand voice commands such as "Turn on the Sport channel", "Make the TV quieter", well, in general, I learned to press all other buttons. So you no longer have to look for different remotes and you can control all the equipment even from a smart watch on Android Wear .
Let's get started
After the initial setup of Broadlink RM using a standard Android application, we need to teach it IR codes on our TV remote control. So that later, when we send commands to this program, she knows what signal should be sent to the controller.

To do this, install the Broadlink Control application ( source codes are open and are located here ). It is very simple and allows you to teach Broadlink our buttons, as well as add button combinations as functions. Because for some TV channels you need to press more than one button. For example, channel 11.
All buttons and functions are named, functions can be poked in the list to test their work, and also to start them by voice directly from the program.
When we add a new button to the program base, the controller enters the learning mode for the new IR code. The light starts flashing, we bring the control panel and press the desired button. The program will prompt you to name the button somehow and save it in the list.
This must be done for all the buttons on the remote, which are necessary!
Learn Google Now
Google Now is a great thing for voice control. But he can’t click the buttons on the TV ... Now we’ll fix this flaw of Google engineers!
As you know, Google Now has no open API for "embedding" its functions. But there is a Russian-speaking voice assistant Dusya who can "pull out" the text of the request from Google Now and process it if it suits one of the functions. In addition, Dusya allows you to create your own functions without any programming right in your interface.
These "their" functions are called scripts, and they allow you to turn a user's phrase into a sequence of actions that you need to crank on your smartphone. How? Using phrase templates, the syntax of which is pretty simple:
* (включи*|переключи*) [на] [канал*] $Text *
Phrases like “Hey Switch to News” are suitable for such a template. Or “Turn on the Sport channel.” In this case, the name of the channel to be launched will be placed in the $ Text variable. Everything is simple!
In response to such a command, you can add sending of intent - that is, send a signal on a local smartphone to another program. This program will be Broadlink Control, which receives a line of text, searches for a previously configured channel on it, and sends Broadlink buttons signals.
That's basically it!
Well, not all of course ...
We will create such a script in Dus, add the above template to it, and in the actions add the sending of Broadcast type action with action com.broadlink.control.action.QUERY and in the parameters we pass our $ Text variable in the text parameter. As in the screenshots:


What else can be done?
Of course, the purpose of my article is not to review the capabilities of Dusi scripts, but they really can do a lot of things. Therefore, I recommend that you contact the official website of the project for help .
And of course, you must remember to enable integration with Google Now in the “Background mode” setting, so that Dusya can “intercept” his command and launch the necessary buttons on Broadlink Control.
Now, when you start Google Now with the magic phrase “Ok Google”, we can command our cherished “Turn on the First Channel”, after which Dusya will react to this phrase, close Google Now, extract the channel name from the phrase and send it to the Broadlink Control program. That, in turn, will find by name the list of buttons that need to be pressed, and send them in the correct sequence to the Broadlink RM controller. Well, that one will turn the code into an IR signal and pull it in all directions so that it will definitely reach the IR receiver of even the oldest
And now for sure!
Here is an example of how to teach any technique to control your voice without any programming and soldering iron in a very short time and very little money (for a boxed solution of the "smart home" class). Let me remind you that Google Now can also be launched on the smartphone’s screen off (for example, it only works on my charger), as well as on the Android Wear smartwatch.
This will make a lasting impression on the guests, and indeed it’s nice ...
OK Google, I do not watch TV!