Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Natzoo

macrumors 68020
Original poster
Sep 16, 2014
2,016
646
As the title states, I cant figure out how to set up an automation to turn off charging at a specific battery percentage. I am on ios 15 and just bought a wemo smart plug mini.
 
I setup one to turn charge when below 40% and stop at 85%. The way I did it was to have the plug turn on when the phone goes below 40% with one automation and another automation to turn off the plug when it reaches 85%. I probably made it more complicated then necessary but it works for me.. Forum member @Apple_Robert helped me and his help was appreciated as I haven't had much experience setting up shortcuts/automations
 
  • Like
Reactions: ElectronGuru
Can you send me a screenshot of what was. In the shortcuts app? If Apple Robert can help, I will appreciate it.
 
Automation for turning off charging plug after x percent.
 

Attachments

  • First Screen.jpeg
    First Screen.jpeg
    82.8 KB · Views: 5,793
  • Second Screen.jpeg
    Second Screen.jpeg
    93.3 KB · Views: 5,467
  • Third Screen.jpeg
    Third Screen.jpeg
    82.6 KB · Views: 5,375
No, you don't have to use the speak function.
I got it to work, thanks for your help on that! I was wondering if I could let charge to 100% in the morning, and still keep the 80% automation. Is that possible? I would like to set another automation to charge it to 95% or 100% at 6:30 am.
 
There can only be one automation sequence. But it’s so easy to change the battery percentage sliders to whatever value you want that it’s not a hassle to change it.

Just as a FYI, the ultimate state of charge to keep the battery between to impart the least stress on the battery (so it will easily outlast the useful life of the phone) is keep it between 65% and 75%.


5B9C653B-B9C7-4AC4-9D1F-4DA4FDBF4EE9.jpeg
 
There can only be one automation sequence. But it’s so easy to change the battery percentage sliders to whatever value you want that it’s not a hassle to change it.

Just as a FYI, the ultimate state of charge to keep the battery between to impart the least stress on the battery (so it will easily outlast the useful life of the phone) is keep it between 65% and 75%.


View attachment 1857734
Misleading graph. You have to account for actual energy usage.

Quick googling leads me to this page which already did the calculation. 100-25% and 85-25% are actually better for battery health. I'd guess that this is a combination of how batteries shouldn't be spending their lifetime filled up and how at least some of the charging state should be spent in a trickle mode, which happens at higher charge levels.
 
Can you send me a screenshot of what was. In the shortcuts app? If Apple Robert can help, I will appreciate it.
I guess shortcuts is a bit buggy on 15.0.1 as my automation didn't shut the charger off at 85% last night. Turned on fine but didn't turn off. It was working fine the night before, maybe after restarting the phone it will get it right next charge
 
I wish there was a way so that it could finish charging to near full at a certain time.
 
Automation for turning off charging plug after x percent.

I guess shortcuts is a bit buggy on 15.0.1 as my automation didn't shut the charger off at 85% last night. Turned on fine but didn't turn off. It was working fine the night before, maybe after restarting the phone it will get it right next charge

I played with automation in Shorcuts recently to shut off my Homekit controlled plug when the battery is at 80% - from what I have observed, the automation sometimes ignores if the trigger is set as "When battery level is 80%" thus keep on charging my phone until 100%.

I changed the trigger to "When battery level rises above 80%" and so far it always works - however interesting thing that I observe is that I expect the automation to be triggered when the battery level is at 81% (which it does most of the time), but I saw one time that the automation triggered but when the battery level was at 82%.

My speculation is that sometimes when the phone is being charged and left unused for a while, the system does not always update the battery level % by 1% increment - thus perhaps there might be a time when the battery is at 79%, the next time the system checks the battery it is already at 81%, thus ignoring the "When battery level is 80%" trigger.

With "When battery rises above XX%", seems like it is always likely for the automation to be triggered. I am not sure if this is really the case though - probably need others to confirm as well.
 
To have a safety stop, set the automation to stop when battery rises above your set level AND set another one to stop when it rises above the next higher level in case it didn’t trigger the first time.
 
I played with automation in Shorcuts recently to shut off my Homekit controlled plug when the battery is at 80% - from what I have observed, the automation sometimes ignores if the trigger is set as "When battery level is 80%" thus keep on charging my phone until 100%.

I changed the trigger to "When battery level rises above 80%" and so far it always works - however interesting thing that I observe is that I expect the automation to be triggered when the battery level is at 81% (which it does most of the time), but I saw one time that the automation triggered but when the battery level was at 82%.

My speculation is that sometimes when the phone is being charged and left unused for a while, the system does not always update the battery level % by 1% increment - thus perhaps there might be a time when the battery is at 79%, the next time the system checks the battery it is already at 81%, thus ignoring the "When battery level is 80%" trigger.

With "When battery rises above XX%", seems like it is always likely for the automation to be triggered. I am not sure if this is really the case though - probably need others to confirm as well.
I have had no issue with using “When battery level is 80%”, have not had it fail yet. One of things I do is turn on low power mode after I shut off the charger. I like putting my phone on low power mode when it goes into standby.
 
Genius!!

I wonder… could this also work using speak screen say “Alexa, turn off smart plug”?

Now I want to try it…
 
Using “Rises above” is not a 100% guarantee that the charger will stop. A couple times mine blew past it. If the shutoff set point in shortcuts app is set to shut off when the battery Rises Above 80% (for example) and the phone is plug in when the battery is at 81% (for example) the shortcuts app won’t get a trigger and will never turn off even though the battery technically has risen above 80%.

It seems that on both the low and high settings, the battery has to sweep past the setting in order for it to trigger the HomeKit app.
 
Misleading graph. You have to account for actual energy usage.

Quick googling leads me to this page which already did the calculation. 100-25% and 85-25% are actually better for battery health. I'd guess that this is a combination of how batteries shouldn't be spending their lifetime filled up and how at least some of the charging state should be spent in a trickle mode, which happens at higher charge levels.
Not to mention keeping the state of charge between 75%-65% is highly unrealistic due to how inconvenient it is for basically everyone.

I heard 20% to 80% is a good range, combined with having low power mode on all the time
 
If someone is using their device for an extended period of time next to a power outlet and plugged in, there is no reason not to use the 65% Min. 75% Max charging Shortcut. It’s the perfect range for that scenario.
 
  • Like
Reactions: thmsnt
If someone is using their device for an extended period of time next to a power outlet and plugged in, there is no reason not to use the 65% Min. 75% Max charging Shortcut. It’s the perfect range for that scenario.
65-75% is worse than like 20-80%. Did you read the article?
 
65-75% is worse than like 20-80%. Did you read the article?
They’re conclusions are wrong.
Did they do a 6 year extended duration test? No of course not. Their conclusions on that webpage are based on theoretical conjecture.

I’ve actually done a real world test over the span of 6 years with an iPhone battery - the original battery that came with the phone (iPhone 6 Plus). Over that time period (6 years) I tried my best to keep the battery SOC between 65% and 75% since I was usually near a power outlet. Sure there were times when I charged it higher and discharged it lower, but overall I’d say my SOC was kept within the range of 60% to 80% for six years.
The phone was used heavily at least 8 hours every day for 6 years.

Every battery manufacturer, including for EVs say that the farther you can keep a lithium ion battery away from 100% SOC, the better. The most relaxed state a lithium ion battery can be in is at a 40% SOC.

Also deeper discharging creates more stress on the battery than shallow (according to battery university)

Here’s the results of my 6 year test on an iPhone 6 Plus original battery:

1973 Load Cycles
96.4% Battery Health

Seems hard to believe- but it’s true (according to coconut battery)
I’ve seen the battery health % drop down to 92% when it’s cold outside)

So the take away is - if you’re near a power outlet and are plugged in all the time, if you keep the battery SOC between 65% and 75% using a Shortcut controlling a HomeKit charger - the battery will EASILY outlive the useful life of the phone by a factor of probably 3X.

8D8E9070-927B-4BB2-BCF8-CDFFD3CDA0CF.png
 
Last edited:
They’re conclusions are wrong.
Did they do a 6 year extended duration test? No of course not. Their conclusions on that webpage are based on theoretical conjecture.

I’ve actually done a real world test over the span of 6 years with an iPhone battery - the original battery that came with the phone (iPhone 6 Plus). Over that time period (6 years) I tried my best to keep the battery SOC between 65% and 75% since I was usually near a power outlet. Sure there were times when I charged it higher and discharged it lower, but overall I’d say my SOC was kept within the range of 60% to 80% for six years.
The phone was used heavily at least 8 hours every day for 6 years.

Every battery manufacturer, including for EVs say that the farther you can keep a lithium ion battery away from 100% SOC, the better. The most relaxed state a lithium ion battery can be in is at a 40% SOC.

Also deeper discharging creates more stress on the battery than shallow (according to battery university)

Here’s the results of my 6 year test on an iPhone 6 Plus original battery:

1973 Load Cycles
96.4% Battery Health

Seems hard to believe- but it’s true (according to coconut battery)
I’ve seen the battery health % drop down to 92% when it’s cold outside)

So the take away is - if you’re near a power outlet and are plugged in all the time, if you keep the battery SOC between 65% and 75% using a Shortcut controlling a HomeKit charger - the battery will EASILY outlive the useful life of the phone by a factor of probably 3X.

View attachment 1904346
That’s very interesting if coconutbattery is accurate enough to be believed. Personally I’ve used it to check my iPhone 6S and it had about the same cycle count as you but around 72% battery health, while the Settings app said 76%. What makes me doubt it’s accuracy is when I checked again a few days later coconutBattery showed the battery health was less than 30%?? ?

But either way I’ll take your word for it, it’s just that always keeping it charged between 65-75% doesn’t seem realistic for me or most people for that matter. I actually like to at least use my phone to do stuff on the go.
 
That’s very interesting if coconutbattery is accurate enough to be believed. Personally I’ve used it to check my iPhone 6S and it had about the same cycle count as you but around 72% battery health, while the Settings app said 76%. What makes me doubt it’s accuracy is when I checked again a few days later coconutBattery showed the battery health was less than 30%?? ?
Yeah. I won’t go as far as to say coconutBattery is inaccurate. However, how/what source it uses to pull battery info is clearly not a great one. It may be the only thing third-party apps have access to. The best way to estimate is using coconutBattery to see full charge cycles and calculate the health based on the average measured usage before reaching 80% (e.g., 500 cycles on iPhones).



Obviously, the calculation is not exact, though good enough. You should not be judging your device’s viability based on some (estimated) calculated number. And as far as official battery replacement… Apple is going to rely on their own algorithm/test — so, what you see in coconutBattery and the like is useless for argument’s sake.

=====

As for the perfect charge routine… There really isn’t one. Keeping the battery at 50% is technically the least stressing. It’s also not great to leave the cells stagnant for very long periods — batteries have “shelf life” for a reason. Furthermore, never doing a complete cycle in one sweep throws off the calibration. It doesn’t so much as hurt the battery, but does prevent the microcontrollers responsible for monitoring from knowing the actual lows and highs thus requiring a lot of estimation. I believe, that’s also why some people have seen multiple percent battery health drops when doing an OS update/upgrade — the system is trying to re-estimate the shutoff and safe maximum charge levels.

My iPhone X is 4 years, 3 days old (1464 days since I received it) — not the duration from manufacture date. The OS currently reports the battery health at 84%. This is the coconutBattery log:

coconutBattery_iPhone-X_2021-09-13.png

My charging habit… 0-100% and 100-0% as often as possible — OCPD and I like to maintain calibration. By the way, obviously, 0% in the status bar is not actually no or very low charge. Some people guess Apple leaves ~10% at the auto-shut down point to protect the battery from ultra low voltage, extend Find My location reporting, and provide those helpful icons/displays for low battery/connect to charger.
:)
 
  • Like
Reactions: now i see it
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.