Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 31 additions & 11 deletions source/_components/ifttt.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,37 @@ featured: true
ha_iot_class: "Cloud Push"
---

[IFTTT](https://ifttt.com) is a web service that allows users to create chains of simple conditional statements, so called "Applets". With the IFTTT component you can trigger applets through the **"Webhooks"** service (which was previously the **"Maker"** channel). See the [announcement blog post](/blog/2015/09/13/home-assistant-meets-ifttt/) for examples how to use it.
[IFTTT](https://ifttt.com) is a web service that allows users to create chains of simple conditional statements, so-called "Applets". With the IFTTT component, you can trigger applets through the **"Webhooks"** service (which was previously the **"Maker"** channel).

## {% linkable_title Sending events from IFTTT to Home Assistant %}

To be able to receive events from IFTTT, your Home Assistant instance needs to be accessible from the web ([Hass.io instructions](/addons/duckdns/)) and you need to have the `base_url` configured for the HTTP component ([docs](https://www.home-assistant.io/components/http/#base_url)).

To set it up, go to the integrations page in the configuration screen and find IFTTT. Click on configure. Follow the instructions on the screen to configure IFTTT.

Events coming in from IFTTT will be available as events in Home Assistant and are fired as `ifttt_webhook_received`. The data specified in IFTTT will be available as the event data. You can use this event to trigger automations.

For example, set the body of the IFTTT webhook to:

```json
{ "action": "call_service", "service": "light.turn_on", "entity_id": "light.living_room" }
```

You can then consume that information with the following automation:

```yaml
automation:
trigger:
event: ifttt_webhook_received
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I trigger an automation base on the content of event_data?

trigger:
  event: ifttt_webhook_received
  event_data:
    action: call_service

Also change the above json payload to

{ "action": "call_service", "service": "light.turn_on", "entity_id": "light.living_room" }

event_data:
action: call_service
action:
service_template: '{% raw %}{{ trigger.event.data.service }}{% endraw %}'
data_template:
entity_id: '{% raw %}{{ trigger.event.data.entity_id }}{% endraw %}'
```

## {% linkable_title Sending events to IFTTT %}

```yaml
# Example configuration.yaml entry
Expand Down Expand Up @@ -107,16 +137,6 @@ ifttt_notify:
```
{% endraw %}

### {% linkable_title Sending events from IFTTT to Home Assistant %}

To be able to receive events from IFTTT, your Home Assistant instance needs to be accessible from the web. This can be achieved by forwarding port 8123 from your router to the device running Home Assistant. If your ISP is giving you a new IP address from time to time, consider using [DuckDNS](https://duckdns.org).

In the URL field, you can then put an [API URL](/developers/rest_api/). You probably want to use a POST action, so select `POST` as method. After your request line, you need to add your Home Assistant password, which you defined in the [http section of your config](/getting-started/basic/#password-protecting-the-web-interface), in the form of `?api_password=YOUR_PASSWORD`. For the message body, refer to the API page linked above.

<p class='img'>
<img src='/images/components/ifttt/IFTTT_to_HA.png' />
</p>

### {% linkable_title Additional Channel Examples %}

Additional examples of using IFTTT channels can be found below.
Expand Down
Binary file removed source/images/components/ifttt/IFTTT_to_HA.png
Binary file not shown.