- ifttt-api.js:
Node server, must be hosted on a provider.
It exposes a TCP Server to send commands to the client, and an HTTP Server to receive commands from IFTTT.
- pc-client.js:
Node client, must be run on the target PC (on startup).
It connects to the TCP Server to receive commands. It reconnects in case of failure.
- Go to platform.ifttt.com and create a new service
- Go to "API" > "General"
- Type the URL where the server is hosted
- Copy the Secret Key and paste it in ifttt-api.js (SECRET_IFTTT_KEY)
- Go to "API" > "Actions"
- Click on "New action"
- Fulfill the form, typing
shutdown_pc
in Endpoint field
- Run ifttt-api.js with PM2 on a server
- Open ports indicated in ifttt-api.js if necessary on the server
- Open pc-client.js and set the value of TCP_ADDR
- Run pc-client.js on PC, better if at startup
- Go to https://ifttt.com/create
- Create an applet as usual, choosing the new service just created
- Open the Alexa app
- Go to Routines
- Create a new routine
- When a phrase of your choice is detected, run the IFTTT applet created before