How to Shut Down When UPS Power Drops

Power Manager can shut down your Mac when the remaining power of an Uninterruptible Power Supply (UPS) drops to a critical level. This recipe walks through how to set this up.

An uninterruptible power supply provides an extra level of protection for a Mac. Used in environments where power cuts are frequent or where sudden loss of power risks critical systems, UPS devices are essential. A UPS typically provides a few minutes of power to keep systems up and running. During this time your Mac can gracefully stop critical systems and be shut down cleanly.

Power Manager provides triggers and conditions to craft events to ease those frantic moments when the power fails. You can create multiple events triggered at different stages of the power failure.

You might create an event that warns of the power cut and that the UPS is being relied upon. Another event might start closing critical systems once battery’s remaining power has reached 50%. A final event might shut down as the power drops to 30% remaining.

This recipe will create an event that uses the power remaining trigger and a power state condition to check the UPS is being relied upon, before shutting down the Mac.

Create a UPS Event

The event we want to create is not represented by a Schedule Assistant task. We are going to have to create the event in parts.

Create a Shut Down Event

The first part creates an event to shut down your Mac. We will modify this event in the second part.

  1. Launch Power Manager.app
  2. Click Add… to create a new event

Click Add… to create the event

Click Add… to create the event

  1. Select the Power off task

Select the Power off task

Select the Power off task

  1. Continue to the What and When step
  2. Select Shut Down for What should be performed?
  3. Adjust When should it be performed? to a date in the past

Adjust the what and when settings Adjust the what and when settings

  1. Continue to the Why step and describe your event

Name and describe the event

Name and describe the event

  1. Continue and Add the event.

Confirm the event should be created

Confirm the event should be created

The event has been created

The event has been created

The basic shut down event is ready but will never be triggered - the date is in the past.

Add a Power Remaining Trigger

In this second part we will replace the event’s trigger. To do this we need to use the event editor.

  1. Hold down the Option key and double-click the event; the event editor will appear

Open the event in Power Manager’s event editor

Open the event in Power Manager’s event editor

  1. Delete the trigger; Trigger Action Cog > Delete…

Delete the date and time trigger

Delete the date and time trigger

Event with no triggers

Event with no triggers

  1. Add a Battery 30% left trigger; Add a trigger > Power Remaining > Battery 30% left

Add a power remaining trigger

Add a power remaining trigger

Event with added power remaining trigger

Event with added power remaining trigger

  1. Edit the new trigger; Trigger Action Cog > Edit

Edit the power remaining trigger

Edit the power remaining trigger

  1. Select USB Connected Power Supply for Filter

    Select USB Connected Power Supply Select USB Connected Power Supply

  2. Apply to save changes to the trigger

Add a Power State Condition

In this final part we will add a condition to ensure battery power is being relied upon before starting the shut down.

  1. Add a Using Battery condition; Add a condition > Power State > Using Battery

Add a power state condition

Add a power state condition

  1. Edit the new condition; Condition Action Cog > Edit

Edit the power state condition

Edit the power state condition

  1. Add the optional Filter; Optional > Filter

Add the optional Filter to the condition

Add the optional Filter to the condition

  1. Select USB Connected Power Supply for Filter

Select USB Connected Power Supply for the Filter

Select USB Connected Power Supply for the Filter

  1. Apply to save changes to the condition.

Your event is almost ready.

  1. Save to save the event to your schedule.

The event is finished and scheduled

The event is finished and scheduled

How the Event Works

The event is now finished and immediately added to your schedule. The event is triggered each time any USB connected power supply’s power capacity passes 30%. The capacity need only pass 30%; the trigger does not differentiate between a rising or falling capacity.

Once triggered, the event uses the power state condition to test if the Mac is being powered by a battery. If the Mac is being powered by a UPS based power supply, the event continues and begins shutting down.

Given the need for the shut down to complete, Power Manager will ensure your Mac does shut down – even if other applications attempt to block it. Power Manager works hard to ensure your schedule is adhered to.

With this event as a basis, you can now create uninterruptible power supply triggered events to ensure your Mac remains safe.