📜 ⬆️ ⬇️

Tasker tutorials. Part 1: Add Your Team to Google Now

The first article from the cycle, aimed at transforming an ordinary smartphone into a real advanced gadget for a true geek.
The purpose of this series of articles is to teach how to automate as much as possible actions related to a smartphone and to show interesting applications for a smartphone.
Tasker is a powerful tool for automating the actions of the phone and its interaction with the outside world.
You can perform various actions as a response to applications (start / stop), time, date, change of location, indicators of the phone sensors or events (including various plug-ins).
The first part of the cycle will consider the possibility of adding your commands to Google Now and performing various actions after recognizing the command, which can bring home automation to a new level.

Google now


At the moment, Google Now supports a limited list of voice commands, which can be found on the official support page . In one of the previous updates included support for the recognition of the phrase "OK, Google" in Russian.


')
Then they added phrase recognition on any screen (it used to be only on the desktop and on Google Now cards), although officially it only works in English. On Habré there was already an article with available commands and there are a lot of videos with examples on YouTube.
With the help of voice, you can dial SMS, call, create notes and set a timer / alarm clock, etc ... But what if this is not enough and you want to add your commands? For example, "Turn off Wi-Fi" still does not work even in English. Just sends in settings.
If you are interested in how to add almost any voice command for Google Now without root rights (I’ll make a reservation right away, only on supported devices), I ask for cat. This will add almost limitless home automation capabilities and just help make life easier and free up time.

So, the function of active listening to commands on the desktop is available for android since version 4.2. On lower versions, you must click on the microphone icon forcibly.
If you say "Ok, google. Turn off Wi-Fi ”, then we will first be shown a card and after a couple of seconds a window will open with Wi-Fi settings, where you have to press a button to turn it off.



Further, using the example of the same command, I will show how to make the wifi turn itself off. By analogy, you can customize the execution of any commands that can only come to mind ... well, almost.

Autovoice

The main program, with the help of which we will respond to voice commands and manage the surrounding objects, devices, other gadgets and just perform actions on the smartphone itself. Will be found in almost all subsequent parts.

First we need to install two great programs: Tasker and AutoVoice . The programs are paid, but not expensive and I urge to support the developers.
Then in AutoVoice you need to enable integration with Google Now, or go into the settings - special features and activate it there.



Next, go to the tasker. Create a new profile. We press +, for a condition we select event / event, a plug-in / plugin, further we select AutoVoice Recognized.



Click the pencil in the upper right corner, click Speak Filter and dictate the phrase to which we want to respond. For example, "turn off the wifi." The choice of recognition will give 5 options, click on the more correct. Press the back button and should see this picture:



Push back again. For the action itself / Task, select Network / Net - WiFi - and look for the top to stand Off / Off. Push 2 times back and see such a picture (4th profile above).



We exit the taskbar with the back button (it is recommended to always do this so that the updated profiles will work) and try.
It should turn out like this: (watch the icon for wifi, there is no sound on the video).



That's basically it. By analogy, you can configure for each phrase any action or sequence of actions.
AutoVoice supports the recognition of regex, that is, you can dictate long phrases, some of the words from which can be variables, but about this some other time, if the topic is of interest.

Finally, the video from the creator of many interesting plug-ins to Tasker - Joao Dias:



UPD1:
A small addition to rooted phones.
If you put the xposed framework and mod Ok Google for 3rd party activities, then you can configure the triggering of a key phrase from any application now (in fact, about 2 months ago, before Google rolled out the update for the English-speaking).
UPD2:
Who does not provide integration with Google Now: if there is a root, then you can intercept commands through the module to the xposed framework - Google Search / Now API , which supports the AutoVoice plugin. For work, you must put it first, because if AutoVoice is already installed, then delete and reinstall. And so to do after each update module.

Source: https://habr.com/ru/post/230331/


All Articles