For the Homebridge plugin hans-1/homebridge-cmdtriggerswitch, I created various switches to do things such as wake and sleep my PC (usually turning on PC to watch Plex).
- Using Wake-on-LAN (WoL) sample found here
- Using the DontSleep app to keep the PC from sleeping when awakened
- Using a scheduled task workaround to launch a GUI application (DontSleep) via Windows SSH
- Using PsShutdown from the Sysinternals suite to sleep PC
Right now, using a stateful switch to turn on/off PC.
On command:
/home/pi/scripts/wake.sh xx:xx:xx:xx:xx:xx 192.168.1.xx 9 Joshua
Off command:
/home/pi/scripts/sleep.sh Joshua 192.168.1.xx