yashsingh1/xdaforums huggingface dataset:
[Moto X Themes and Apps] theycallmetony:
Recent Touchless Control Update Breaks Module

The recently pushed Touchless Control update (4.3.10.1) seems to break the OkGoogleNowTriggerIntent module (both 1.0 and 1.1).

After speaking "Ok Google Now," I get the initial launch phrase sound 'ping' from Touchless Control. After several seconds, my Tasker profiles do not activate and I get the second 'ping' that denotes the ending of voice recognition.

After uninstalling Touchless Control updates (back to 4.2.01.1) everything works fine.

xt1056, 4.4.2, rooted, BL-unlocked
[Moto X Themes and Apps] asdf1nit:
I got the touchless controls update last night some time and it broke the broadcast intent for me as well. I've uninstalled the update and it did no good. I didn't want to wipe cache but i might do that later. I have this on a phone for my blind aunt so she can get more verbal feedback than what motorola gives, in the mean time ill find another way around, she cant see so voice feedback is the only way(talkback sucks!). I'm still on 4.4, rooted, unlocked, tasker, autovoice, xposed google search api module,

thanks for this great mod! hope we see a fix soon.
[Moto X Themes and Apps] hawkjm73:
Yeah, I saw that today. Should have it fixed soon. Just FYI, this is pretty much gonna happen every update due to the way they obfuscate code. The class names change each release. I am trying to find away around it in addition to getting it redone this time.
[Moto X Themes and Apps] hawkjm73:
New version up in the repository. Updated class names are in, as well as settings to turn it on and off.

JB folks, I haven't forgotten you. I'm still working on it.
[Moto X Themes and Apps] Thradya:
Thanks a lot!
[Moto X Themes and Apps] cocchiararo:
Any chance you can open up an option to enable/disable it with tasker? (Plugin or intent)

Tapatalk - Moto X XT1058
[Moto X Themes and Apps] hawkjm73:
I did. :) The repository has intent instructions for controlling it with tasker.

Basically, you send a Service intent to package "com.hawkjm.okgooglenowtriggerintent" and class "com.hawkjm.okgooglenowtriggerintent.SettingsIntentService".

Give it an action that looks like SETTING:ENABLE_INTENT.

You can enable and disable INTENT, which simple controls if it broadcasts the intent on trigger, OVERRIDE, which controls if the TC activities are stopped, and BOTH, which does both at the same time.
[Moto X Themes and Apps] cocchiararo:
with both at the same time, we can use "what's up" (from the latest update) and this feature ? (dunno if with that you block the google now search or not?)
[Moto X Themes and Apps] hawkjm73:
Enabling both overrides TC entirely, and sends the intent to tasker. If you only enable the intent, TC behaves normally and tasker still gets the intent. If you do that, TC will have control of the mic until it times out or you cancel it. After that, though, AutoVoice can listen to you.

Mostly, your going to want to use enable or disable both. I just included the separate ones in case someone has a use-case I haven't thought of.

Basically, there isn't a way to have the best of both worlds yet. TC only listens for its own very specific commands, and dumps the AUDIO to GN if it doesn't understand. If it would do its own general speech recognition, life would be a lot nicer.

You can, of course, just have tasker read your notifications...
[Moto X Themes and Apps] vashollow:
help!

i already installed this. can anyone tell me how to activate it? :confused:
[Moto X Themes and Apps] cocchiararo:
What am i doing wrong?

Unless the UI "ticks" don't have to change when i do that?

Changing "INTENT" for "OVERRIDE" and "BOTH" is for the other options?
[Moto X Themes and Apps] hawkjm73:
The SETTING: ENABLE_INTENT goes in an Extra field. The Action field stays blank. You should see the ui refresh when it works.
[Moto X Themes and Apps] hawkjm73:
If you mean you were previously using it, just install the new version and reboot.

If you mean you've only just installed, enable the module in the xposed installer, and reboot.
[Moto X Themes and Apps] cocchiararo:
works now XD

No chance in hell you know of a hidden intent for disabling motorola voice controls altogether, right? :P (and then enable them back, of course)
[Moto X Themes and Apps] hawkjm73:
Not sure what you mean. Care to elaborate?
[Moto X Themes and Apps] cocchiararo:
The feature.

Right now, if i want to enable or disable it, i have to manually go to phone settings, touch controls, tick to enable it.

Right now i have heavy issues with the feature when i am on the bus or the metro... my home is near a highway, and my job has elevators and air conditioners always on.

I have still to find a place where i can train it with NO noise, and with that noise, the phone thinks i am talking to it while i travel... and that makes the music stop comming out from my bt headset, and to rock the speaker, and people don't like that...

In any case, want to disable it while i am traveling to/from work, and enable it in other times, and also combine that with when i want your features on, overriding, or off.

Since you had been hacking this stuff, maybe you knew if there was a way to enable/disablle the functionality with an intent, so that i could use tasker XdD
[Moto X Themes and Apps] vashollow:
i mean how to use it and how to make this function happend?

*sorry for my english btw
[Moto X Themes and Apps] hawkjm73:
Ok, you want to enable/disable the fact that it is listening at all? Right now, no. It's just a setting, though, so it ought not be too hard to do.

In the mean time, though, you can get close. When you enable "override" the only thing TC does on its own is the little beep (assuming you the the other one disabled). You can either leave "intent" disabled or have Tasker ignore the input when you want.
[Moto X Themes and Apps] hawkjm73:
I just got another Touchless Controls update this evening. It would appear to have not broken the classes this time, mine phone worked fine straight after.
[Moto X Themes and Apps] Stevo32792:
I've been attempting to do this myself. There's two ways of doing it, both with their bugs, but they're solvable...

The first method is to intercept the intent with Tasker and have Tasker kill the Touchless Control app (I needed a plugin called 'Taskkill' to do this on the 'Advanced' setting). The problems with this one is that the music does stop playing, but it's only for about 1/4-1/2 of a second. Bearable. Not too difficult and the app doesn't beep at you when it does this, and the screen stays off if it was off.

The second way is probably the worst of the two ways, but I haven't figured it out yet. I have Tasker using a plugin called 'Secure Settings' to change the package state of Touchless Control to disable, then change the state back to enable when it you want Touchless Control to work. This does not use the 'OKGoogleNowIntentBroadcast' module in any way. The only problem with this method is that re-enabling the app causes its settings to reset to an off state... I believe this can be worked around if you found a way to restore the settings to a state when the app had it enabled (in which case, you wouldn't need to do this anyways if you could have an enable backup and a disable backup).
[Moto X Themes and Apps] Charlie.igg:
Can you elaborate on the first one? I've never intercepted intents before with Tasker (or any other app for that fact).

Thank you!
[Moto X Themes and Apps] Stevo32792:
Yea, no problem.

With the xposed module made by hawkjm, set it to send an intent but not to override. In tasker, create a new profile which triggers on 'Event --> System --> Intent Recieved'. The Action field should be 'com.hawkjm.okgooglenowtriggerintent.AUDIO_TRIGGER' without the quotes (this is given to us by hawkjm's application instructions).

Create a new task for this profile. My task uses the 'Taskkill Tasker Plugin' Application to kill Touchless Control when this intent is recieved. So I add a Plugin action for 'Taskkill' that kills the 'Touchless Control' Application with the 'Advanced' method (none of the other methods worked).

Obviously I didn't want this killing Touchless Control all the time, so I put that task kill action inside of an If statement that only triggers when my variable 'TOUCHLESS' is 0 (zero). All I have to do is set my location tasks to change the 'TOUCHLESS' variable if I want Touchless Control to work or not.
[Moto X Themes and Apps] ShaneDale:
I'm having some trouble getting Tasker to use the OkGoogleNowTriggerIntent module.

I just want to set up something simple in Tasker. I want to say "Ok Google now, brightness 100" and have Tasker do the rest.

Can anyone help me get that set up so I can use that as a base so I understand how to set up other commands? Thanks in advanced!
[Moto X Themes and Apps] Stevo32792:
With the xposed module made by hawkjm, set it to send an intent and to override. In Tasker, create a new profile which triggers on 'Event --> System --> Intent Recieved'. The Action field should be 'com.hawkjm.okgooglenowtriggerintent.AUDIO_TRIGGER ' without the quotes (this is given to us by hawkjm's application instructions). This will allow Tasker to see that "OK Google Now" was said, but it won't open Touchless Control.

From here, use a new Task in Tasker, and add the Action 'Input --> Get Voice'. This will bring up the voice capture window for talking to the phone. The information from this window will be stored in the variable %VOICE. Just check %VOICE for your command, and use an IF statement to handle the variable.

For example, if my IF statement was '%VOICE Matches "brightness 100"', then set brightness to 100. You can also do an Else statement at the end of the task that Googles the %VOICE data if nothing matched. This will return basic functionality to Touchless Control. There might be better ways of doing this with third party applications, but I know that this works.
[Moto X Themes and Apps] hawkjm73:
I am sorry it took so long. It was embarrassingly simple in hind sight. There is a method at the very beginning of the flow called "handleKeyPhraseRecognised". It hooked fine, but if I overrode it, the system wouldn't ever look for the key phrase again till it was reset. It turns out, it was as easy as stopping and restarting the monitor service.

So, a new version is up on the repo. It no longer hooks any obfuscated methods, so it ought to work on any version. I haven't got a Jelly Bean device, so those who do, let me know if it works. It should also be more resistant to changes in future updates.

In addition, it now hooks in before the beeps. So, if you have "override" enabled, and either disabled "intent", or ignore the intent in Tasker, nothing happens when you say the phrase. TC isn't technically disabled here, as the service is still active and listening, but this works quite nicely if you want a "do not disturb" mode.
[Moto X Themes and Apps] Stevo32792:
This makes me happier than I'm willing to admit, and I can only guess is less glitchy than my method of killing TC. Thanks!
[Moto X Themes and Apps] jfriend33:
I really would like the ability to control my phone from the shower. It always hears me say Ok Google now, and mutes the music. About 50 percent of the time it won't start the right artist. I just wish I could say, skip track. Or launch pandora (which auto plays)

Sent from my unlocked consumer edition Motorola Droid Maxx xt1080m.
[Moto X Themes and Apps] ShaneDale:
Almost got it but I am not very good with tasker. I have the profile set up but I am having trouble with the if statement. This is what I have. Thank you for helping me :)
[Moto X Themes and Apps] Stevo32792:
I've attached a task I've gotten working as an image. The only problem with it is that the Google search performed when no match is found doesn't perform the action, but still searches for it. Maybe someone has a workaround?
[Moto X Themes and Apps] mmikeee:
I'm interested in this and have everything installed and even got the max brightness to work. I read through the whole thread and some were talking about using autovoice as well. Is there any benefit to this?
[Moto X Themes and Apps] Stevo32792:
Probably, but I haven't looked into it. My time hasn't exactly been committed at all to voice commands, and what I posted there was just some playing around with tasker more than anything. Load it up and try it out.
[Moto X Themes and Apps] hawkjm73:
Think of AutoVoice as a major expansion of Tasker's own voice recognition. Function wise, it adds the ability to use Bluetooth microphones, long single recognition, and continuous recognition.

It also gives a vast amount of control over what to do with a given statement. You can setup very complicated filters if you want, with parameters inside. For example, you might say "Set the living room lights to 40 percent". You can set it to launch your lighting control app, and deliver "living room" and "40" as variables.

I definitely recommend it for doing voice controls, but you'll want a decent amount of time to sit down and play with it. It gives quite a lot of options, and so, it kinda complicated.
[Moto X Themes and Apps] natezire71:
Just to be clear...

Could I use this to detect when I've called on Touchless Controls then have Tasker turn on the WiFi? I keep data off usually all the time, but it would be awesome if I said "Okay Google Now, (insert command here)" and while my command is processed, it turns on WiFi.
[Moto X Themes and Apps] hawkjm73:
Yes, that is most definitely possible. Keep in mind, though, this module only sends out an intent that it heard "OK, Google now." You'll need to handle all the rest in Tasker.

Your flow would be a profile to listen for the intent, and a task turn on voice recognition. This can either be the built in one in Tasker, or a plugin like AutoVoice.

If you use native, do a text check for the command you want. If it matches, turn on the WIFI.

If you use AutoVoice, set a profile with your desired command in the command filter, and a task to turn on WIFI.

Keep in mind, this generally isn't quite fast enough for you to just say it all together. You will need a bit of a pause between the trigger and the phrase. For my setup, I need about a period's worth of pause rather then a comma's.
[Moto X Themes and Apps] joaomgcd:
hawkjm73 I'm interested in incorporating your intent in AutoVoice itself. Just to clarify, this only works on the MotoX? Or does it work on any device with the always listening chip?

Thanks in advance! :)
[Moto X Themes and Apps] hawkjm73:
I would expect it to work on any of the devices that use Motorola's implementation, but I only have a Moto X to test with.

Depending on how other phones do the base code, similar hooks may work, but I doubt it could be cut and paste.

Does AutoVoice have a direct intent to launch recognition? I've been considering making the intent to call an option in settings, Tasker controlled if desired.

Direct AutoVoice access would be cool, but keep in mind, it can only tell that the use said the phrase, not what they said. I'd really love for it to always be listening to everything, but I suspect the base form for "OK Google now" gets dumped to the low power chip, and it only listens for exactly that.
[Moto X Themes and Apps] joaomgcd:
What I want to do is to add a Tasker event that's specific to this intent. The people could start voice recognition in the Task if they wanted to. This makes it more customizable then simply starting the voice recognition right away, because if you did that, you wouldn't be able to choose language and other options. I can still add an option in the app itself (similar to Auto Recognize BT) that starts recognition automatically with default settings. :)

So should I just add a broadcast receiver for that intent? Nothing else I need to know about? :)

Thanks!
[Moto X Themes and Apps] joaomgcd:
Ok, I've released a new version of AutoVoice that should work with this. Can you please try it? It's in beta, so sign up here if you haven't already: joaoapps.com/beta-testing/ .

It's version 1.5.24b

Thanks in advance!
[Moto X Themes and Apps] hawkjm73:
Hmm, XDA app ate my earlier reply. I tried to comment before your new version. :)

The new condition works great. It's simple, easy, and painless. The info popup is a nice touch, and linked successfully to the repo. I would suggest adding that no configuration is needed, as that isn't obvious straight away.

I haven't tested the regex group variable yet, but I will soon.

(I'm Jenny, by the way, from the Google+ group)
[Moto X Themes and Apps] hawkjm73:
Though, as I think on it, maybe rearrange the info popup a bit. Perhaps two text links, one for the module and one for exposed itself, then just the OK button to complete the config.
[Moto X Themes and Apps] joaomgcd:
I thought your username sounded familiar! :) Great times beta testing AutoVoice! :victory:

Ok, I've made those changes. Can you check if it's better now? https://drive.google.com/file/d/0B8G77eDgeMdwNGtqUkk1cDhaODA/edit?usp=sharing

By the way, you think you could link to AutoVoice (or mention it) in the original post and/or in the Module page? Will save people some trouble fishing around for how to use this the easy way. :)

Thanks again!
[Moto X Themes and Apps] hawkjm73:
Looks good. Links all work.

I added a link to the repo.
[Moto X Themes and Apps] joaomgcd:
Great, thanks! Maybe it would be wise to add that it's only available in the beta for now. I'll let you know when it's out of beta. Thanks again!
[Moto X Themes and Apps] hawkjm73:
Whoops, yeah that would be needed. Added a beta tag.
[Moto X Themes and Apps] mastarifla:
I would like to personally thank you two for coming together to add this functionality, I think it will really help both of your applications out and the power users (like myself) will do our best to support you and your products!
[Moto X Themes and Apps] johnh123:
OK, i'm new to autovoice, tasker, this, etc. I've got a moto x, of course. I'd like to be able to say 'ok google now' 'fitbit' and have it turn on bluetooth and then run the fitbit app. Am I to understand this used to be easy with autovoice but no longer works? And further that I could do it with this 'broadcast intent' but then I would lose regular google now search functionality?

Any help would be appreciated.
[Moto X Themes and Apps] Levistras:
Also hoping for a little direction to get started on this...

Have Moto X 4.4.2, rooted/unlocked:

AutoVoice 1.5.27b

Xposed Installer 2.6.1

OkGoogleNowTriggerIntent 1.3

Touchless control 4.3.11.1

All 3 checkboxes enabled in OkGoogleNowTriggerIntent.

External Access enabled in Tasker

I've tried two things:

Create Profile

Event -> System -> Intent Received

Set "Action" to "com.hawkjm.okgooglenowtriggerintent.AUDIO_TRIGGER"

Hit Back, assign a Task to launch Calculator (I've tried both "App" -> "Launch App", and the Secure Settings solution: "Plugin" -> "Secure Settings" -> Config -> Actions -> Launch Activity)

go to home screen.. say "Ok Google Now"... touchless control pops up... ask it how the weather is.. Google now launches, I get the weather.. no interaction with calculator.

-->Trying again!!!

Create Profile

Event -> Plugin -> AutoVoice Ok Google Now

configuration -> Back out because yuo don't have any options

Assign a task (as above, tried both App->Launch App and the Secure Settings option)

Go to home screen.. say "Ok Google Now".. experience exactly as above.. no calculator popping up.

Am I missing something fundamental here?!?

Any assistance would be awesome! Would really like to get this working.. I'm such a Tasker noob though.

<<<<Not sure what I did.. but after 2 reboots.. enabling and disabling tasker.. disabling and re-enabling external access... the above works! Leaving this post here if anybody is curious about the steps>>>>
[Moto X Themes and Apps] hawkjm73:
When you initially tried it, the fact that the touchless controls interface came up indicated the actual module was not working yet. The reboots are probably what did it. Had you rebooted after installing Xposed and after enabling the module?

I'm pretty sure external access is not needed for the plain module, as it simply sends an intent for which you write a profile to listen. Using the AutoVoice plugin conditions does, though.
[Moto X Themes and Apps] vitoski:
Hey Guys!

I went through the whole thread and read every single post however I am a little bit confused. Is there a chance to use AutoVoice and TC both together? I mean if I have command set up 'i.e. Enable Wifi' it will use the AutoVoice+Tasker to enable my Wifi. However if I ask 'what's the weather ' or any other phrase that is not defined It will use TC instead?

Thx in advance.
[Moto X Themes and Apps] hawkjm73:
Unfortunately, no. As far as I can find, TC and AV cannot use the mic at the same time.

You could, however, initiate AV, say a specific command or just something besides one of your filters, and launch Google Now for voice commands. Not quite as slick, and you would need to handle any command that are purely TC on your own.
[Moto X Themes and Apps] joaomgcd:
You could use the "AutoVoice No Match" condition in Tasker to launch a Google Now Text Search (you can do a text search with AutoShare and the intent from here: http://joaoapps.com/autoshare/intents/)

This way, whenever a command isn't matched by AutoVoice, Google Now would pop up with the search.
[Moto X Themes and Apps] vitoski:
Thx for the tips. However if you use 'Text Search' you would not get verbal output but only non-verbal. Therefore it somehow does not work exactly as TC and moreover we lose Moto X TC commands. I was wondering if there is a way to pass AutoVoice text input to Google Now (Search) as Google Now voice search?

Nevertheless thank you guys for your reply!
[Moto X Themes and Apps] Chopperpilot:
Google Now keeps starting even though Xposed module is fully active?

Hi hawkjm73,

actually I'm not using a Moto X but a Samsung Galaxy S4 with KK 4.4.2, latest Xposed-Framework, Xposed-Module "Ok Google for 3rd party launchers / apps (4.4+)" by MohammadAG for the "OK Google" Hot-Word detection in certain apps, AutoVoice and a Tasker profile with the OK Google Now Event-Receiver from the latest AutoVoice-Beta.

As Google Now fires up flawlessly on every "OK Google" Hot-Word detection

I was hoping that your awesome xposed module for redirecting this Intent, which I've been looking for for a long time now, would overwrite the action of Google Now and redirect its intent "to Tasker". I think, I set up everything as it should be, because my Tasker log shows actions of your xposed module and the belonging intent. BUT even though all the checkboxes in your module are checked, Google Now still receives the "OK Google" command.

The funny thing about his is, ca. 1% of the time AutoVoice

also

starts to listen so that it is in front of Google Now and

sometimes it starts to listen maybe 1-5 minutes after Google Now got the command

.

You see, I'm very confused.:confused:

I hope, I can give You any details on this issue and there is anything You can do about it, as I would reeaaaally love to have my phone with Touchless Controls without the Google Now Search API, which always leaves the search term open in Google Now and thereby interrupting the operating process.

here is one line from my Tasker log:

what should Tasker register in this log after a successful intent redirection to AutoVoice?

Thanks in advance and Thanks a lot for Your awesome Xposed module!
[Moto X Themes and Apps] abuttino:
I gave this a shot in tasker, no go.. Then, I opened up an adb logcat. It's not being broadcast.. Any ideas?

I have all 3 checkboxes with check marks in them.

EDIT: Nm.. I had an extra space after the intent received.