AutoInput How to use Autoinput profile contexts

Discussion in 'AutoApps' started by Wouter, Feb 4, 2016.

  1. Wouter

    Wouter Member

    Joined:
    Feb 4, 2016
    Messages:
    71
    Likes Received:
    2
    Hello,

    many tutorials are about doing tasks with Autoinput in other apps. They are always triggered by the user, or at a fixed time. I'm looking for information on how to use the context in profiles part of Autoinput.

    I want to trigger a task when Autoinput detects that an app has become active on screen, showing a certain text on the screen. So I have created a profile that triggers on the state > plugin > Autoinput. I used the Easy Setup button to detect Google-app showing the text "Google-logo". This is what shows when Google now/Autovoice is listening for my voice commands. During this listening I want to set media volume to 0 to prevent apps making noice or speaking navigation instructions while I'm giving voice commands.

    This profile becomes active perfectly fine, upon the first time I trigger Google now/Autovoice, but it stays active indefinitely after. I would expect it to become inactive when the Google-app shuts down again after listening to my commands, but is doesn't. How can I solve this? Or can Autoinput detect that the homescreen is shown again, to make the profile inactive again?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hi there. I want to help you but can you let me know what launcher are you using on your phone? Thanks
     
  3. Wouter

    Wouter Member

    Joined:
    Feb 4, 2016
    Messages:
    71
    Likes Received:
    2
    Hi Joao, thanks for jumping in. I'm using HTC Sense 7, Android 6.0 on HTC One M8.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    If you open another app after the google search is done, does the profile go inactive?
     
  5. Wouter

    Wouter Member

    Joined:
    Feb 4, 2016
    Messages:
    71
    Likes Received:
    2
    I'll try and let you know tomorrow. Thanks.
     
  6. Wouter

    Wouter Member

    Joined:
    Feb 4, 2016
    Messages:
    71
    Likes Received:
    2
    Nothing I do makes the profile go inactive, not opening any other app.

    I did get a bit further by not using a state condition that detects if the Google-app shows Google-logo, but instead using an event context with autoinput detecting a UI change from the same app. That gives a short trigger at the beginning of autovoice listening to me.

    The task it triggers lowers the volume , waits for 10 seconds, then sets the volume at it's original level. This solution isn't entirely elegant, as I might be speaking longer than 10 secs, but it works most of the time.

    With that, I'm facing a new problem. I drive with Waze as navigation, it's one of the media sounds I want silenced while speaking. However, each time Waze starts speaking a new navigation instruction, it directly stops autovoice listening. The Google-app is directly gone from the screen without any warning. Earlier spoken commands don't execute.

    Of course I understand you don't know all other apps by heart. But do you have any clue what happens here? Where should I start searching or analysing? Strange thing is that when I set Waze' internal sound setting to mute, this doesn't happen. So, the fact that Waze wants to produce sound, makes it go over the listening Google-app/autovoice.

    Thanks for any hints!
     
  7. Wouter

    Wouter Member

    Joined:
    Feb 4, 2016
    Messages:
    71
    Likes Received:
    2
    Can you please help me out to find out what's happening here? I have a profile now that triggers upon pushing the volume button. The task it executes firstly mutes Waze in the settings in the Waze app and then sends it to the background with the Home command. Then Autovoice is triggered to listen to my command.

    Autovoice will just vanish from the screen at the exact moment Waze would have spoken an instruction, would it not have been set to mute. At that moment there is nothing visible or audible Waze does: it sits silently in the background. But nevertheless Autovoice is gone without a trace. Can I not increase its importance or persistancy? What can it be that Waze triggers that will stop Autovoice or make it go to the background?

    This is the Autovoice log while first letting Autovoice start from Tasker just before a Waze instruction and 1 minute later starting Autovoice again, but this time directly from the Swipe up from Home (google now integration):
    version 2.0.46

    OS Build MRA58K release-keys
    OS Code 23
    Device HTC One_M8
    Manufacturer HTC
    Product htc_europe

    Trigger Words - 2016-02-16 11:33:15.894 - Removed trigger words:
    Trigger Words - 2016-02-16 11:33:15.772 - Removed trigger words:
    Trigger Words - 2016-02-16 11:33:10.842 - Current trigger words:
    Trigger Words - 2016-02-16 11:33:10.828 - Added trigger words:
    Recognition - 2016-02-16 11:33:10.778 - Nothing recognized
    Trigger Words - 2016-02-16 11:33:10.766 - Current trigger words:
    Trigger Words - 2016-02-16 11:33:10.761 - Added trigger words:
    Recognition - 2016-02-16 11:33:10.723 - Nothing recognized
    Recognition - 2016-02-16 11:33:01.391 - Getting Voice command...
    Recognizer - 2016-02-16 11:33:01.389 - Not using headset.
    Recognizer - 2016-02-16 11:33:01.385 - Getting default recognition settings
    Recognizer - 2016-02-16 11:33:01.380 - Action: android.intent.action.ASSIST
    Recognition - 2016-02-16 11:32:16.740 - Getting Voice command...
    Recognizer - 2016-02-16 11:32:16.730 - Not using headset.
    Recognizer - 2016-02-16 11:32:16.701 - Action: com.twofortyfouram.locale.intent.action.FIRE_SETTING

    Is I interpret this log, I think I see that the first time Autovoice is listening (blue text) is ended with a "Nothing recognized" even after I start the second time listening (red). It was gone from my screen long before that, so maybe it's being sent to the background?

    Thank you!!!
     
  8. CoolRaoul

    CoolRaoul Member

    Joined:
    Dec 1, 2015
    Messages:
    56
    Likes Received:
    2
    Hello, please accept my apologies for bumping in your thread. I'm facing the exact same issue as you. Have you managed to find a fix (using an event condition is not a solution for me since I need to detect when the application leave the foreground)
     
  9. Wouter

    Wouter Member

    Joined:
    Feb 4, 2016
    Messages:
    71
    Likes Received:
    2
    No, I have never been able to solve this. Never heard from Joao again
     
  10. Wouter

    Wouter Member

    Joined:
    Feb 4, 2016
    Messages:
    71
    Likes Received:
    2
    I worked around it, in the following way. Instead of letting Tasker detect presence of the Google app on the foreground, I assigned a double click on a volume button to execute a task that first does the things I want and then launches the Google app.
     

Share This Page