Tasker: Dismiss alarm by label

Currently it seems like only dismissing any alarm is possible with Tasker. It would be nice if disabling the next alarm by label would be possible (or a currently ongoing one, if there is one). That would make it possible to specifically disable an automatically created alarm, without affecting any manually created ones. Wildcard support would be especially good.

Note: MacroDroid has this feature, Sleep as Android just doesn’t listen to it, so it doesn’t work there either.

Hello Fabian… please see below…

Enabling/disabling alarm by label

com.urbandroid.sleep.alarmclock.ALARM_STATE_CHANGE
Extras:
“alarm_label”: String representing a label of alarm to be changed. If there are more such alarms, only one of them is going to be changed (no guarantees which).

“alarm_enabled”: Boolean saying whether alarm should be enabled or disabled.

What do you mean? That SAA already has this feature? How would I access that from Tasker? Also, if SAA has this feature, then why doesn’t it work when MacroDroid tries to trigger it?

Hi, you need to use the ‘send intent’ command instead of ‘dismiss alarm’.

Firstly, that means that my feature request is valid, because that feature does not exist.
Secondly, how would I Firstly, that means that my feature request is valid, because that feature does not exist.
Secondly, how would I use “send intent” for this? There are no fields like “alarm_label”, only “action”, “cat”, “data”, “mime type”, 3×"extra", “package”, “class”, “target” and the usual three.
Thirdly: Holy sh**, this forum is laggy! I tried for about 15 minutes to write this here and only managed to write 1½ sentences, which then got messed up again because I couldn’t see the text field, because it was hidden behind the keyboard. I had to type this somewhere else and then copy it over. “send intent” for thi"action", “cat”, “data”, "mis? Ther1e are no fields like “alarm_label”, only d

Hi Fabian,
thanks for your post!

  1. I’m not sure if Tasker allows extras in plugins but yeah, this is something we can look into and do.
  2. Doing this via send_intent - you’ll need to put the alarm_label and the name of your alarm in the “extra” field.
  3. I’ve never experienced lagging on this forum, not sure what might be the cause, any ideas?

An important detail that I should have mentioned there: I was using it on my phone. Try it, it’s really bad. Just initially loading the page took multiple minutes and the text box only updated about once every 5 seconds, so even if it hadn’t been covered by the keyboard, I would have had to type blind anyway. How about just disabling animations on the mobile website and opening a new page for typing instead of doing it in a popup? Paging the replies instead of putting them all into the same place (which seems to load all of them when jumping to the last one using the link in the mail) should also help. If you can even do that, of course, I’m pretty sure this forum software is not made by your company, because Fairphone uses the same.

Back to the actual topic: You mean I should enter “alarm_label” in the first “extra” field, the name of the alarm into the second one, “alarm_enabled” into the third one and then…? Then I’m out of “extra” fields. Can you please go through the fields that actually exist there and tell me what exactly to enter in each if I want to disable the next alarm called “example_label”? Basically a dummy click-by-click tutorial, please. :slight_smile:

Thanks for the clarification.

Regarding the forum - I cannot see any lag when writing from the phone either (writing on Nokia 6.1, Android 10). Anyway, I can see the point in trying to slim down features if they interfere with using the forum. I’ll look into that. The software is called Discourse, a very broadly used forum software lately (for example Samsung switched to it few weeks ago for their developer forum).
What phone/OS exactly do you have? You can PM me if you don’t want to discuss this in public.

Back to the actual topic:
See https://tasker.joaoapps.com/userguide/en/intents.html for a Tasker guide on sending intents.

So in Tasker’s send intent setup:

  • Action: com.urbandroid.sleep.alarmclock.ALARM_STATE_CHANGE
  • Extra: alarm_label:example_label
  • Extra: alarm_enabled:false
  • Package: com.urbandroid.sleep

Thanks, that works! It seems to disable the oldest alarm that was created, which is a bit weird, but I would usually have unique names anyway or loop the action multiple times.
I found this list of intents and similar API properties: https://sleep.urbandroid.org/documentation/developer-api/intents-and-content-providers/ (may be useful for others that come to this thread in the future or myself in the future)
Deleting an alarm seems to not be in it, but that’s fine for my use case.

My feature suggestion is of course still open, it would be much nicer to have it as a proper feature in the plugin that is more easily usable.

My phone is a Fairphone 2, running LineageOS 15.1 (Android 8.1). I’m using a Firefox extension called “Dark reader”, which causes all websites to have a dark theme. That slows down the initial loading of websites, but usually doesn’t have a big performance impact once it’s done loading.

Sorry to dig up an old thread, but I’m having issues getting this to work with the intent. Here’s my current set up:

I am able to use a shell command like this: am broadcast --user 0 -p com.urbandroid.sleep -a com.urbandroid.sleep.alarmclock.ALARM_STATE_CHANGE --es alarm_label fri --ez alarm_enabled false. That works just fine, so not sure what the differences are/what I am doing wrong. Any help would be appreciated.

Edit: i’m not allowed to post a second image but the package in the intent call is set to com.urbandroid.sleep and the Target is set to Broadcast Receiver