Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

uncleiven

macrumors regular
Original poster
Nov 6, 2009
175
11
Is there a way that when I lock my Mac mini (using the lock key on my keyboard) then it can trigger two monitors which are connected to Philips Hue smart plugs to switch off?

Not sure if this is possible via a script or something similar?
 

itsmeaustend

Suspended
Apr 27, 2016
332
816
I can’t think of any possible way to achieve this. I don’t think Apple allows interactions with the home outside of shortcuts and the home app. I’m not sure scripts could trigger anything.

You may be able to use Automator to automate (heh) mouse movements in the home app and possibly achieve a workaround that way? But it wouldn’t be as seamless as you’re hoping for, and I’m not sure you could trigger it before/during/after pressing the lock key. Might have to be manually ran which defeats the point.
 

zakarhino

Contributor
Sep 13, 2014
2,607
6,958
Off the top of my head I would tell you to override the default lock key binding using BetterTouchTool. I set up a custom keybind on my keyboard to start my screensaver but it's also possible for me to chain another action that can run AppleScript or JavaScript. From there all you have to worry about is writing a script to turn off the lights.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.