How to trigger automation based on turning off Android + iOS phone alarm?

Basically what the title states —I want to run an automation based on turning off the Android phone alarm. I can get the state of the next alarm through sensor.ac2003_next_alarm but that’s not what I want.

I’ve seen many solutions that run based on when the alarm goes off, but the issue is is that my partner snoozes a lot so running his part of the morning automation based on the set alarm time isn’t ideal. It has to run when the alarm is turned off, ie., deactivated, not snoozed.

Is this possible and if yes, how would one go about this? I’m not very familiar with Android since I personally don’t have one.

How to handle this through iPhone (as well)? I can get an iOS shortcut to run automatically when I turn off a wake-up alarm, but not sure how to go on from there, because I don’t understand the options that the HA companion app gives in the shortcuts app. What would be the best practice for this case? Have the shortcut change a sensor, and an automation that starts when that custom sensor is changed (e.g. ‘alarm switch, turned off’)? Or would that be too convoluted?

(In terms of skill-level: while I’ve got a lot of automations etc going at the moment, I’m not quite versed in the technical/YAML part of it yet, I’ve mainly used the visual editor in combination with standard options of the integrations I’ve added)

Edit: I’ve managed it through iphone: created a shortcut that, on turning off the wake-up alarm, called the service ‘input_boolean.turn_off’ on a custom helper toggle that I created. This I’ve integrated in my morning routine and as of now it seems to work. Now I only have to achieve the same, but for Android!

When the next alarm time changes then it’s turned off. At least on Android

Isn’t that changed too every time it snoozes, since it has to add 10 minutes each time ‘snooze’ is activated?

Yes probably.

So not useful in my case, haha.

But snoozing is always a fixed amount of minutes right?
So if it’s ten minutes then it’s a snooze else a turned off

But how do I check for this difference?

I’ve just now managed it through iphone: created a shortcut that, on turning off the wake-up alarm, called the service ‘input_boolean.turn_off’ on a custom helper toggle that I created. This I’ve integrated in my morning routine and as of now it seems to work. Now I only have to achieve the same, but for Android!

As I said.
If you trigger on next alarm and you have a condition about the previous state <= 11 minutes (to be safe) ago then it’s a snooze.
If it’s more than 11 minutes or current state is unavailable then it’s disabled alarm.

But on the first snooze, the previous state is also more than 11 minutes ago, right? And when turning off, the previous state is <=11 minutes ago, but that’s also the case of an in-between snooze?

No because the current state is then unavailable or more than 10 minutes ahead