Support multiple keys in ifttt triggers (#8751)

* Support multiple keys in ifttt triggers

* Rename `to` to `target` in ifttt as suggested
This commit is contained in:
Sergio Oller 2019-03-07 04:47:32 +01:00 committed by Paulus Schoutsen
parent 4dafc5c4f8
commit 7e705f732e

View File

@ -70,6 +70,19 @@ Once you have added your key to your `configuration.yaml` file, restart your Hom
After restarting the server, be sure to watch the console for any logging errors that show up in red, white or yellow. After restarting the server, be sure to watch the console for any logging errors that show up in red, white or yellow.
</p> </p>
### {% linkable_title Multiple IFTTT keys %}
If you have multiple IFTTT users you can specify multiple IFTTT keys with:
```yaml
# Example configuration.yaml entry
ifttt:
key:
YOUR_KEY_NAME1: YOUR_API_KEY1
YOUR_KEY_NAME2: YOUR_API_KEY2
```
### {% linkable_title Testing your trigger %} ### {% linkable_title Testing your trigger %}
You can use the **Developer tools** to test your [Webhooks](https://ifttt.com/maker_webhooks) trigger. To do this, open the Home Assistant frontend, open the sidebar, click on the first icon in the developer tools. This should get you to the **Call Service** screen. Fill in the following values: You can use the **Developer tools** to test your [Webhooks](https://ifttt.com/maker_webhooks) trigger. To do this, open the Home Assistant frontend, open the sidebar, click on the first icon in the developer tools. This should get you to the **Call Service** screen. Fill in the following values:
@ -85,6 +98,17 @@ Service Data | `{"event": "EventName", "value1": "Hello World"}`
When your screen looks like this, click the 'call service' button. When your screen looks like this, click the 'call service' button.
</p> </p>
By default the trigger is sent to all the api keys from `configuration.yaml`. If you
want to send the trigger to a specific key use the `target` field:
Field | Value
----- | -----
domain | `ifttt`
service | `trigger`
Service Data | `{"event": "EventName", "value1": "Hello World", "target": "YOUR_KEY_NAME1"}`
The `target` field can contain a single key name or a list of key names.
### {% linkable_title Setting up a recipe %} ### {% linkable_title Setting up a recipe %}
Press the *New applet* button and search for *Webhooks*. Press the *New applet* button and search for *Webhooks*.