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

magneeto

Suspended
Original poster
Oct 27, 2020
160
19
Hi Guys,

i am looking to have a shortcut on n my iPad which would do the following. when I keep my iPad on charging and when the battery gets 98% charged it runs and alarm ( Custom Alarm) can someone help me with such a shortcut. I am looking out for someone who can make it for me and send it to me ?

Anyone willing to help ?

Thanks
 

Puonti

macrumors 68000
Mar 14, 2011
1,567
1,187
You can do this with a Shortcut automation. As far as I can tell those can't be shared, so the best I can do is give you instructions:

1. Copy your custom soundfile (WAV for example) to the /Shortcuts/ folder in your iCloud drive

2. Open Shortcuts and go to the Automation page. Create new automation by tapping the + sign in the top right corner of the screen. Choose "Personal automation"

3. Scroll to the bottom of the list and choose "Battery Level". Use the slider and options to set it up as "Rises above 95%" (unless "Equals 100%" is better for you - you can't get 98%)

4. Tap "Add action" and search for "Get file". Tap it in the results list to add it. Disable "Show document picker", then tap "File path" and after "/shortcuts/" enter the name of your sound file

5. Tap the blue button with "+" and search for "Play sound". Tap it in the results list to add it

6. Tap "Next" in the top right corner of the screen. Disable "Ask before running"

7. Tap "Done" and test!
 

magneeto

Suspended
Original poster
Oct 27, 2020
160
19
You can do this with a Shortcut automation. As far as I can tell those can't be shared, so the best I can do is give you instructions:

1. Copy your custom soundfile (WAV for example) to the /Shortcuts/ folder in your iCloud drive

2. Open Shortcuts and go to the Automation page. Create new automation by tapping the + sign in the top right corner of the screen. Choose "Personal automation"

3. Scroll to the bottom of the list and choose "Battery Level". Use the slider and options to set it up as "Rises above 95%" (unless "Equals 100%" is better for you - you can't get 98%)

4. Tap "Add action" and search for "Get file". Tap it in the results list to add it. Disable "Show document picker", then tap "File path" and after "/shortcuts/" enter the name of your sound file

5. Tap the blue button with "+" and search for "Play sound". Tap it in the results list to add it

6. Tap "Next" in the top right corner of the screen. Disable "Ask before running"

7. Tap "Done" and test!

Thanks for the step by step description. I wanted to ask you. My main objective of having this shorrtcut is when on charging my battery is charged more than 95% it should ring an alaram (The Audio File that I add to the shortcut) now my question to you is when I keep my iPad for chargjng it is not connected to the internet and since I use an Apple Smart Cover on it. It is Auto-Locked (Sleep Mode) when the smart cover is on the device.

So my question to you is will the shortcut run if the device is not connected to the Internet and it is Auto-Locked (Sleep Mode) with the Apple Smart Cover on it ?

Does the device needs to be awake and be connected to the Internet for the shortcut to run ?
 

Puonti

macrumors 68000
Mar 14, 2011
1,567
1,187
So my question to you is will the shortcut run if the device is not connected to the Internet and it is Auto-Locked (Sleep Mode) with the Apple Smart Cover on it ?

Does the device needs to be awake and be connected to the Internet for the shortcut to run ?
Based on my limited testing with Airplane mode you don't need to be connected to the internet for this to work. The device can also be sleeping (locked), as long as it's powered (so opening the cover lights up the screen).

There appears to be some variance in how soon after reaching the desired charge level the device will react, but I don't know what the contributing factors are. You should test this on your own device to make sure the performance meets your needs.
 

magneeto

Suspended
Original poster
Oct 27, 2020
160
19
Based on my limited testing with Airplane mode you don't need to be connected to the internet for this to work. The device can also be sleeping (locked), as long as it's powered (so opening the cover lights up the screen).

There appears to be some variance in how soon after reaching the desired charge level the device will react, but I don't know what the contributing factors are. You should test this on your own device to make sure the performance meets your needs.

So I tested and tried this ! I had kept the condition in shortcut as when my battery charging exceeds 95% it should play the alarm and it did not. The background condition was the same it was on chargjng and it was not connected to the Internet and it was in sleep mode because of the Apple Smart Cover on it.

What could be the reason it did not.play the alarm and did not run the shortcut ?
 
Last edited:

Puonti

macrumors 68000
Mar 14, 2011
1,567
1,187
Can you post screenshots of the "edit Automation" and "Actions" ("Do") screens?
 

magneeto

Suspended
Original poster
Oct 27, 2020
160
19
Can you post screenshots of the "edit Automation" and "Actions" ("Do") screens?

Hello !

Attached are the screenshots.
 

Attachments

  • 2EE3950C-0670-4E51-8D48-46B6D67894E6.png
    2EE3950C-0670-4E51-8D48-46B6D67894E6.png
    1.5 MB · Views: 423
  • 88DC5D4F-D232-41D9-94F1-305E4278AFE2.png
    88DC5D4F-D232-41D9-94F1-305E4278AFE2.png
    1.5 MB · Views: 428

Puonti

macrumors 68000
Mar 14, 2011
1,567
1,187
@magneeto If you open the Files app on the same iPad and navigate to the "Shortcuts" folder in iCloud Drive, is the soundfile listed there with a small blue cloud icon with an arrow pointing down on the same line? If yes, tap that icon to make sure the soundfile is downloaded to the device, then try again.
 

magneeto

Suspended
Original poster
Oct 27, 2020
160
19
@magneeto If you open the Files app on the same iPad and navigate to the "Shortcuts" folder in iCloud Drive, is the soundfile listed there with a small blue cloud icon with an arrow pointing down on the same line? If yes, tap that icon to make sure the soundfile is downloaded to the device, then try again.
No man ! There is no arrow putting downwards on the Audio File that I am using. Attached is the screenshot confirming that.

Hey Man ! You said you cannot post Shortcut links here can you also not directly PM me the Shortcut ?
 

Attachments

  • 89C41CF4-35BB-4508-A8C2-49C403F3AC8B.jpeg
    89C41CF4-35BB-4508-A8C2-49C403F3AC8B.jpeg
    73 KB · Views: 207

Puonti

macrumors 68000
Mar 14, 2011
1,567
1,187
@magneeto The problem is that while ordinary shortcuts can be shared, apparently automations can't. There's no way for me to get the automation out of the Shortcuts app as far as I can tell.

As for why this is failing for you, I'm at a serious loss of ideas at this point.

If the error message appears at the correct time - when your iPad reaches the selected charge level - then at least the triggering part is working correctly. Is that the case?

If yes, then something is likely wrong with the part where the automation tries to play that particular custom sound. You can test this theory as follows:

1. Delete the "Get file" and "Play sound" actions by tapping the "x" button in each
2. Tap "Add action", search for "Play sound" and add it. Without a custom file, "Play sound" will just play a default sound
3. Save the automation and test it
 

magneeto

Suspended
Original poster
Oct 27, 2020
160
19
So as you suggested I removed the ”Get file” and “Play Sound“ action in the shortcut and just left “Play Sound” for the default sound to play (Check the Screenshot)

The shortcut ran but there was no Sound that played !! What could be happening ??
 

Attachments

  • 7731A8F0-C0C3-4367-9846-1C3488E83FEC.jpeg
    7731A8F0-C0C3-4367-9846-1C3488E83FEC.jpeg
    187.4 KB · Views: 231

Puonti

macrumors 68000
Mar 14, 2011
1,567
1,187
Since I've confirmed that this works on my device and the default sound is played, my only guesses are that your iPad's volume has been set low or muted (check volume and mute setting), or its audio is being output to an external device (check audio output setting in the control panel), or that there is a temporary issue that is preventing sounds from playing in the lock screen (might be worth restarting the iPad).

I imagine you would be aware if audio is muted or diverted to an external source, though, so that does seriously limit the options I can offer here.
 

magneeto

Suspended
Original poster
Oct 27, 2020
160
19
Since I've confirmed that this works on my device and the default sound is played, my only guesses are that your iPad's volume has been set low or muted (check volume and mute setting), or its audio is being output to an external device (check audio output setting in the control panel), or that there is a temporary issue that is preventing sounds from playing in the lock screen (might be worth restarting the iPad).

I imagine you would be aware if audio is muted or diverted to an external source, though, so that does seriously limit the options I can offer here.


Please check your PM.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.