Adding 24 hour clock input to an alarm setting macro

Lewis8973

New member
Hey,

I am trying to create a macro that will create an initial alarm, and then 3 more alarms 5 minutes apart.

I have done the best I can, and have managed to make it so I can put the amount of minutes in a user prompt/popup, which sets variables with 0, 5, 10 and 15 minutes added. 4 alarms are then set from each variable. See the screenshot.

However inputting the minutes is not user friendly for several hours.

I've tried figuring out how I can insert a specific time (e.g. 09:00 or 18:00 - 24 hour clock) and then this is used to set the alarm, but I'm stuck, and there's no similar macro on the templates/public library.

Any help in figuring this out is appriciated :)
 

Attachments

  • Screenshot_20240403_140853_MacroDroid.jpg
    Screenshot_20240403_140853_MacroDroid.jpg
    720.4 KB · Views: 10
  • Screenshot_20240403_140911_MacroDroid.jpg
    Screenshot_20240403_140911_MacroDroid.jpg
    162.3 KB · Views: 9

Dm114

Well-known member
Hey,

I am trying to create a macro that will create an initial alarm, and then 3 more alarms 5 minutes apart.

I have done the best I can, and have managed to make it so I can put the amount of minutes in a user prompt/popup, which sets variables with 0, 5, 10 and 15 minutes added. 4 alarms are then set from each variable. See the screenshot.

However inputting the minutes is not user friendly for several hours.

I've tried figuring out how I can insert a specific time (e.g. 09:00 or 18:00 - 24 hour clock) and then this is used to set the alarm, but I'm stuck, and there's no similar macro on the templates/public library.

Any help in figuring this out is appriciated :)
Why wouldn't you set these multiple alarms in a n-times loop with an increment of +5?

Something like this:
A: Set Minutes (user prompt)
A: n=0
A: Do loop 4 times
A: IF n=0 set String="Minutes..." ELSE set String="Additional alarm "[lv=n]" minutes ENDIF
A: Set alarm to Minutes (with additional text [lv=String])
A: Wait 2 seconds (not sure it is mandatory in this case)
A: n=n+5
A: Loop
 

RSF

Well-known member
However inputting the minutes is not user friendly for several hours.

I've tried figuring out how I can insert a specific time (e.g. 09:00 or 18:00 - 24 hour clock) and then this is used to set the alarm, but I'm stuck, and there's no similar macro on the templates/public library.
Something like the attached could work to prompt for your minutes-until-alarm value, allowing both a straight number of minutes, or a time in the form of HH:MM. It calculates the number of minutes until that time, if it sees that the time value has an embedded colon. It's pretty basic, but you could extend it to work across day boundaries etc. if you want (right now, the time has to be within the same day, and later than the current time).
 

Attachments

  • Prompt_for_time.macro
    14.5 KB · Views: 4

Dimlos

Well-known member
I have created a sample macro using JavaScript and TurboAlarm.
It does not support date crossing, but time crossing works.

 

Attachments

  • macro.jpg
    macro.jpg
    701.7 KB · Views: 3
  • turboalarm.jpg
    turboalarm.jpg
    361.6 KB · Views: 3
  • Set_Alarm.macro
    8 KB · Views: 0

Dm114

Well-known member
I have created a sample macro using JavaScript and TurboAlarm.
It does not support date crossing, but time crossing works.

Sorry but I don't understand the interest in writing routines in another language (JavaScript) whereas MD does the job much more simply. Moreover you promote a 3rd app (Turbo Alarm) whereas standard Alarm app, fully compatible with MD, also does the job...
 

Dimlos

Well-known member
Maybe I just don't know, but it seems that MacroDroid does not allow setting alarms with fixed time variables.
I used JavaScript because it is easy to write "+5 minutes" with fixed time without using UNIX time.
Since MacroDroid controls alarms by intent, I used an application that supports plug-ins because the behavior varies depending on the implementation of the receiver.
 

Dm114

Well-known member
Maybe I just don't know, but it seems that MacroDroid does not allow setting alarms with fixed time variables.
I used JavaScript because it is easy to write "+5 minutes" with fixed time without using UNIX time.
Since MacroDroid controls alarms by intent, I used an application that supports plug-ins because the behavior varies depending on the implementation of the receiver.
I've been using a very simple macro for years that does similar stuff like a charm...
 

Dimlos

Well-known member
When using Google's clock app to control from MacroDroid, repeated alarms cannot be removed.
I don't like that uncertainty, so I use the plugin controls.
I guess it depends on what is best for each person, but control by intent is not perfect.

I think it is good to have different opinions.
It is up to the user to choose what is best for them.
 
Top