Alarm clock Trigger

Post your questions and help other users.

Moderator: Martin

Post Reply
SGET
Posts: 3
Joined: 10 Nov 2017 21:15

Alarm clock Trigger

Post by SGET » 11 Nov 2017 05:34

Hello,

is it possible to get the status of the alarm clock. I will trigger if a special alarm clock is enabled or or not. I have a Samsung Galaxy and I have two different alarms. One for the normal work week and one for special things which I use sporadic. I will trigger on the status of the alarm for the normal work week.

Has anyone an idea?

Thanks in advance for your help!

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Alarm clock Trigger

Post by Desmanto » 11 Nov 2017 17:21

Is it trigger for the special or normal? (confused with your contradicting statement)
If it is regular, why don't just use Trigger : Time? Set the time to be the same as the alarm.

If it is special, you have to retrieve the data from the app which set the alarm. Usually it will set the value for the next alarm (trigger).
If it is not there, you should give Automagic write secure setting permission in PC through adb.
And then you can query the value for next_alarm_formatted in setting database - System.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

SGET
Posts: 3
Joined: 10 Nov 2017 21:15

Re: Alarm clock Trigger

Post by SGET » 11 Nov 2017 21:04

Sorry for the confusion :-).

I have one alarm in my standard samsung alarm clock for my work under the week and one for special things for work when I have to wake up at another time. I will trigger the on off status of these two alarms. Could I do that with the standard triggers or do I have to make a script? I am new in this topic ( android deep programming and al these things ) but I have many experience in other software things. So please excuse if I ask more than twice to your answers.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Alarm clock Trigger

Post by Desmanto » 13 Nov 2017 08:05

So you want to detect if the regular or special alarm is active, then do something. The value next_alarm seems to provide only value for the next alarm only, but can't detect any status of the alarm.

The workaround is you have to create the alarm in automagic. I also use double alarm, one from android and another one from automagic (to make sure I really wake up). Use Time Trigger, notification and some Message Dialog/Confirmation Dialog. If you use confirm dialog, you can choose to snooze 5 minutes or stop the alarm. From there you can use script to set some Global variable to a state. Example global_regular_alarm = 1 or 0 if the alarm is off.

Then use Trigger Global Variable to check the state of the global_regular_alarm and do something when it changes.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply