- Notifications
You must be signed in to change notification settings - Fork0
A bash script for toggling on and off smart devices via IFTTT webhooks
License
eathtespagheti/webhook
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
It's a posix compliant shell script for toggling on and off smart devices via IFTTT webhooks, to use it you need to configure some webhooks in your IFTTTaccount using this scheme:
For every device create two Webhooks, one for turning on
IF:webhooks.receiveWebRequestEventName:turn_on_{{DEVICE}}THEN:yourSmartDeviceManagerTurnOn: {{DEVICE}}
and one for turning off
IF:webhooks.receiveWebRequestEventName:turn_off_{{DEVICE}}THEN:yourSmartDeviceManagerTurnOff: {{DEVICE}}
then launch the script with these args:
./webhook.sh [0/1] [DEVICE] optional[DELAY]
You need to configure a 'KEY' variable inside your webhook config file.This variable should contain your Webhook Authentication Key, in order to allow the script to make request the the IFTTT servers, eg:
KEY=a68f0060404741799713db2f95e5f3c554488d86fe0
The name of the config file should beconfig
and the default config folder it's~/.config/webhook
.You can change the default folder setting the variableWEBHOOK_FOLDER
to the path you want to use
You can also enable some bash completion for your devices sourcing thewebhook-completion.bash
file in your.bashrc
. Notice that you should source the completion file only AFTER setting theWEBHOOK_FOLDER
if you don't use the default one.
Write your devices in aDEVICES
variable as a shell array, eg:
DEVICES="smartDevice smartLamp smartPlug"