Google Now Integration with Automagic

Post your questions and help other users.

Moderator: Martin

skudo12
Posts: 1
Joined: 29 Nov 2015 02:05

Google Now Integration with Automagic

Post by skudo12 » 29 Nov 2015 02:08

Hello,
I am trying to use Google Now to launch certain commands that would be detected after the phrase "OK Google".
I stumbled into the following link: viewtopic.php?f=5&t=3547

I tried to use the UI Event as the trigger and it works fine when there is no internet access in the device. However, if there is an internet access, it doesn't detect the text in the google app search box.

Is there a way to integrate Google Now with Automagic without the use of plugins when internet access is available?

Note that I am using a Z3 Compact with Android Lollipop 5.1.1

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Google Now Integration with Automagic

Post by Martin » 01 Dec 2015 15:25

Hi,

Excerpt from a recent email:
It seems that Google changed some internals so the old procedure does not work anymore. Unfortunately it's not possible to intercept such events in a reliable way.

You could try to combine trigger UI Event with action Control UI to extract the spoken text. Something like this could work (depending on Google search version):
-trigger UI Event: Window opened package com.google.android.googlequicksearchbox
-action Control UI: text = getText(545, 293);

You could add another action that acts based on the extracted text in variable text. The x/y coordinates 545/293 are probably different on your device. You can find the correct coordinates with the overlay
control of action Control UI or by turning on 'Pointer location' in the developer settings of your device.
Regards,
Martin

snosious
Posts: 9
Joined: 21 Oct 2015 17:47

Re: Google Now Integration with Automagic

Post by snosious » 25 Sep 2016 09:14

The "UI Event: Window opened package com.google.android.googlequicksearchbox" does not work for me to detect the hotword "OK Google". What do I have to do? I just want to detect that the Google Assist is active to rise volume. Thanks!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Google Now Integration with Automagic

Post by Martin » 25 Sep 2016 17:14

The current version of the "OK Google" app/feature does not send any events that are currently supported by Automagic. The required events are not enabled since it could have a negative impact on the overall device performance. I'll test if this is still the case and will activate the other event type when everything looks good.
In the past one of the Auto-plugins provided Google Now integration that could work in this case. Maybe it was AutoVoice but I'm not sure.

Regards,
Martin

snosious
Posts: 9
Joined: 21 Oct 2015 17:47

Re: Google Now Integration with Automagic

Post by snosious » 25 Sep 2016 19:46

I have to apologize, maybe this was not the right thread to ask my question. I just want Automagic to detect that the Google Now Assist is actual listening. Like it's doing after you said "OK Google". Automagic should than change the media volume. Automagic does not need to do things based on speech. Thank you very much.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Google Now Integration with Automagic

Post by Martin » 26 Sep 2016 17:58

Yes, unfortunately that's exactly the part that does not work. The current version of Google Now on my phone does not send any usable events when saying "OK Google". The search result often sends some events, but not when Google Now just starts listening.

snosious
Posts: 9
Joined: 21 Oct 2015 17:47

Re: Google Now Integration with Automagic

Post by snosious » 03 Oct 2016 08:37

Ok, thank you very much for your allways very good support and explanations. How can I find out witch intents are send by search results?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Google Now Integration with Automagic

Post by Martin » 03 Oct 2016 16:43

You could either try trigger UI Event to detect the search results as described in an earlier post:
-trigger UI Event: Window opened package com.google.android.googlequicksearchbox
-action Control UI: text = getText(545, 293); The coordinates likely need to be adjusted for your device.

The following post might also be interesting:
http://automagic4android.com/forum/view ... 607#p15607

Alternatively there exists an Auto-plugin that allowed to intercept Google Now search results:
Google Play: AutoVoice

Please note that Google Now does not offer an official API to integrate with so most methods could stop working when Google updates Google Now or it might also fail on some devices for various reasons.

Regards,
Martin

Bascule
Posts: 16
Joined: 11 May 2015 09:44

Re: Google Now Integration with Automagic

Post by Bascule » 25 Jan 2017 16:24

This is the easiest way I have found of doing this:

Use the paid version of the Tasker Now plug-in (only 88p). The free version doesn't do regular expressions.

Create a trigger with a Plugin Event, select Tasker Now, and set the Statement to matched to ^.*

Then add an action of Set Audio Volume, set Sound Type to "Music", set Change Type to "Set value" and select the Volume level of choice.

I also tick the "Show Volume Level Popup" box so I get evidence that the flow has run.

Hope this helps someone :)

User avatar
mbirth
Posts: 80
Joined: 17 Mar 2016 00:02
Location: Berlin, Germany
Contact:

Re: Google Now Integration with Automagic

Post by mbirth » 10 May 2017 16:45

Is there a way to use the new Assistant API ("Actions on Google"?) to get this feature in a more standard conform way?
BlackBerry KEY2, Android 8.1.0

Post Reply