Automate your workflows by integrating eGeoffrey with IFTTT
If This Then That, also known as IFTTT (https://ifttt.com), is a freeware web-based service that creates chains of simple conditional statements, called applets. An applet is triggered by changes that occur within other web services such as Gmail, Facebook, Telegram, Instagram, or Pinterest and can result in actions provided by a number of partnered services.
You will not find an eGeoffrey applet in the IFTTT control panel (which would have required your eGeoffrey instance to be reachable from the Internet and a complex configuration) but you can easily integrate via the package
egeoffrey-notification-webhook. For every new notification generated by eGeoffrey (e.g. a rule triggering), information like the name of your house, the severity of the notification and the message itself will be sent via a HTTP request to IFTTT service called Maker Webhook. This inbound call will be the "IF" statement in the IFTTT world; from that point on, you can do whatever you want as a "THEN" leveraging all the services made available within the IFTTT platform such as sending emails, activating a connected smart device, interact with Google Docs, ask Alexa to do something and so on.
- Go to https://ifttt.com and register your account if not done yet
- On the top right of the screen, click on "Create"
- Click the big "+" icon of "IF THIS"
- In the search box, type in "webhooks" and click on the icon
- In the "Choose Trigger" screen, click on "Receive a web request"
- When asked for an event name, just type in "eGeoffrey" and click on the "Create Trigger" button
- Click the big "+" icon of "THEN THAT"
- Choose the action you want to trigger upon an eGeoffrey notification. Just as an example, we will select "E-mail"
- Complete the configuration of your action. In our example, we will select "Send me an email"
- The webhook service will make available three "ingredients" as IFTTT refers to. These are the variables passed by eGeoffrey and have static names: Value1, Value2, Value3. Later on in eGeoffrey we will map the name of the house with Value1, the severity of the notification with Value2 and the message of the notification with Value3 so use the three ingredients accordingly. In our example the configuration could look like the following
- Click on create action and review your configuration. You can always change any of the settings by clicking on the applet and clicking on the "Settings" button on top
- Before leaving IFTTT we need the URL of the webhook eGeoffrey will eventually call. Go to https://ifttt.com/maker_webhooks/settings and copy the key (the string with random characters) showing up under "URL", just after "https://maker.ifttt.com/use/"
- Install the package egeoffrey-notification-webhook by running from the directory where eGeoffrey is installed
sudo egeoffrey-cli install egeoffrey-notification-webhook
- As an admin, log into the web interface, go under "eGeoffrey / Modules", identify the module
notification/webhookand click on "Edit Configuration"
- Fill in the following:
- The URL of the webhook:
event_nameis the name of the event given in IFTTT (e.g. eGeoffrey in our example) and
ifttt_webhook_keyis the key Maker Webhook key we previously copied out
- The name of the JSON key the House Name will be passed along:
value1(since one of the three key names accepted by IFTTT)
- The name of the JSON key the severity of the notification will be passed along:
value2(since one of the three key names accepted by IFTTT)
- The name of the JSON key the message of the notification will be passed along:
value3(since one of the three key names accepted by IFTTT)
- The URL of the webhook:
Testing the integration
- Manually trigger a rule to send out a notification. The
notification/webhookmodule will then hit the configured URL passing by the notification information as instructed. IFTTT will then route it through the configured service performing the action you have configured, in our example, sending out an email
This is just an example how to connect your apps to automate your workflows by leveraging IFTTT.
If interested, another similar service you want to try out is Zapier (https://zapier.com/) which provides a larger number of integrations, more powerful workflow capabilities but only a limited number of those available for free.