Select Amazon Video (Leanback) for profile - Tasker Tips & Tricks

Hi everyone,
I am using tasker a lot of time but I have a problem which I can't solve my own. I am using a nvidia shield with modded Android Tablet os (not lineage but droidmote one). But that's doesn't really matter. I would like to use Amazon video leanback app which isn't displayed in the normal app list but can only be started through settings->apps or with a shortcut on launcher which I use. Therefore Amazon video cannot be found in tasker profiles -> apps. I know that there are plugins for using shortcuts as a task. But I want to select it for a profile - when I quit Amazon video, a task shall be executed.
Do you have any hints for me?

When you add an app context to your profile, have you tried enabling "all" (bottom right of app screen)? Does the Amazon video app show up as an activity or service then?
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Yes, I have tested selecting all but it is not displayed there either

OK, so this thought will be less than optimal, but the shield is running of mains power not battery, right?
There is a variable %WIN, that on some devices, monitors the foreground app. You could monitor that variable for when it becomes the Amazon app, then trigger when it becomes something else.
If %WIN doesn't work on your device, then there is some code you could use to monitor the foreground app using raw dump.
Profile: Test WIN Variable
Event: Variable Set [
Variable: %WIN
Value: *
User Variables Only: Off
Enter: WIN
A1: Flash [
Text: Current WIN - %WIN
Long: Off
A2: Wait [
MS:0
Seconds:6
Minutes:0
Hours:0
Days:0
A3: Run Shell [
Command:su -c dumpsys window windows | grep -E 'mCurrentFocus'
Timeout (Seconds): 0
Use Root: Off
Store Output In: %rawDump
Store Errors In:
Store Result In:
A4: Popup [
Title: Current rawDump
Text: %rawDump
Background Image:
Layout: Popup
Timeout (Seconds): 119
Show Over Keyguard: Off
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

I have tried the win profile but always get another window id when I open the app. What can I do now?

For both the flash action and the pop-up? The flash action uses the app name, the pop-up should contain the package name.
If neither the %WIN variable nor the raw dump finds anything related to Amazon app, then I have no idea how you can identify that it's running.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Here is the output. I meant that the first number behind the brace is always different. The 2nd and 3rd row is identical
But how can i choose it now for profile - setting the value to com.amazon*** ?

The output for flash %win is "Prime Video". I can set that value in profiles but can only select a start task, no exit task which I like to use
How can I do this?

I think you make a profile to act as the exit task. Try setting a variable (e.g. %Prime = true) then having another profile context;
Profile: Test WIN Variable
Event: Variable Set [
Variable:%WIN
Value:*
User Variables Only: off ]
State: Variable Value [
%Prime ~ true ]
Make sure to clear the %Prime variable in that task.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Here is my task
Your suggested profile doesn't work with the task I attached.
Might you help me with an advice?

It's better to share your profile (or both in your case) when it's not working as expected. The exported description provides much more information than a screenshot.
Make sure it's named - not a default name assigned by tasker. To name the profile if it isn't already, long press on the name to highlight the profile and, at the top, tap the square with the A.
Then long press on the name to highlight the profile. Go to the 3-dot menu and select export -> Description to Clipboard.
Now you'll be able to paste it. Be aware, it easier to use pastebin and link to a post here. If you paste in a post here, the forum software will convert all semicolons with characters directly after to emoticons making it very hard to read.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

I have edited the profile like you mentioned in previous post
Profile: Amazon Video (9)
Event: Variable Set [ Variable:%WIN Valuerime Video User Variables Onlyff ]
State: Variable Value [ %Prime ~ true ]
Enter: 24Hz Aus (3)
A1: [X] Variable Clear [ Name:%Prime Pattern Matchingff Local Variables Onlyff ]
A2: Launch App [ App:TVHZ Data: Exclude From Recent Appsff Always Start New Copyff ]
A3: Run Shell [ Command:input tap 1260 260 Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: ]
A4: [X] Kill App [ App:Netflix Use Rootn ]
A5: Go Home [ Page:0 ]

What sets %Prime to true?
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Nothing so far. What would you suggest to do so?

greys11 said:
Nothing so far. What would you suggest to do so?
Click to expand...
Click to collapse
What I suggested in the first paragraph of the original post (below).
Create a profile whose only job is to recognize when the %WIN matches Prime Video and the associated task sets %Prime = true.
This acts as a mechanism to identify when you have launched the app.
Then, the 2nd profile monitors the %WIN variable for anything but Prime Video and runs the task you want after you exit Prime Video.
The point of the %Prime = true is so the 2nd profile runs only on exit from the video app and not every time the %WIN variable gets set as you go from app to app. You are creating a pseudo exit task.
ktmom said:
I think you make a profile to act as the exit task. Try setting a variable (e.g. %Prime = true) then having another profile context;
Profile: Test WIN Variable
Event: Variable Set [
Variable: %WIN
Value: *
User Variables Only: off ]
State: Variable Value [
%Prime ~ true ]
Make sure to clear the %Prime variable in that task.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

I got it. Many thanks for your help
Is there any possibility in tasker to switch the refresh rate except using the detour over tvhz and input tap command?

Sorry I have no idea.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Do you know the tasker code (keyevent) to emulate the keypad navigation (exiting airmouse mode) ?

I haven't used that in a while Here is a link to a page with a list.
I tend to use the AutoInput root action, but there is also the built in Tasker DPad action.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Thanks for the list. But I can't find the code for the button on rc to switch from touchmode with cursor to keypad mode for leanback interaction. I recently opened a new thread for the issue

Related

Write text to screen on non-rooted device

I have Galaxy S8, Android 7.0, not rooted. I am trying to actually launch Google voice and insert contact to send message to. Using tasker and autoinput, I can launch GV and click new message button, but I can not for the life of me input the name of the contact into the screen. I can do it on a rooted Android 6.0 device, but not the S8.
I've tried this every which way:
1. Tasker->AutoInput->Write Text (not supported on non-rooted device?)
2.Tasker-> AutoInput-> Paste Text (copied to clipboard using Tasker)
3. Tasker->shell command->"input text" (not supported on non-rooted device?)
4. Tasker->Ctl-V->Text
5. Tasker->Remote ADB Shell->"input text"
6. Tasker->input->write (not supported on non-rooted device)
So, I think it's safe to say that between tasker/autoinput/etc... there is NO way to write text to screen on device that is not rooted. I hope I'm wrong, and if someone knows how, please let me know! Thank you.
I'm not rooted as well and the AutoInput paste action works. Are you sure you have the text field selected right? This was something I had to struggle with in the beginning. (S7 Edge)
Edit: You could try the TouchTask plugin, this might work in areas where AutoInput doesn't.
digitalpig82 said:
I'm not rooted as well and the AutoInput paste action works. Are you sure you have the text field selected right? This was something I had to struggle with in the beginning. (S7 Edge)
Edit: You could try the TouchTask plugin, this might work in areas where AutoInput doesn't.
Click to expand...
Click to collapse
Well, I stand corrected. After struggling and struggling, I was finally able to write to screen. But, guess what? Every time I execute the profile, it adds the last %avcommnofilter value to the field in addition to the new one. Example attached (I used it for "Chester" 3 times). Also, it places a space before the name, effectively rendering it useless for my purpose of searching contacts.
Here is how I finally manged to get this far:
Code:
Profile: Google Voice Text (12)
Event: AutoVoice Recognized [ Configuration:Command: "google voice text (regex)" ]
Enter: Launch GV Message (11)
A1: Launch App [ App:Voice:SplashActivity Data: Exclude From Recent Apps:eek:n Always Start New Copy:eek:n ]
A2: AutoInput Action [ Configuration:Stored Action: Voice - 'Start a conversation' - Click Timeout (Seconds):10 ]
A3: AutoInput Action [ Configuration:Stored Action: Voice - 'To' - Write Timeout (Seconds):20 ]
A4: AutoInput Action [ Configuration:Type: Focus
Text to Write : %avcommnofilter
Action : Write Timeout (Seconds):20 ]
I say "Google voice text <name>" to launch GV, hit add message button, and click on "To" field.
I used autoinput to create two stored actions: A2 to click on the "add message button" and A3 to click on the "To" field. These work. I then write %avcommnofilter using Focus on the "To" field. This places the name into the field, with a leading space. If I repeat the command, the screens come back up, the contacts field is empty, then the name, with leading spaces, is duplicated. This repeats itself until I manually "delete all" from the clipboard.
The only way to get rid of the duplicate names is to manually clear the keyboard (I haven't found a way to do it in Tasker that works so far). And, even when there aren't any duplicates, the leading space is there.
If you have figured out how to do this successfully, would you PLEASE share? Thanks!
SomebodySysop said:
Well, I stand corrected. After struggling and struggling, I was finally able to write to screen. But, guess what? Every time I execute the profile, it adds the last %avcommnofilter value to the field in addition to the new one. Example attached (I used it for "Chester" 3 times). Also, it places a space before the name, effectively rendering it useless for my purpose of searching contacts.
Here is how I finally manged to get this far:
Code:
Profile: Google Voice Text (12)
Event: AutoVoice Recognized [ Configuration:Command: "google voice text (regex)" ]
Enter: Launch GV Message (11)
A1: Launch App [ App:Voice:SplashActivity Data: Exclude From Recent Apps:eek:n Always Start New Copy:eek:n ]
A2: AutoInput Action [ Configuration:Stored Action: Voice - 'Start a conversation' - Click Timeout (Seconds):10 ]
A3: AutoInput Action [ Configuration:Stored Action: Voice - 'To' - Write Timeout (Seconds):20 ]
A4: AutoInput Action [ Configuration:Type: Focus
Text to Write : %avcommnofilter
Action : Write Timeout (Seconds):20 ]
I say "Google voice text <name>" to launch GV, hit add message button, and click on "To" field.
I used autoinput to create two stored actions: A2 to click on the "add message button" and A3 to click on the "To" field. These work. I then write %avcommnofilter using Focus on the "To" field. This places the name into the field, with a leading space. If I repeat the command, the screens come back up, the contacts field is empty, then the name, with leading spaces, is duplicated. This repeats itself until I manually "delete all" from the clipboard.
The only way to get rid of the duplicate names is to manually clear the keyboard (I haven't found a way to do it in Tasker that works so far). And, even when there aren't any duplicates, the leading space is there.
If you have figured out how to do this successfully, would you PLEASE share? Thanks!
Click to expand...
Click to collapse
Finally figured this out. Problem is, the text written into field has a leading space and is duplicated every time I repeated the command. Or rather, the last text pasted is added to %CLIP and inserted into field with new text after each command.
I had assumed I could not use AutoInput->write->field id because I could never get it to work. After hours of trial and error, I finally realized I was missing the correct field id in the write action. Located correct field id, removed leading space from %avcommnofilter and used "write" instead of "focus" to avoid pasting from %CLIP. And now it works.
For the benefit of others who find themselves in the same situation, here is the code that worked for me:
Code:
Profile: GV TouchTask (6)
Event: AutoVoice Recognized [ Configuration:Command: "google voice text (regex)" ]
Enter: GV Text (13)
A1: Launch App [ App:Voice Data: Exclude From Recent Apps:eek:ff Always Start New Copy:eek:n ]
A2: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A3: Actions [ Configuration:Action: Tap Method: Point (x,y) Selection: 948 1944 Timeout (Seconds):10 ]
A4: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A5: Variable Set [ Name:%Space To: Recurse Variables:eek:ff Do Maths:eek:ff Append:eek:ff ]
A6: Variable Search Replace [ Variable:%avcommnofilter Search:%Space Ignore Case:eek:ff Multi-Line:eek:ff One Match Only:eek:n Store Matches In: Replace Matches:eek:n Replace With: ]
A7: AutoInput Action [ Configuration:Type: Text
Value: To
Text to Write : %avcommnofilter
Action : Write Timeout (Seconds):20 ]
My goal was to launch Google voice and start new conversion (send text message), searching for the contact name in my command. Neither Google assistant or Google now will send text messages using Google voice.
I created AutoVoice recognized event based on command "google voice text".
A1 launches Google voice app.
A2 waits 1 second
A3 presses the "start conversation" button on the app's home page. I used TouchTask to press the "start conversation" button, but could have used AutoInput to do the same thing.
A4 waits 1 second
A5 creates variable %Space that just contains one keyboard space character
A6 removes leading (first) space from %avcommnofilter (the contact keyword name in the command)
A7 used AutoInput action "write" to enter contact keyword into "To" field. This was the key -- discovering the field id of the field whee I wanted to write the text. joaomgcd says you can find it using "easy setup". I found it using UI Query.
The end result is that a list of contacts matching the keyword in my command. I just pick the one I want to send text to.
Hopefully I'll get better at this. I hope more newbies will take the time to explain how they fix their problems.
Thank you for the assistance.

Help for battery tasks!

I have this:
profile- if battery 45-0,
task - then power save on.
I want to add a exit task, which turns off battery save if mobile is plugged in. Can't i add this in the same profile? Can someone detail explain how to do this?
Add a second profile context, "not power any".
To do this, long press on the existing battery context. A pop up will appear, choose add, then state -> power -> power. Select "any" and check the box to invert. Save.
Now whenever your battery is less than 45, and the device is NOT charging, the entry task will run. If the battery level goes above 45 OR the device is charging with the device below 45, the exit task will run.
Just to make sure you know, when in the profile tab, long pressing the entry task (green right facing arrow), pops up a menu where you can add an exit task (red left facing arrow).
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

[Help Needed] Tasker Auto Call Receive & Dial 1

Hello friends,
I need your help, actually I want Tasker to automatically take call from specific numbers and wait 5 seconds then Dial 1 and hang up the call. (I will not even want to touch the mobile).
Can any body please guide or make script for me, I'm on Unrooted mobile? Thanks alot
Hi you can use autoinput to select 1.
Inviato dal mio FRD-L09 utilizzando Tapatalk
I don't know how to setup Tasker & Autoinput to take call and Dial 1.
I would be very thankful if some body can write steps here.
I'm on Oreo 8.0
Sent from my ZTE A2017U using Tapatalk
No one here to help ?
Sent from my ZTE A2017U using Tapatalk
There are tutorials galore for these basic functions. You might start with the Tasker Userguide and look for Event -> A-Z -> Phone Ringing.
In the task, you will need to use auto input and the device needs to be rooted. It's easier to use the AutoInput UI Query -> variable setup to grab the correct window for the call.
Using the UI Query action effectively creates a wait until the proper screen is loaded. Better than a wait action, using it allows for a possible variable wait.
Then use the AutoInput Action easy setup feature to grab the correct input to launch the dial pad.
Then an optional wait so the key press is accepted within the call (e.g. for a recorded message to finish)
Finally, a AutoInput Root action to dial the number you desire. One number per AutoInput Root action. You would need 4 AutoInput Root actions to dial a 4-digit PIN code for example.
<wait until main call screen launched>
A1: AutoInput UI Query [
Configuration: App
Package: com.google.android.dialer
Variables: dialer, keypad
Only
Visible: true
Only Clickable: true
Timeout (Seconds):20
<open dialpad from main call screen>
A2: AutoInput Action [
Configuration:
Type: Id
Value: com.google.android.dialer:id/incall_second_button
Action : Click
Timeout (Seconds): 20
<optional wait for proper time to dial>
A3: Wait [
MS: 0
Seconds: 5
Minutes: 0
Hours: 0
Days: 0
<dial the number 2 on dialpad - requires root>
A4: AutoInput Root [
Configurationress Key: 2
Timeout (Seconds):100
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
ktmom said:
There are tutorials galore for these basic functions. You might start with the Tasker Userguide and look for Event -> A-Z -> Phone Ringing.
In the task, you will need to use auto input and the device needs to be rooted. It's easier to use the AutoInput UI Query -> variable setup to grab the correct window for the call.
Using the UI Query action effectively creates a wait until the proper screen is loaded. Better than a wait action, using it allows for a possible variable wait.
Then use the AutoInput Action easy setup feature to grab the correct input to launch the dial pad.
Then an optional wait so the key press is accepted within the call (e.g. for a recorded message to finish)
Finally, a AutoInput Root action to dial the number you desire. One number per AutoInput Root action. You would need 4 AutoInput Root actions to dial a 4-digit PIN code for example.
A1: AutoInput UI Query [
Configuration: App
Package: com.google.android.dialer
Variables: dialer, keypad
Only
Visible: true
Only Clickable: true
Timeout (Seconds):20
A2: AutoInput Action [
Configuration:
Type: Id
Value: com.google.android.dialer:id/incall_second_button
Action : Click
Timeout (Seconds): 20
A3: Wait [
MS: 0
Seconds: 5
Minutes: 0
Hours: 0
Days: 0
A4: AutoInput Root [
Configurationress Key: 2
Timeout (Seconds):100
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
Thanks alot for the detailed reply. Unfortunately my mobile is not Rooted, Is there a way for Unrooted mobile?
Thnx once again
Farman007 said:
Thanks alot for the detailed reply. Unfortunately my mobile is not Rooted, Is there a way for Unrooted mobile?
Thnx once again
Click to expand...
Click to collapse
Not that I'm aware of.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
ktmom said:
Not that I'm aware of.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
Will have to try to root my device. Or may be any other friend comes with Unrooted solution.
Thnx man
Sent from my ZTE A2017U using Tapatalk
ktmom said:
There are tutorials galore for these basic functions. You might start with the Tasker Userguide and look for Event -> A-Z -> Phone Ringing.
In the task, you will need to use auto input and the device needs to be rooted. It's easier to use the AutoInput UI Query -> variable setup to grab the correct window for the call.
Using the UI Query action effectively creates a wait until the proper screen is loaded. Better than a wait action, using it allows for a possible variable wait.
Then use the AutoInput Action easy setup feature to grab the correct input to launch the dial pad.
Then an optional wait so the key press is accepted within the call (e.g. for a recorded message to finish)
Finally, a AutoInput Root action to dial the number you desire. One number per AutoInput Root action. You would need 4 AutoInput Root actions to dial a 4-digit PIN code for example.
<wait until main call screen launched>
A1: AutoInput UI Query [
Configuration: App
Package: com.google.android.dialer
Variables: dialer, keypad
Only
Visible: true
Only Clickable: true
Timeout (Seconds):20
<open dialpad from main call screen>
A2: AutoInput Action [
Configuration:
Type: Id
Value: com.google.android.dialer:id/incall_second_button
Action : Click
Timeout (Seconds): 20
<optional wait for proper time to dial>
A3: Wait [
MS: 0
Seconds: 5
Minutes: 0
Hours: 0
Days: 0
<dial the number 2 on dialpad - requires root>
A4: AutoInput Root [
Configurationress Key: 2
Timeout (Seconds):100
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
nice. this worked on access gate to property. The guest dials # plus unit number. Gate calls phone. Auto answers and press 9 and it opens the gate.

Tasker + Autoinput, no screen input start application?

I have a wall tablet that cannot be rooted so the tasker screen idle function doesn't work.
I read that I can acheive the same thing with autoinputs but I can't figure out how to do it.
Generally, I'd have imperihome always running on the screen. I would like to launch daydream app using daydream launcher if I have not touch the screen for more than 1 minute. Can someone help me out? thanks
I think using create a profile that uses "UI Action" from AutoInput as a context will get you where you want. It should trigger anytime you touch the screen and the associated task contains a wait so if another touch occurs, the task will re-fire and start the wait again. The profile should be configured to abort the existing task for that to work. If the wait completes, then your daydream app can be launched.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Turn on yi camera via yi home app when leave home (and opposite)

There is any way to set a task that will lunch yi home app and than will turn on the camera each time that im leaving home?
Sent from my SM-G950F using Tapatalk
Your choices include using swipe actions to emulate touches, or use intents from the Yi home app. To start learning about intents, Not Enough Tech's post
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Categories

Resources