Terminal command to disable power going to ejected external SSD via USB-C?

I've got an external SSD connected to my Macbook pro M2 and I have keyboard maestro ejecting/mounting the drive based on which programs are open when going into sleep/closing lid.

But I've noticed that my Macbook tends to use about 5-10% percent of battery power when leaving the drive connected over a period of time while the mac is sleeping. The macros seem to work and the drive ejects when the Macbook enters sleep mode but the power keeps being drawn. Now I know that the simplest solution would be to simply unplug the drive when not in use but none of us are here for simple solutions.

Is there any way to disable power going to the ejected drive with a terminal command?

I see a clue about this problem when working with Windows. This might be a lead.

1 Like

Did you actually read that @Airy - it's Windows only!!

Doh! Maybe I should go to SpecSavers?

1 Like

Of course I knew that. But if Windows is able to solve an electrical power draw issue, then probably macOS can to, and macOS may deal with it in a similar way. I called it a "lead" not a solution.


How about this?

1 Like

Interesting, maybe macOS has something like this under the hood.

Seems promising and simple enough! Testing as soon as I get back in the office. Thanks to both of you for taking the time to look into this.

1 Like

Let us know how you get on!

Great uncovery, tiffle (is that a word?) That reminds me, the pmset command has quite a few interesting features.

I think I remember once using "pmset schedule wake" command (in an infinite loop) to cause my computer to reboot after it experienced a blue screen of death.

1 Like