Created
August 5, 2023 15:29
-
-
Save Didgeridrew/b2797852f273defcaad780a925906948 to your computer and use it in GitHub Desktop.
HA - Trigger based on Alexa alarm with offset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias: Pre-Alexa alarm trigger template | |
| description: "" | |
| trigger: | |
| - platform: template | |
| value_template: >- | |
| {% set alarm_time = states('sensor.amanda_s_living_room_dot_next_alarm') | | |
| as_datetime %} | |
| {% if alarm_time != None %} | |
| {% set mins_before = 2 %} | |
| {{ now() >= alarm_time - timedelta(minutes=mins_before) }} | |
| {% else %} False {% endif %} | |
| condition: [] | |
| action: | |
| - service: light.turn_on | |
| data: {} | |
| target: | |
| entity_id: light.behind_tv | |
| mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment