Power Manager and pmset on macOS

How can Power Manager and pmset work together on macOS.

Power Manager is often considered a replacement for macOS’s built-in power management tool pmset. This is not true but the assumption is understandable.

We are often asked about how macOS’s power management System Settings, the built-in command line tool pmset, and our own Power Manager all work together. Does one replace the other? Do they conflict? Can they work together?

Recently these questions arose on Dave Hamilton and John F. Braun’s weekly podcast, Mac Geek Gab, episode 975: “Is It The Yorkshiremen or ChatGPT?”.

Mac Geek Gab

Apple’s removal of the user interface for power scheduling in macOS Ventura 13 has led to more users discovering the built-in command line tool pmset. This tool is included with macOS and is now recommended by Apple as the way to manage a Mac’s power schedule:

Schedule your Mac to turn on or off in Terminal

You can use the pmset command line utility in Terminal to schedule specific times for your Mac to start up, sleep, restart or shut down. You can do this if you want to make sure your Mac turns on before you come to work and turns off when you aren’t working.

Averse to using a command line tool on their Mac, many users continue their search for an alternative and find Power Manager. Power Manager provides the user interface missing from macOS. It is then reasonable to assume Power Manager must be an interface on top of Apple’s pmset, with the work being delegated to pmset, but this is not the case.

Power Manager does not use pmset.

Does Power Manager replace pmset? No. Power Manager does not replace but extends the scheduling and power management abilities of the Mac.

Both Power Manager and pmset can schedule power events1 on Mac hardware.

You can use both Power Manager and pmset together. They do not conflict. Power Manager is careful not to affect other hardware power events. You can schedule power events with both tools and expect every event to take place.

Given that both tools can be used together, but do not show each others events, how is this possible? To understand this, it helps to know where hardware power management is implemented on macOS.

A Single Queue

General power management is part of IOKit; this is the core part of macOS that deals with hardware. Software can call published IOKit Application Programmer Interfaces (API) to manage their respective hardware events.

IOKit manages a single queue of hardware power events. This queue is common to all software dealing with hardware power events on the Mac. The queue can be seen within the Terminal.app command:

pmset -g sched

Each entry in the queue consists of an index, a time, and an owning identifier. Entries created by Power Manager begin with our reverse domain name uk.co.dssw.powermanager.

It is the responsibility of IOKit to tell the hardware which enqueued event to perform and when. In modern Macs, the hardware responsible is part of the System Management Controller (SMC).

Not an Option

Power Manager has to implement its own scheduler. The functionality used by pmset is not available to non-Apple software.

The repeating events offered by pmset are not published API calls2. They are System Programming Interfaces (SPI) and must not be used by non-Apple software. We firmly hold to good engineering practice and do not use them.

An alternative approach would be to call pmset directly but that is abhorrent3.

More Than Power Events

Power Manager treats IOKit hardware power events as an extra, not a core part of the user’s schedule. If an event’s trigger is scheduled for a specific time, Power Manager can enqueue a suitable hardware event to try and ensure the computer is powered on just before the due time.

Within date based triggers, waking up or powering on the computer is an optional called Availability. We have to consider the behaviour a nice to have, not an essential, because we do not control the underlying platform’s future direction. One of our roles is to guide our customers away from risky or unreliable dependencies; this is one way we do this.

Daily trigger in Power Manager

If Apple ever foolishly remove IOKit power events from macOS, then Power Manager will continue to be useful. The events and schedules offered by Power Manager go far beyond simple hardware events.

Even today, Power Manager eschews many macOS provided implementations in favour of a more predictable and robust approach. Approaches that are better suited to the way Mac users and applications really work. A good example of this is safer restart and shut down behaviour.

So where does this leave Power Manager and pmset?

In reality they are not comparable. pmset is a technical tool for debugging and interacting with the Mac’s power management hardware. pmset was never designed or intended for use by the average user. That Apple think it is, is a disservice to the ethos of the platform.

From anecdotal evidence, most of our customers use only Power Manager. It is simply easier to manage one schedule than two.

  1. See the IOPMSchedulePowerEvent for the low level details. ↩︎

  2. See the Apple open source but private IOKit IOPMLibPrivate.h header. ↩︎

  3. Occasionally calling out to another tool is the only way but it is terrible to maintain and support. ↩︎