0.1.2 • Published 5 years ago
homebridge-cmdswitch2-macos-display v0.1.2
Homebridge-cmdswitch2-macOS-Display
CMD Plugin for HomeBridge (API 2.0)
What This Plugin Does
This plugin allows you to run Command Line Interface (CLI) commands via HomeKit exposed as a switch. This is a modified version of the original homebridge-cmdswitch2 specificity for macOS's Displays power management
How This Plugin Works
on_cmd
: This is the command issued Display ON when the switch is turned ON.off_cmd
: This is the command issued Display OFF when the switch is turned OFF.state_cmd
: This is the command issued when HomeBridge checks the Display state.
Things To Know about This Plugin
This plugins is modified to check and control the display of a macOS based system. It uses internal cli pmset function of macOS. Therefor there is a need of SSH service working on the target macOS and HomeBride with access to this ssh via RSA key.
Installation
npm install -g homebridge-cmdswitch2-macos-display@latest --unsafe-perm
Configuration
{
"platform": "cmdSwitch2macOSDisplay",
"name": "MagicMirror",
"switches": [
{
"name": "MagicMirror",
"on_cmd": "ssh mmm@192.168.1.78 caffeinate -u -t 1",
"off_cmd": "ssh mmm@192.168.1.78 pmset displaysleepnow",
"state_cmd": "ssh mmm@192.168.1.78 pmset -g powerstate IODisplayWrangler | tail -1 | cut -c29"
}
]
}