IFTTT is an initialism for If This Then That. It is a free web-based service to create chains of simple conditional statements, called applets. An applet is triggered by changes that occur within other web services such as Gmail, Facebook, Instagram, or Pinterest. In addition to the web-based application, the service runs on iOS and Android.
Figure 1: IFTTT Slogan
Figure 2: IFTTT Structure
IFTTT employs the following concepts:
Figure 3: IFTTT Services
Figure 4: IFTTT Trigger
Figure 5: IFTTT Action Service
Figure 6: IFTTT Ingredients
Figure 7: IFTTT Applet
Go to https://ifttt.com/ to create an account with IFTTT. You can sign up using your Google or Facebook account, or by entering your email address and password. Once signed in, click on “My Applets” to start creating your first applet.
Figure 8: IFTTT Account
Thinknx uses the IFTTT service named “Webhooks”. Through this service it is possible to:
Go to the web page of your Thinknx server, under “Server” tab, select “Thinknx Cloud”. Click on “Enable Integration Kit”. For more information about the Integration Kit and how to use it with third party systems, check out the Integration Kit wiki page.
Figure 1.1: Enable Integration Kit
Inside your IFTTT account, click on your username and select Services from the list.
Figure 2.1: IFTTT Username
Make sure to click on “All Services” button under the preferred services, input the word “Webhooks” in the search bar and click on the result.
Figure 2.2: IFTTT Account Services
Figure 2.3: IFTTT Webhooks
Inside the “Webhooks” service, click on “Connect”, then go to “Settings”.
Take note of the URL associated to your account, especially the KEY section (https://maker.ifttt.com/use/[KEY])
This step will create a dedicated key to establish communication with Thinknx Cloud. The key will permit to create actions on Thinknx server, therefore it is important to keep it secured to prevent security attacks.
Figure 2.4: IFTTT Webhooks URL
If you want to execute an IFTTT action when a Thinknx object changes its status, start by going to “Sytem” tab inside Configurator, and add the object “IFTTT”.
Figure 3.1: Add IFTTT Account in Thinknx
Click on IFTTT Account, and copy paste the Key from your Webhooks URL (see section 1. Configure Webhooks above).
Figure 3.2: Add Webhooks Key to Thinknx
Next, add a “Generic Button” inside your page, and configure the command to be sent as IFTTT. Insert an “Event Identification” to be used later on when creating the Applet.
Figure 3.3: Add IFTTT command in Thinknx
Sign in to your IFTTT account on https://ifttt.com, go to “My Applets” and click on the “New Applet” button.
Figure 3.4: Create New Applet
Click on “+This” and search for “Webhooks” to place it as a trigger.
Figure 3.5: Click on IFTTT “+This”
Figure 3.6: Add Webhooks as “This”
Select “receive a web request” and enter the “Event Name” given inside the Configurator.
Figure 3.7: Add Trigger
Figure 3.8: Add Thinknx Event Name
Next, you can click on “+That” to configure any action required choosing the preferred service.
The same concept as section 2 applies, but instead of choosing Webhooks as “+This”, it will be selected as “+That”.
Start by adding a trigger that will be used to command a Thinknx object, for example when an event starts or finishes on your Google calendar, and include it as “+This”. Then, click on “+That” and select “Webhooks”. Click on “Make a web request”.
Figure 4.1: Add Webhooks as +That
Then click on “Server” tab again, and select “Integration Kit”.
Figure 4.2: Select Integration Kit
You will see the entire tree of your uploaded project. Go to the desired object to be controlled from IFTTT and select it. Choose the command to be sent(for example ON), and click on copy Cloud URL to be able to send the command remotely.
Figure 4.3: Copy IFTTT URL
Go back to your Applet on IFTTT website and paste the URL. Leave the Method as “GET” and select under “Content Type” the option “application/x-www-form-urlencoded”. Finish by clicking “Create Action”.
Figure 4.4: Creating an action for Thinknx
Applet (Recipe): “When ambient temperature in the cellar rises above 10°C (measured by KNX sensor), make a VoIP call through IFTTT.”
Inside Thinknx Configurator, under “System” tab, add “Universal Gateway” and click to open the “Actions from KNX”.
Figure 1: Add Universal Gateway
Click “Add” to insert a new element and label it as desired.
Enter the KNX group address and Data Type of the Cellar's ambient temperature.
Enable Condition 1 and click on command. A new popup will open to create the IFTTT event under “Reports and Gateways”. Once the event is labeled, close the popup.
Choose as condition “Send if greater” and enter the value 10 in the condition parameters to indicate that “if the temperature is higher than 10 degrees then the event will be launched”.
Figure 2: Create IFTTT event in Thinknx
Go back to the IFTTT website to create a new applet. Click on “+This” and search for “Webhooks”.
Figure 3: Add Webhooks as Trigger
Select “Receive a web request”.
Figure 4: Select “Receive a web request”
Enter the event name created in Thinknx.
Figure 5: Select “Insert event name”
Click on “+That” and search for “VoIP”.
Figure 6: Add VoIP as Action
Select “Call my device”.
Figure 7: Select “Call my device”
Enter the voice message you want to hear when the event takes place.
Figure 8: Select “Insert event name”
Applet: “When client says Good Morning to Google Assistant, launch Thinknx scene.”
Start a new Applet on IFTTT website. Click on “+This” and search for “Google Assistant”
Figure 1: Create Google trigger
Select “Say a simple phrase”, and enter the phrase “Good morning” and any other alternatives you want. You can even write down the assistant's reply
Figure 2: Select your trigger
Figure 3: Enter the sentence
Next, click on “+That” and select “Webhooks”. Click on “Make a web request”.
Figure 4: Add Webhooks as Action
To get the URL, go to the Thinknx server's web page, select “Server” tab and click on “Integration Kit”.
Figure 5: Go to “Integration Kit”
Search for the Good Morning Scene in the Project tree, select “Launch” as parameter and click on “Copy URL Cloud”.
Figure 6: Select Scene in Thinknx
Go back to your IFTTT web page and paste the URL. Click on “Create Action” and the applet will be created.
Figure 7: Create Applet