From a99784324ca7082ced61ec8921a140a061a00387 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 20 Jul 2021 23:35:22 -0700 Subject: [PATCH] Add event to binary sensor example (#18567) --- source/_integrations/template.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/_integrations/template.markdown b/source/_integrations/template.markdown index 90a337a6642..6904ba4337a 100644 --- a/source/_integrations/template.markdown +++ b/source/_integrations/template.markdown @@ -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.