Add event to binary sensor example (#18567)

This commit is contained in:
Paulus Schoutsen 2021-07-20 23:35:22 -07:00 committed by GitHub
parent 523d1b0f3b
commit a99784324c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,6 +299,21 @@ curl --header "Content-Type: application/json" \
http://homeassistant.local:8123/api/webhook/my-super-secret-webhook-id
```
### Turning an event into a binary sensor
You can use a trigger-based template entity to convert any event or other automation trigger into a binary sensor. The below configuration will turn on a binary sensor for 5 seconds when the automation trigger triggers.
```yaml
template:
trigger:
platform: event
event_type: my_event
binary_sensor:
- name: Event recently fired
auto_off: 5
state: "true"
```
### Sun Angle
This example shows the sun angle in the frontend.