IFTTT

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. 


Our 2N IP Intercom or Access Unit range is able to integrate with IFTTT services by virtue of one of its services called Webhooks. This service is an online interface which can receive an HTTP command and use this to trigger another IFTTT service. It is also capable of sending HTTP commands when triggered to do so by another IFTTT service. It can thefore act as an intermediary between our 2N IP Intercom range and other services available on IFTTT, allowing our intercoms to intergrate with systems that might not have an open HTTP API but do have IFTTT services available.


One such usage might be that when a particular RFID card or code is used at the intercom, the lights and heating in a buliding may be activated. Alternatively an external input, like a command spoken to Google Assistant could be used to unlock a door.

How to configure IFTTT to receive triggers from the 2N IP Intercom

Steps in IFTTT


1) Start by setting up your IFTTT account and activating the Webhooks service (in not already done)

  • Select 'Webhooks' in the ‚Services‘ tab and click 'Connect'

               

                                   


2) Find out your IFTTT webhook address


3) Create your IFTTT maker webhook applet

  • Go to https://ifttt.com/create
  • Select the maker Webhooks as the 'This' part
         
  • Select 'Receive a web request'
  • When asked to give an event name, type for example 'start' or 'cardused', something that fits your purpose. Take note of the event name, as you need it to configure your 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.



Security warning

  • 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.

How to configure IFTTT to send triggers to the intercom

Here we will look at the configuration needed to use an IFTTT service to trigger an action the intercom. For this to works you will need to set up port forwarding on the router to which your 2N IP Intercom or Access unit is connected and to know this router’s public IP address.

 

Security warning

  • Please be aware that making an 2N IP Intercom or Access unit’s IP address publicly accessible on port 80 will carry its own security implications, which you need to consider before using this method. 

Steps in Router

  • Log into router’s control pannel
  • Configure Port Forwarding or NAT rules so that requests sent to the router’s IP address on a port of your choosing will be redirected to port 80 of the internal LAN IP address of the intercom
  • Port forwarding settings differ from router to router but you may consult this guide on setting up NAT or port forwarding for further information

Steps in IFTTT

1) Start by setting up your IFTTT account and activating the Webhooks service (in not already done)

  • Select "Webhooks" in the 'Services‘ tab and click 'Connect'


2) Create your IFTTT maker Webhooks applet

  • 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:

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: https://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.