r/tasker•
killchain

[Help] Can't get profiles to get triggered by a clock alarm

Help

Hey. I've been trying to have a bunch of tasks get triggered by my morning alarms. I'm using a Pixel 4a (5G) running the latest stock Android 11 (rooted) and the latest Google Clock (com.google.android.deskclock). I usually have a bunch of alarms with labels, so first I tried adding the labels to the events too, then also tried removing the labels from both the alarms and the events - neither of these works. I tried all the different alarm-related events in Tasker and none of them seems to work. Is this a bug, or am I missing something? Do I need to have another context for the profile to become active, or is just Alarm Clock/Alarm Done by itself enough? As suggested by other threads, I checked Preferences -> Monitor -> Use Reliable Alarms and mine is already set to When Off, although that might be unrelated since the phone, at least in the case of Alarm Done, is already awake (plus I don't need absolute precision - it'd be fine if the profile becomes active some time after that).

I know I can probably achieve this by hardcoding the time instead of linking it to the alarms, but I'd prefer having some flexibility.

Any suggestions are appreciated. Thanks in advance.

Posted Oct 14, 2021, 7:04 PM UTC

29
OwlIsBack•

You could try this way...

  • An "Intent Received" event Profile (the intent: android.app.action.NEXT_ALARM_CLOCK_CHANGED), (or "Alarm Changed" event [In this case You will not need the following mentioned action]).

  • In linked Task use "Test Next Alarm" action (to get the next alarm time).

  • Set retrieved time to a "Time" context Profile.

The event will be received at every "Alarm Clock" change (when an alarm is added, removed or It's done).


Edit: "Alarm Changed" event never worked reliably on my devices, so I prefer the intent way.

3
spookiekabuki•

This works for setting the time, but when the alarm goes off, it doesn't seem to retrigger the event. This would mean that I cant wipe the time value when the alarm goes off

1
OwlIsBack•

Strange...It should fire even when the alarm goes off. I have a Profile using this intent and It's working fine (on two Samsung devices).

Here You will find the doc, If You are interested.

Good luck.

1
spookiekabuki•

Maybe I need to try the intent instead of the built in profile trigger. Bc if that intent works I don't even need to set the variable, I can just have the alarm Intent as the trigger

1
OwlIsBack•

Read my comment again please, I added soothing (doc link).

I can just have the alarm Intent as the trigger

No, You can't, because the intent is received even if You add a new alarm.

1
spookiekabuki•

OK I think that's it. Alarm Changed profile event will not capture the alarm going off, but the intent you suggested does

1
moviejimmy•

If your alarm creates a notification when it goes off, then using the Notification event should work reliably.

2
Rich_D_sr•

It seems Tasker has never had consistent results when it comes to the android clock app. I gave up on it long ago. I have never tried it , however you should be able to get consistent results by using a notification context or even autonotification. I now use the alarm app AM Droid. This has tasker integration. It has been working flawlessly for over a year for me.

1
FoggyWan_Kenobi•

I have completely replaced stock android alarm app with Tasker with AlarmTask a long time ago. Worth a try.

But here I see a couple of another profile contexts possible 1- Set profile to time frame like 5:00 to 7:00 and event screen unlocked. 2- Maybe better, set a profile to activate like an hour or more countdown from screen off, and then triggerin enabled another profile with screen unlock event.

You can replace the screen unlock event with an event from sensor or plugin that detect device movement, to make sure it only goes active when you got of the bed, and not if you decided to sleep a bit longer today:)

1