78 lines
2.1 KiB
YAML
78 lines
2.1 KiB
YAML
# This file is for entities/automations that are specific to Tony
|
|
|
|
input_boolean:
|
|
tony_streaming_today:
|
|
name: Tony Streaming Today
|
|
icon: mdi:twitch
|
|
|
|
input_datetime:
|
|
tony_streaming_start_time:
|
|
name: Tony Streaming Start Time
|
|
has_date: false
|
|
has_time: true
|
|
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: >
|
|
{% from 'time.jinja' import calendar_event_today %}
|
|
{{ calendar_event_today('calendar.tony_s_twitch_schedule') }}
|
|
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'
|
|
id: offline
|
|
- platform: time
|
|
at: "06:00:00"
|
|
id: time
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: trigger
|
|
id: offline
|
|
sequence:
|
|
- service: script.tony_stream_reset
|
|
- conditions:
|
|
- condition: trigger
|
|
id: time
|
|
sequence:
|
|
- if:
|
|
- condition: state
|
|
entity_id: sensor.twitch_ironnerd24
|
|
state: 'offline'
|
|
then:
|
|
- 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: >
|
|
{% from 'time.jinja' import set_time_from_calendar %}
|
|
{{ set_time_from_calendar('calendar.tony_s_twitch_schedule','start_time') }}
|
|
- 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 |