Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a known URL for Charging Optimization? #52

Open
WaitingForGuacamole opened this issue Sep 23, 2023 · 28 comments
Open

Is there a known URL for Charging Optimization? #52

WaitingForGuacamole opened this issue Sep 23, 2023 · 28 comments

Comments

@WaitingForGuacamole
Copy link

I'm trying to get to the Charging Optimization page under Battery -> Battery Health & Charging. I've tried the following:

prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH, and that gets me to the Battery Health page - great start. To try to go deeper, I've tried

prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Charging%20Optimization
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/CHARGING_OPTIMIZATION
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH#Charging%20Optimization
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH#CHARGING_OPTIMIZATION
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH#Charging
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH#CHARGING

Has anyone had success with this?

@THX723
Copy link

THX723 commented Sep 24, 2023

Also very interested in this and have tried various combinations without success.

@rodalpho
Copy link

Came here looking for the same thing, and tried many of the same URLs as the first poster.

@marcodestefano
Copy link

marcodestefano commented Sep 27, 2023

Also tried:

prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED_CHARGE
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED_CHARGING
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZATION
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED%20CHARGE
prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED%20CHARGING

But didn’t work either

@colin273
Copy link
Member

colin273 commented Sep 27, 2023

This seems to work, but only when my device language is US English: prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH#Optimized%20Battery%20Charging

@atnbueno
Copy link
Contributor

prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH#Optimized%20Battery%20Charging works as-is in my Spanish iPhone

@WaitingForGuacamole
Copy link
Author

That does not work for me, still takes me to the Battery Health & Charging page, not the Charging Optimization page.

image

NOTE: that is %20, not %2O in the screenshot

@colin273
Copy link
Member

Is that a separate page on your device? For me, "Optimize Battery Charging" is a single switch on the Battery Health page.

Settings: Battery Health & Charging

@THX723
Copy link

THX723 commented Sep 27, 2023

@colin273 I'm guessing you have the iPhone 15 (non-Pro)?
'Charging Optimization' screen is only available for the 15 Pro

image

@WaitingForGuacamole
Copy link
Author

Yeah, it's a subpage that shows three options, one for optimized battery charging, one for the 80% limit, one for none. that's why I want this so bad, it's yet another level of setting.

I have a iPhone 15 Pro.

@colin273
Copy link
Member

colin273 commented Sep 27, 2023

I have an SE 2020 (hence the notchless status bar). That explains why I don't see the page.

I've looked around in system files, but so far I've come up empty. The search manifests don't seem to contain any useful information, and the battery settings bundle and its binary aren't much help either.

Edit: the key for the "Optimized Charging" string in the relevant loctable is CHARGING_TITLE. I have no idea whether that's useful.

@WaitingForGuacamole
Copy link
Author

Certainly appreciate you taking a look around for us!

@ShakataGaNai
Copy link

prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH#Optimized%20Battery%20Charging

Does not work (iPhone 15 Pro Max, USA, iOS 17.0.2). Copied exactly as shown here on github and the shortcut drops you in one step short of "Charging Optimization" screen. https://www.youtube.com/shorts/rWbW6XgCUF8

@colin273
Copy link
Member

The URL I sent earlier takes me directly to the "Optimize Battery Charging" switch in my settings. The path to the "Charging Optimization" page, and even the bar to access it on the Battery Health page, is almost certainly different for iPhone 15 Pro models, since it's effectively a different settings item that just happens to generally control the same thing.

@rodalpho
Copy link

That URL definitely does not work on iPhone 15 pro, unfortunately.

@marcodestefano
Copy link

Based on all other setting urls, I’d find weird to have one url that is working depending on the language set in the phone

@samuelgrf
Copy link

The optimized charging setting is also available on the regular iPhone 15, at least on iOS 17.

Unfortunately the posted link doesn’t work on it either. I tried:

prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH%23Optimized%20Battery%20Charging

both with Region and language set to USA/English US.

@chrisharper22
Copy link

So, I'm doing some digging behind this. I'll try to explain this in some terms that will simplify this.

  • A PSSpecifier is an item (button, label, switch, groups, etc.) in Settings
  • Each specifier has an identifier tag.

It seems like the URLs are based on the identifiers of the nested specifiers. So, it turns out Optimized Charging on non-iPhone 15 devices is indeed Optimized Battery Charging which is why it works on said devices. I'm thinking that at runtime, the view loads and checks whether if it is a iPhone 15 model, and then picks which specifier to use. This means its identifier is possibly different for iPhone 15 models.

@chrisharper22
Copy link

Tried these so far... nothing.

  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Battery%20Optimization%20Mode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Battery%20Optimization
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/batteryChargingMode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/batteryMode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/batteryOptimizationMode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BatteryOptimizationMode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_CHARGING_MODE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_MODE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_OPTIMIZATION_GROUP
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_OPTIMIZATION_MODE_GROUP
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_OPTIMIZATION_MODE_SPEC
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_OPTIMIZATION_MODE_TITLE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_OPTIMIZATION_MODE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_OPTIMIZATION_SPEC
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_OPTIMIZATION_TITLE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/BATTERY_OPTIMIZATION
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/MODE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Optimized%20Battery%20Charging%20Mode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Optimized%20Battery%20Charging
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/optimizedChargingGroup
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/optimizedChargingTitle
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/optimizedCharging
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED_CHARGING_GROUP_ID
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED_CHARGING_GROUP
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED_CHARGING_SPEC
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED_CHARGING_TITLE_ID
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/OPTIMIZED_CHARGING_TITLE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Smart%20Battery%20Charging%20Mode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Smart%20Battery%20Mode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Smart%20Charging%20Mode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Smart%20Optimization%20Mode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/Smart%20Optimization
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/smartBatteryMode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/smartBattery
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/smartChargingGroup
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/smartChargingMode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/smartOptimizationMode
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/smartOptimization
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_CHARGING_GROUP
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_CHARGING_ID
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_CHARGING_MODE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_CHARGING_SPEC
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_CHARGING_TITLE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_CHARGING
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_GROUP_ID
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_GROUP
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_MODE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_SPEC
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY_TITLE_ID
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_BATTERY
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING_GROUP_ID
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING_GROUP
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING_ID
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING_MODE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING_SPEC
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING_TITLE_ID
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING_TITLE_SPEC
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING_TITLE
  • prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH/SMART_CHARGING

@mercuryLuz
Copy link

mercuryLuz commented Mar 18, 2024

With iOS 17.4 (which restructured the "Battery Health"/"Charging Optimization" menus) and iPhone 15 Pro (or potentially any future models) supporting the 80% Limit, I found with some trial and error (and thanks to the previous work by commenters such as @colin273 & @chrisharper22 ) that this URL directly opens the menu "Battery > Charging Optimization" (at least with system language set to EN-US):
prefs:root=BATTERY_USAGE&path=CHARGING_TITLE

It's better than nothing when trying to quickly enable/disable the 80% Limit via Shortcuts...
Is there any way to extend this URL to also directly select one of the three available options within this menu?

@kamui
Copy link

kamui commented May 22, 2024

CHARGING_TITLE doesn't work on iPadOS, but this does: prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH_TITLE

@rushitshukl
Copy link

I am on iOS 17.5.1 with an iPhone 14 and this URL is working perfectly! Finally found it, thanks!!

@chrisharper22
Copy link

Is there any way to extend this URL to also directly select one of the three available options within this menu?

As of right now, Apple prevents this behavior with Shortcuts, most likely from downloaded Shortcuts from changing system settings without acknowledgement.

@mattbroussard
Copy link

mattbroussard commented Sep 24, 2024

Sadly CHARGING_TITLE does not seem to work for me on iOS 18.0 + iPhone 16 Pro

@Write
Copy link

Write commented Sep 27, 2024

Sadly CHARGING_TITLE does not seem to work for me on iOS 18.0 + iPhone 16 Pro

Found it !

prefs:root=BATTERY_USAGE&path=CHARGING_OPTIONS_IDENTIFIER

Shortcut for the lazy : https://www.icloud.com/shortcuts/f48d78ffcb2b400182656cccc36f63b8

@XOKP
Copy link

XOKP commented Sep 27, 2024

Sadly CHARGING_TITLE does not seem to work for me on iOS 18.0 + iPhone 16 Pro

Found it !

prefs:root=BATTERY_USAGE&path=CHARGING_OPTIONS_IDENTIFIER

Shortcut for the lazy : https://www.icloud.com/shortcuts/f48d78ffcb2b400182656cccc36f63b8

I've been searching for this, and it's absolutely perfect!

@Write
Copy link

Write commented Sep 27, 2024

And for anyone that may help, I did it w/ the help of the script I did for finding health deeplinks :

https://www.reddit.com/r/shortcuts/comments/1e4uk9z/all_health_related_xapplehealth_deeplink_available/

And replaced all "health" occurrences with "battery". That gave me a file on the desktop after one or two hours (maybe more, didn't check).

So basically this :

#!/bin/bash

# Change to the mounted filesystem root
cd /Volumes/CrystalBSeed22B5054e.D94DeveloperOS

# Output file
output_file=~/Desktop/battery_data.txt > "$output_file"

# Function to process plist files
function process_plist() {
	echo "Processing plist file: $1"
	plutil -p "$1" 2>/dev/null | grep -i 'battery' >> "$output_file"
}

# Function to process json files
function process_json() {
	echo "Processing json file: $1"
	cat "$1" | grep -i 'battery' >> "$output_file"
}

# Function to process txt files
function process_txt() {
	echo "Processing txt file: $1"
	grep -i 'battery' "$1" >> "$output_file"
}

# Function to process general files
function process_strings() {
	echo "Processing general file: $1"
	strings "$1" | grep -i 'battery' >> "$output_file"
}

# Export the functions for use in find's exec
export -f process_plist
export -f process_json
export -f process_txt
export -f process_strings
export output_file

# Find and process .plist files
find . -name "*.plist" -exec bash -c 'process_plist "$0"' {} \;

# Find and process .json files
find . -name "*.json" -exec bash -c 'process_json "$0"' {} \;

# Find and process .txt files
find . -name "*.txt" -exec bash -c 'process_txt "$0"' {} \;

# Find and process other files
find . -type f ! -name "*.plist" ! -name "*.json" ! -name "*.txt" -exec bash -c 'process_strings "$0"' {} \;

echo "Battery-related strings have been saved to $output_file"

@VladBcu
Copy link

VladBcu commented Oct 9, 2024

Awesome!! Mega thanks!

@ahrendsen
Copy link

Hi @WaitingForGuacamole,

There have been a number of responses that have been offered for many different versions of iOS. Can you try some of them to see if they work for you, then close this issue if they do? Just trying to do my part to keep this awesome resource tidy and up-to-date.

Thanks,
Karl

ahrendsen added a commit to ahrendsen/ios-settings-urls that referenced this issue Dec 7, 2024
Added contributions that were hidden in the "Issues" tab.

A few battery settings (FifiTheBulldog#52) and an iCloud Mail Rules Setting (Issue FifiTheBulldog#78)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests