A Homebridge switch accessory to sleep and wake the host computer.
- Install Homebridge using
npm install -g homebridge
- Install this plugin using
npm install -g homebridge-computer-sleep
- Update your configuration file. See Configuration below.
Your Homebridge config file (~/.homebridge/config.json
) must include a ComputerSleep
accessory with a name of your choosing for this plugin to function.
Example:
"accessories": [
{
"accessory": "ComputerSleep",
"name": "Office PC"
}
]
- Create an accessory as shown above in Configuration
- Setting
name
to the name of your device is recommended - 'Gaming PC', 'MacBook Pro', etc.
- Setting
- The accessory will show as On in HomeKit when your device is awake (default), and Off when it is toggled off to sleep.