Late 2014 Mac mini running Sierra connected to an APC BackUPS Pro 900. No special software has been installed to support the UPS.

At the moment I run pmset every minute to determine the power source, and trigger actions based on the results.

However, a dialog window pops up as soon as the Mac switches to backup power. I'm wondering if there is any way I can trigger based on anything else, given that macOS seems to be able to do so.


Yes, using third party tools, like Power Manager, you can trigger scripts based on your UPS state.

Power Manager used to script a shut down when 30% of UPS left

Thirty party tools can monitor the UPS state through the IOKit and receive callbacks on state changes; thus avoiding polling.

If you are comfortable with shell script or AppleScript, Power Manager provides hooks for scripting your UPS in these languages.

I wrote Power Manager, so feel free to ask technical questions.

| improve this answer | |
  • 1
    That is some serious scripting support. Appreciate the recommendation. However, it's not worth it for me to make this investment in software. I might see if I can build a simple command line tool using IOKit, thanks for that recommendation. – Rob de Jonge Feb 7 '17 at 16:52

In System Preferences > Energy Saver, you will find an additional tab labeled UPS, which allows you to set specific Shutdown Options...

enter image description here

| improve this answer | |
  • Using that, thanks. But I want to run custom scripts that trigger when power switches to UPS and back to grid. – Rob de Jonge Feb 8 '17 at 2:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .