I will use:
2. domoticz on a raspberry pi
1. computer with cygwin enabled with sshd service
3. ha-bridge on raspberry pi
4. Amazon echo
I'm more of a computer user than a developer, but I find that Domoticz is great as it helps non-developers download unix commands and allow a direct call to shell scripts.
More great things about Domoticz is that it convert HTTP POST to GET methods when you are using triggers that can't do POST to Philips Hue lights (I will cover that in another post)
Step 1: Setup a dummy hardware used for virtual switches
Step 2: Create a virtual sensor as a light switch called Computer
For the On script use:
The bash script should contain
For the Off script use:
This bash script contents are; (Replace X with the IP address of the computer)
ssh email@example.com.X "shutdown /h" &
The off switch assumes you have an sshd service running on your computer with private keys installed on the raspberry pi with no password so it auto autenticates and runs without entering a password. Windows 10 command to hibernate is shutdown /h
You will need to google again to find out how to setup sshd, as it's too long to put into this post.
For ha-bridge to use this, add the domoticz command to Computer (Replace NN with switch ID, you can get this from the devices tab under the "Setup" drop down.
Alexa, turn on computer
Alexa, turn off computer