Split the rest of events.yaml into two individual files

This commit is contained in:
2023-01-31 20:02:42 -05:00
parent 97ab110ee1
commit 8afb74de66
3 changed files with 120 additions and 148 deletions

52
packages/tony.yaml Normal file
View File

@ -0,0 +1,52 @@
# This file is for entities/automations that are specific to Tony
input_boolean:
tony_streaming_today:
name: Tony Streaming Today
icon: mdi:twitch
automation:
- id: 77f33070-4405-41b6-84c4-05b4f3697199
alias: Tony Stream Today
initial_state: true
trigger:
- platform: time
at: '08:00:00'
condition:
- condition: template
value_template: >
{%- if as_timestamp(strptime(state_attr('calendar.tony_s_twitch_schedule','start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%Y-%m-%d") == now().strftime("%Y-%m-%d") %}
true
{%- endif -%}
action:
- service: script.tony_stream_today
- id: 465ec4be-8e6c-444b-bfe7-6d4796888be4
alias: Tony Stream Reset
initial_state: true
trigger:
- platform: state
entity_id: sensor.twitch_ironnerd24
from: 'streaming'
to: 'offline'
action:
- service: script.tony_stream_reset
script:
tony_stream_today:
alias: 'Tony Stream Today'
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tony_streaming_start_time
data:
time: >
{{ as_timestamp(strptime(state_attr('calendar.tony_s_twitch_schedule','start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%H:%M") }}
- service: input_boolean.turn_on
entity_id: input_boolean.tony_streaming_today
tony_stream_reset:
alias: 'Tony Stream Reset'
sequence:
- service: input_boolean.turn_off
entity_id: input_boolean.tony_streaming_today