We have been controlling our desk lamp via a vibration sensor in our desk chair for quite some time. Even though this works well in 95% of cases, there are still 5% where the vibration sensor suddenly detects a movement at night or the light is turned off even though we are still sitting at our desk. That’s why today we’re going to show you an alternative automation that automatically turns on the desk lamp when the Mac wakes up from sleep mode and turns it off again when the Mac is put to sleep. Besides a HomeKit lamp, only the Mac app Homie in the Pro version is required.

First, two scenes need to be created via any HomeKit app. We use Apple’s Home app for this. While the first scene turns on the desk lamp, the second scene turns off the lamp accordingly.

Desk lamp HomeKit scenes

If not already done, Homie must now be installed on the Mac. After launching, a new icon will appear in the Mac menu bar. The settings of Homie can be opened via this.

Open Homie settings

The “Automation” tab displays all scenes for which a corresponding trigger can then be selected. Here you can automate the scenes you have just created. To do this, we select the “When the computer returns from sleep” trigger for the “Turn on desk lamp” scene.

Turn on HomeKit desk lamp with Mac

For the scene “Turn off desk lamp” we deposit “When the computer is put to sleep”.

Turn off HomeKit desk lamp with Mac

Tip: In the settings, you should also activate the option that Homie is automatically activated when the Mac is booted.

That’s about it. The desk lamp is automatically turned on when the Mac wakes up from sleep mode and turned off again when the Mac is put to sleep mode. Automation runs very reliably, but it also has a disadvantage compared to automation via the vibration sensor: no additional conditions can be set, such as the current brightness or time.