Is There a Way To...

DrumsXO

New member
cancel a Macro's actions if a specified Application was launched within a specified period of time prior to the Macro's trigger being fired?

Here's the backstory.

I'm a Type 1 Diabetic, and I use the Freestyle Libre 2 CGM (Continuous Glucose Monitor). The app for these sensors is absolutely terrible.
  • You can't change the tone played for the 4 different alerts, so you can't differentiate the alerts without looking at your phone.
  • The tone they play is a very sharp, shrill triple beep melody that hurts the ears.
  • The app changes your phone's media volume to 100% when it alerts, regardless of previous setting, vibrate mode, do not disturb...
  • You cannot customize the frequency of the alerts, so they can repeatedly trigger if your blood sugar wiggles in and out of a trigger zone.
  • I can go on, but it isn't important. You get the idea.
I use Macro Droid the rectify this.
  • Immediately reduce the media volume on my phone to 0% as soon as a notification from the app comes in matching 1 of 4 keywords.
  • Wait 40 seconds to ensure the annoying triple beep tone has stopped playing...
  • Select custom tones for each of the 4 different alerts so I can differentiate the alerts without looking at my phone.
  • Raise my phone's media volume to a reasonable level, play the custom tone, then turn the volume back down.
  • Set an alarm on my phone for 5 minutes in case I didn't hear the alert go off.
  • Use constraints to prevent alerts during the night aside from severe low blood sugar.
  • Use constraints to prevent repeat alerts by using the "Not Invoked For Xh Xm Xs" feature.
It works amazing. It's a shame I have to go to all of this trouble just to make these sensors usable (in my opinion), but it is what it is, I guess.

The issue that I'm trying to eliminate is that if I open the app on my own and scan my sensor, and let's say my blood sugar level is at 95. At 90, it will trigger a low glucose alert. So, if I have the app open and scan the sensor and see a 95, I'm going to have some sugar... 5 minutes later the sensor reads 90, and triggers an alert. I don't need it! I already know, and have already taken care of it! Thanks for doing your job, but I'm good!

I thought I had remedied this by creating a separate macro that would trigger an empty action whenever I opened the app for the sensor. Then I added a constraint into my other macros that would prevent them from running if that new macro I made had been run within the last 20 minutes. However, it didn't go according to plan because it would then prevent the macros from doing anything at all, including turning down the media volume when the app sends an alert, so I would get my ears stabbed to death by the damn triple beep tone again!

I need a way, if it can be done, to prevent the macros from running if I've had the sensor app open in the last 20 minutes. But, I still need the macros to at least turn the media volume back down to zero so I don't have to hear that god awful triple beep tone!

For example, the Low Blood Sugar Alert.
  • Trigger: Notification received from the Libre 2 app containing the word "Low."
  • Action: Media volume = 0%
  • If Clause 1: Device unlocked
    • If Clause 1A: "Libre 2 Launch Detect Macro" not invoked for 15m
    • If Clause 1B: This Macro not invoked for 30m
    • If Clause 1C: "Libre 2 Urgent Low" not invoked for 30m
      • Action: Floating text "Scan your sensor!"
  • If Clause 2: Device locked
    • If Clause 2A: "Libre 2 Launch Detect Macro" not invoked for 15m
    • If Clause 2B: This Macro not invoked for 30m
    • If Clause 2C: "Libre 2 Urgent Low" not invoked for 30m
      • Action: Wait 40 seconds
      • Action: Media volume 100%
      • Action: Wait 3 seconds
      • Action: Play: Signal (just the tone I chose from my phone's sound files)
      • Action: Wait 1 second
      • Action: Play: Signal
      • Action: Wait 3 seconds
      • Action: Media volume 0%
      • Action: Wait 3 seconds
      • Action: Set Alarm for five minutes
  • Constraint: Time of Day 07:30 - 21:00
Screenshot_20230315-211613_MacroDroid.jpg

Screenshot_20230315-211638_MacroDroid.jpg

I have three more of these that are very similar in nature for the high blood sugar alert, the urgent low blood sugar alert, and the scan sensor alert (triggers 2 hours after a scan of the sensor as per the app's settings). Hopefully everything works.
 
Last edited:

JA-Translator

Moderator
It's possible to NOT trigger a macro with the constraint "not triggered within the spesific time".
(instead of "cancel the macro")

Is this helful for what you want?

Screenshot_20230316-001749_MacroDroid.png
 

DrumsXO

New member
It's possible to NOT trigger a macro with the constraint "not triggered within the spesific time".
(instead of "cancel the macro")

Is this helful for what you want?

View attachment 4883
Kind of... I updated the original post to elaborate quite a bit. There's a lot of information there, but it might help to explain exactly what it is that I'm trying to do here, to better help me try and get to the bottom of it.
 

DrumsXO

New member
It's possible to NOT trigger a macro with the constraint "not triggered within the spesific time".
(instead of "cancel the macro")

Is this helful for what you want?

View attachment 4883
I do believe I found my solution. Check the original post. There's information that's hidden behind spoiler tags to keep the size of the post small unless you expand it yourself. There may or may not be an easier way to do it, but this is what I was able to come up with on my own. It's a shame that I had to go through all of the just to get this sensor app to be usable... Having no customization in the app from the developer is just absurd to me, especially since the volume on the tone that the app uses is deafening. I can't imagine if I worked in an office building or something and didn't know about using Macro Droid to make the changes that I have... Sitting in my cubicle, surrounded by coworkers in theirs and all of a sudden my phone is screaming BEE DO BEEP! BEE DO BEEP! BEE DO BEEP! at the top of its lungs until I can get it out of my pocket and open the Libre 2 app...
 

JA-Translator

Moderator
I can't be sure exactly how you would like to do some actions.
(Sorry, I am not a native English speaker)

I hope this can be a help to find a better Macro solution.

How about this?

You can add a constraint under Action or Trigger.

Screenshot_20230316_114929.png

Screenshot_20230316_115134.png
 

DrumsXO

New member
I can't be sure exactly how you would like to do some actions.
(Sorry, I am not a native English speaker)

I hope this can be a help to find a better Macro solution.

How about this?

You can add a constraint under Action or Trigger.
That's basically what I set up, just in a slightly different way. It seems to be working!
 

DrumsXO

New member
This macro is for high blood sugar. I have one for low blood sugar, urgent low blood sugar, and a general scan reminder that the app triggers every 2 hours. There are if/else put in them all that prevent them from doing anything other than muting the volume if that macro, or other chosen macros were triggered within certain time frames.

So, we had the same idea here; just different approaches.
 

Attachments

  • Screenshot_20230316-102324_MacroDroid.jpg
    Screenshot_20230316-102324_MacroDroid.jpg
    1.8 MB · Views: 10
Top