mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 21:36:52 +00:00
Add webhook trigger docs (#6610)
This commit is contained in:
parent
3664d24f90
commit
6d1c5eda38
@ -126,6 +126,15 @@ The following tables show the available trigger data per platform.
|
||||
| `trigger.platform` | Hardcoded: `time`
|
||||
| `trigger.now` | DateTime object that triggered the time trigger.
|
||||
|
||||
### {% linkable_title webhook %}
|
||||
|
||||
| Template variable | Data |
|
||||
| ---- | ---- |
|
||||
| `trigger.platform` | Hardcoded: `webhook`
|
||||
| `trigger.webhook_id` | The webhook ID that was triggered.
|
||||
| `trigger.json` | The JSON data of the request (if it had a JSON content type).
|
||||
| `trigger.data` | The form data of the request (if it had a form data content type).
|
||||
|
||||
### {% linkable_title zone %}
|
||||
|
||||
| Template variable | Data |
|
||||
|
@ -125,7 +125,7 @@ automation:
|
||||
offset: '-00:45:00'
|
||||
```
|
||||
|
||||
Sometimes you may want more granular control over an automation based on the elevation of the sun. This can be used to layer automations to occur as the sun lowers on the horizon or even after it is below the horizon. This is also useful when the "sunset" event is not dark enough outside and you would like the automation to run later at a precise solar angle instead of the time offset such as turning on exterior lighting.
|
||||
Sometimes you may want more granular control over an automation based on the elevation of the sun. This can be used to layer automations to occur as the sun lowers on the horizon or even after it is below the horizon. This is also useful when the "sunset" event is not dark enough outside and you would like the automation to run later at a precise solar angle instead of the time offset such as turning on exterior lighting.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
@ -190,9 +190,20 @@ automation 3:
|
||||
seconds: 00
|
||||
```
|
||||
<p class='note warning'>
|
||||
Remember that if you are using matching to include both `minutes` and `seconds`. Without `seconds`, your automation will trigger 60 times during the matching minute.
|
||||
Remember that if you are using matching to include both `minutes` and `seconds`. Without `seconds`, your automation will trigger 60 times during the matching minute.
|
||||
</p>
|
||||
|
||||
### {% linkable_title Webhook trigger %}
|
||||
|
||||
Webhook triggers are triggered by web requests made to the webhook endpoint: `/api/webhook/<webhook_id>`. This endpoint does not require authentication besides knowing the webhook id. You can either send encoded form or JSON data, available in the template as either `trigger.json` or `trigger.data`.
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
trigger:
|
||||
platform: webhook
|
||||
webhook_id:
|
||||
```
|
||||
|
||||
### {% linkable_title Zone trigger %}
|
||||
|
||||
Zone triggers can trigger when an entity is entering or leaving the zone. For zone automation to work, you need to have setup a device tracker platform that supports reporting GPS coordinates. This includes [GPS Logger](/components/device_tracker.gpslogger/), the [OwnTracks platform](/components/device_tracker.owntracks/) and the [iCloud platform](/components/device_tracker.icloud/).
|
||||
|
Loading…
x
Reference in New Issue
Block a user