Run shortcut when phone is put on charger?

We’ve got a home alarm that has a shortcuts enabled app, and I’d like for it to run automatically when I put my phone on the charger at the end of the day. So, essentially, I guess it would look like this, but I don’t know how to set it up:

IF phone is charging


IF time is after 11 PM


“Turn on alarm.”

Is that possible? Do I need a third party app?



That might work if you add an automation checking for the device to be charging, which then runs a shortcut checking the time, and if that is after 11pm sets the alarm.

Dont think automations can use 2 triggers (charger + time) on its own.

I have a personal automation that runs when I connect it to power that runs a shortcut. That shortcut checks the time and if it is after 9 PM and connected to my home Wifi, it turns out my bedroom light, connects to the Air Play speaker in my bedroom and then, regardless of where I am, it plays 50 minutes of noise via Dark Noise to help me relax/sleep.

The key to checking the time is to reformat the date as just the hours (the number action).

Hope that helps.


Thanks, y’all, this is great. I’d love to get more into shortcuts this year, but I don’t always know what to do when.

I’ll check these out.

Thanks for the “how to just extract the time” tip. Just yesterday I needed it - for extracting today’s Omnifocus tasks and updating a draft with the Due Time. (I used the same method - but I was wondering if that was the best/only way.)

1 Like