We will explain how to integrate the 2N® IP Intercom or Access Unit with the IFTTT platform so that it can trigger services within IFTTT or be triggered by services within IFTTT.
IFTTT is a free web based automation platform that allows a user to create a chain of conditional statements. It lets users create applets (or recipes) to joint together services (or channels) that automate a variety of tasks.
...
Select 'Webhooks' in the ‚Services‘ tab and click 'Connect'
2) Find out your IFTTT webhook address
- See the settings of your new Webhooks channel (https://ifttt.com/services/maker_webhooks/settings)
- This page shows an URL like https://maker.ifttt.com/use/<your key>Visit the shown URL with your browser. The page that opens will show your unique webhook key. Take . The last part is your Key. Take note of the key, as this is what we will be targeting with bttn the HTTP action request later.
3) Create your IFTTT maker webhook applet
- Go to https://ifttt.com/create
- Select the maker webhook Webhooks as the 'This' part
- Select 'Receive a web request'
- When asked to give an event name, type for example 'start' or 'turn_oncardused', something that fits your purpose. Take note of the event name, as you need it to configure your http HTTP command in your 2N device later on.
- Select the desired service as the 'That' part and configure this service output according to your needs
- Save your applet.
Info | ||
---|---|---|
| ||
Be sure to keep the Webhook URLs to yourself, i.e. don't share them, as anyone can use the URL to launch your IFTTT applet. |
Settings in 2N IP device
- Choose how you wish to send the HTTP request, ie: by switch activation/deactivation, or by using the SendHttpRequest action within Automation.
- In either case, the URL you should enter for sending will be in the following format:
https://maker.ifttt.com/trigger/<event name>/with/key/<your key>
Where <event name> is replaced by the event you named in IFTTT and <your key> is the key you noted in the IFTTT steps. - Enter your IFTTT username and password in the authentication fields.
- Webhooks accepts up to three variable parameters in the HTTP command, you can use the formatter tool in Automation to insert these three values in the HTTP command. In this case, you should connect the desired Automation parameters into the formatter and the text output should look like this:
https://maker.ifttt.com/trigger/<Event Name>/with/key/<Your Key>?value1={1}&value2={2}&value3={3} - We can now use these variable values in the service action that Webhooks triggers.
In this example, my output service is Google spreadsheets. A new spreadsheet is created and everytime a card is used at the intercom, it is registered, along with the time and date, card number and direction in a new row in this spreadsheet.
...
- Go to https://ifttt.com/create
- Select your desired service as as the 'This' part, for example Google Assistant or Location and configure your trigger accordingly in that service.
- Select 'Webhooks‘ for the 'That‘ section
- In the Webhooks service app, enter the URL for your intercom. Depending on whether you are triggering an action in the intercom via its HTTP API or via automation, the URL could be in one of two formats:
- Save your applet
HTTP API format (can be secured)
- Set the authentication type for the desired service to 'Basic'
- Create an account in the HTTP API section of the intercom’s web interface and define a surname and password
- Activate access to the required services
- You will use these the login credentials you have created in the URL you send from Webhooks in this format:
http://<username>:<Password>@<router public IP address:port for fwd>/api/<parameter>
eg: httphttps://Admin:Test1@10.10.10.10:6111/api/switch/ctrl?switch=1&action=trigger
Automation format (Unsecured)
- Create an automation with an HttpTrigger event and name the trigger (eg: 'opendoor')
- The URL you send from Webhooks in this format:
http://<router public IP address:port for fwd>/enu/trigger/<parameter>
eg: http://10.10.10.10:6111/enu/trigger/opendoor -
You can test these URLs in your web browser to ensure the intercom triggers the desired action.
...