Interval Check for battery life?

Hi, I'm trying to create a macro that checks for battery level every 30 minutes from 12pm and onward. Once screen off, cancel this action. Wait till the following 12pm to trigger the interval check again. So far I have something like this, it kinda works, but doesn't do exactly what I wanted. Just wondering if someone can share their ideas? Thanks!

 

Attachments

  • sleep.macro
    3.8 KB · Views: 1

dhj49er

Well-known member
Hi, I'm trying to create a macro that checks for battery level every 30 minutes from 12pm and onward. Once screen off, cancel this action. Wait till the following 12pm to trigger the interval check again. So far I have something like this, it kinda works, but doesn't do exactly what I wanted. Just wondering if someone can share their ideas? Thanks!

Not quite sure of the sequence of events.
Is the screen on when the hourly time triggers fire?
If not what turns on the screen, as the sleep macro turns screen off?
Do you want the clear ram macro to run once after 12pm when battery level is <30 or afterwards on the hour (as per your macro) or every 30m as you say you require?

On a side note why are you clearing the ram?

These days the Android memory management is quite good and frequent clearing of ram can lead to increased battery consumption, as some of the closed apps will auto restart in the background.
 
Not quite sure of the sequence of events.
Is the screen on when the hourly time triggers fire?
If not what turns on the screen, as the sleep macro turns screen off?
Do you want the clear ram macro to run once after 12pm when battery level is <30 or afterwards on the hour (as per your macro) or every 30m as you say you require?

On a side note why are you clearing the ram?

These days the Android memory management is quite good and frequent clearing of ram can lead to increased battery consumption, as some of the closed apps will auto restart in the background.
Screen is ON when the the time hits 12PM everyday.

So time at 12PM will be the trigger. The action will then check once every 30 minutes to see if the battery level <30%, If so, screen OFF. Else, check again after 30 minutes.

It should stop checking either if screen off or time is now 8AM, but it will check again the nexy day at 12PM.

It's interesting what you explained about the ram macro, I guess I will leave it out since the goal of this entire script is to ensure my phone still has some battery left when I wake up in case I forget to charge. Let me know if that make sense, thanks!
 

dhj49er

Well-known member
Screen is ON when the the time hits 12PM everyday.

So time at 12PM will be the trigger. The action will then check once every 30 minutes to see if the battery level <30%, If so, screen OFF. Else, check again after 30 minutes.

It should stop checking either if screen off or time is now 8AM, but it will check again the nexy day at 12PM.

It's interesting what you explained about the ram macro, I guess I will leave it out since the goal of this entire script is to ensure my phone still has some battery left when I wake up in case I forget to charge. Let me know if that make sense, thanks!
Just to make sure I have the correct understanding.

At 12pm the screen is on and stays on until the sleep macro turns it off when the battery level is <30.

Is that correct?

If so, the screen could be on for hours, consuming lots of battery.

I'm sorry, but it doesn't seem to make sense.
 
Not quite sure of the sequence of events.
Is the screen on when the hourly time triggers fire?
If not what turns on the screen, as the sleep macro turns screen off?
Do you want the clear ram macro to run once after 12pm when battery level is <30 or afterwards on the hour (as per your macro) or every 30m as you say you require?

On a side note why are you clearing the ram?

These days the Android memory management is quite good and frequent clearing of ram can lead to increased battery consumption, as some of the closed apps will auto restart in the background.
I think I just had an idea, now I just need a way to make the macro "Screen OFF when Low Battery" run once every 30 minutes.
 

Attachments

  • Screenshot_2024-04-16-12-07-54-25_2e840d222d67ef3caca3a1c67d71d48f.jpg
    Screenshot_2024-04-16-12-07-54-25_2e840d222d67ef3caca3a1c67d71d48f.jpg
    645.1 KB · Views: 4
  • Screenshot_2024-04-16-12-07-09-02_2e840d222d67ef3caca3a1c67d71d48f.jpg
    Screenshot_2024-04-16-12-07-09-02_2e840d222d67ef3caca3a1c67d71d48f.jpg
    433.1 KB · Views: 4
Just to make sure I have the correct understanding.

At 12pm the screen is on and stays on until the sleep macro turns it off when the battery level is <30.

Is that correct?

If so, the screen could be on for hours, consuming lots of battery.

I'm sorry, but it doesn't seem to make sense.
yea, I intend to keep it on as long as I can since I usually leave video playing before sleep, but I usually just fall asleep, so when I wake up, I need to recharge from 0.
 

dhj49er

Well-known member
It's 12am not 12pm.

The screenshot is a macro that should turn off the screen when the battery drop to below 30%.
 

Attachments

  • Screenshot_20240416_172553_MacroDroid.jpg
    Screenshot_20240416_172553_MacroDroid.jpg
    308 KB · Views: 2

Dm114

Well-known member
Hi, I'm trying to create a macro that checks for battery level every 30 minutes from 12pm and onward. Once screen off, cancel this action. Wait till the following 12pm to trigger the interval check again. So far I have something like this, it kinda works, but doesn't do exactly what I wanted. Just wondering if someone can share their ideas? Thanks!

You can simplify your triggers :
20240416_123716.jpg
 
Last edited:

dhj49er

Well-known member
I've updated my macro and attached a screenshot. By adding the screen on constraint means the macro will only run once providing it turns off the screen (which it does). Manually turning off the screen will prevent the macro running.
Whilst this macro doesn't do the hourly check it will switch the screen off when the battery level drops.
 

Attachments

  • Screenshot_20240416_183335_MacroDroid.jpg
    Screenshot_20240416_183335_MacroDroid.jpg
    254.1 KB · Views: 8
Top