FORUMS
Remove All Ads from XDA

Alarm clock with tasker

5 posts
Thanks Meter: 0
 
By Flechg, Junior Member on 8th September 2019, 03:03 PM
Post Reply Email Thread
Hello everyone i have a huawei mate 20 non root with android 9 and i would like to cancel an alarm with tasker but impossible.
I can activate an alarm at a given time but in the opposite direction impossible. do you have an idea thanks again
cordially
 
 
8th September 2019, 08:50 PM |#2  
ktmom's Avatar
Senior Member
Thanks Meter: 2,091
 
More
There are several ways to do this. What have you tried that isn't working? Even better, post the profile or task that isn't doing what you want. If you post just the task to snooze/dismiss an alarm, what triggers the task to run?

Before exporting, if you have sensitive information such as logins, api keys or anything else, you might consider setting those values to a variable and use the variable in your tasks so they won't export with the task.

To export a task description for posting, 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 something like pastebin.com / hastebin.com and link to a post here. If you paste in a post here, the forum software will convert semicolons with characters directly after, into emoticons making it very hard to read.
9th September 2019, 10:12 PM |#3  
OP Junior Member
Thanks Meter: 0
 
More
Hello everyone here is what I can do and what does not work.
* What works
Calendar Entry Profile -> Work
Then task -> Set ALARM AM 05 H 45
* What does not work is the reverse task if not working then disable alarm clock
Thanks
9th September 2019, 11:34 PM |#4  
ktmom's Avatar
Senior Member
Thanks Meter: 2,091
 
More
Quote:
Originally Posted by Flechg

Hello everyone here is what I can do and what does not work.
* What works
Calendar Entry Profile -> Work
Then task -> Set ALARM AM 05 H 45
* What does not work is the reverse task if not working then disable alarm clock
Thanks

Posting the profile and task (as described above) is always more illuminating. However, the inverse of that would just be not setting an alarm. If there's no calendar entry the alarm is not set. I'm still missing the problem. Is there a residual alarm that goes off without having been set through tasker?

Edit -

I've been pondering and the only thing I can come up with is that you set an alarm and then the next day you set an alarm... then end up with a clock app full of alarms. If that's the problem, and the goal is to have the alarm only go off on work days, then approaching this problem the other way might be better.

Set the alarm to go of every day at the right time in the clock app, then create a profile that checks if today it's a work day, then set a variable.

In a second profile, use the variable (not a work day) as a context plus an AutoNotification intercept, for the alarm notification. You'll be canceling the alarm on days you don't need it.

On newer Android, there is a pre-notification that shows up some period before the alarm is set to fire (an hour maybe?). That notification has a dismiss button. If you intercept that notification, then the entry task can click on the dismiss button again using an AutoNotification action.

I think the category id is "Upcoming Alarms". This field can be examined by grabbing it in the AutoNotification profile context configured to "get all fields". Then flash %ancategoryid.

There are also clock app intents that can dismiss alarms. I don't use that because it doesn't work on my device. The intent looks like the following:
Code:
Send Intent [ 
    Action:android.intent.action.DISMISS_ALARM 
    Cat:Default 
    Mime Type: 
    Data: 
    Extra:android.intent.extra.alarm.SEARCH_MODE:android.all 
    Extra: 
    Extra: 
    Package: 
    Class: 
    Target:Activity
This intent should only cancel the current occurrence of a repeating alarm.

If this works for you, then you can explore the android developer documentation - alarm clock and discover a variety of intents.
The Following User Says Thank You to ktmom For This Useful Post: [ View ] Gift ktmom Ad-Free
11th September 2019, 12:34 AM |#5  
ktmom's Avatar
Senior Member
Thanks Meter: 2,091
 
More
For the sake of completeness, in case this thread is found by others in the future, there is an action system -> cancel alarm.

This can be used to cancel/snooze/disable an alarm. However, it's reliability is dependant on the device/OS and at least in my case doesn't work any better than the intent. Some devices will always get a pop-up menu to confirm which alarm to take action on.
The Following User Says Thank You to ktmom For This Useful Post: [ View ] Gift ktmom Ad-Free
14th September 2019, 04:06 PM |#6  
OP Junior Member
Thanks Meter: 0
 
More
Hello and thank you for your answers
i tried intent as well as other things like cancel alarm but with my huawei it does not work okay is this android 9
I give up thanks again for your help

14th September 2019, 05:15 PM |#7  
ktmom's Avatar
Senior Member
Thanks Meter: 2,091
 
More
The autoNotification method should work. If you haven't gone through and made sure that all of Huawei's power saving "features" are disabled so the apps can wake up and do their job without being killed by the system.

Read these

https://dontkillmyapp.com/huawei

https://tasker.joaoapps.com/userguid...roblem.html#00

If you really want help, then post what isn't working. Instructions to do so were given in post 2.
The Following User Says Thank You to ktmom For This Useful Post: [ View ] Gift ktmom Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes