-
Notifications
You must be signed in to change notification settings - Fork 0
IFTTT Integration
IFTTT: (IF This, Then That) is a web service that helps connect devices and other web services together through chains of simple conditional statements, called applets. These applets can then perform functions and provide interactivity beyond the scope of the original devices and services.
We will need to edit the config.inc.php variables related to IFTT first
define("ALLOW_EXTERNAL_API_ACCESS", 1);
Setting this variable to 1 enables the API: without it IFTTT cannot be used
define("EXTERNAL_DDNS_URL", "http://your-address.ddns.net");
Set this to the DDNS hostname you chose in the Dynamic DNS setup (or a private domain name if you have one)
define("REQUIRE_EXTERNAL_API_PASSWORD", 1); //require a password for external (non lan) use IE for IFTTT? (1 = true, 0 = false)
It it recommended that you enable the external password option. That way if someone stumbled onto the url for you api file the system will not attempt to process any lighting control commands if the password is incorrect
define("EXTERNAL_API_PASSWORD", "P@ssW0rd"); //set what the password should be
Set the password if you enabled it above. Replace P@ssW0rd with your own
define("RESTRICT_EXTERNAL_PORT", 1); //if request is an external (API) user, should they only be on a specific port? (1= yes, 2=no)
If set will ignore any requests no coming in on the port defined below. While this scenario is unlikely this provides an extra check against an apache or firewall misconfiguration
define("EXTERNAL_PORT", 443); //if you wish to use an alternate external port change this number to the corresponding port number
The default external port assumes HTTPS on 443. If for some reason you need to change the port you will need to reconfigure apache to listen on that alternate port as well
Before beginning you need an account with IFTTT
-
Go to IFTTT.com click on
-
Scroll down to find
-
Then click on +this
- This is where you’ll want to select your Trigger – IE a Google Home or Amazon Echo. This tutorial assumes a Google Home. Search for and Select “Google Assistant”.
- Choose: “Say a Simple Phrase”
Other options will work like Say a phrase with a number with the dim command
- Configure the Simple Phrase as you see fit. For example, an action I’d like is to be able to say “Hey Google Turn on the Kitchen Lights”.
- Once you’ve configured the trigger, the next step is to configure the “that”. Click on the +that.
- Search for and Select “Web Hooks”
- Webhooks currently only has one option (“Make a web request”). Select it.
- Got back to the TCPLightingWebInterface page and select IFTTT Query Builder at the top of the screen
- Next select the Device, Room or Scene from the dropdown list that you would like to control
- The Query Builder will automatically generate the api urls for On and Off. As well it generates Phrase with Number commands for setting bulb intensity
- Paste the generated link into the “URL” Box of the webhook form. Leave the Method as GET and click “Create action”.
- You should now be able to use the command you created. It is recommended that you at least create an On and Off action for any bulbs, rooms, scenes you wish to control
Continue creating IFTTT applets for any additional lights you wish to control
- Home
- Installation & Configuration
- Pi Setup Walk-through
- Additional Project Information