Migrate my personal automations and scripts #154

This commit is contained in:
2023-10-02 20:46:08 -04:00
parent c15e1b6289
commit 1afa59747f
3 changed files with 323 additions and 280 deletions

View File

@ -1778,6 +1778,222 @@ bright_mode_in_tina_desk:
brightness: 255
mode: restart
icon: mdi:palette
tony_morning_meds:
alias: Tony Morning Meds
icon: mdi:medication
mode: restart
sequence:
- service: script.text_notify
data:
who: tony
type: alert
title: Morning Meds
message: You need to take your morning meds
tag: tony-morning-meds
actions:
- action: TONY_MORNING_MEDS_TAKEN
title: Taken
- action: TONY_MORNING_MEDS_SKIPPED
title: Skip
- action: TONY_MORNING_MEDS_ASK_LATER
title: Ask Later
- wait_for_trigger:
- platform: event
event_type: ios.notification_action_fired
event_data:
actionName: TONY_MORNING_MEDS_TAKEN
id: taken
alias: Taken
- platform: event
event_type: ios.notification_action_fired
event_data:
actionName: TONY_MORNING_MEDS_SKIPPED
id: skipped
alias: Skipped
- platform: event
event_type: ios.notification_action_fired
event_data:
actionName: TONY_MORNING_MEDS_ASK_LATER
id: ask-later
alias: Ask Later
- platform: state
entity_id: person.tony_stork
from: home
id: left
alias: Left
- platform: state
entity_id: input_boolean.tony_morning_meds_taken
to: 'on'
id: manual
alias: Manual
timeout: 00:30:00
continue_on_timeout: true
- choose:
- conditions:
- condition: template
value_template: '{{ wait.trigger.id in [''taken'',''manual''] }}'
alias: Taken, Manual
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.tony_morning_meds_taken
data: {}
- conditions:
- condition: template
value_template: '{{ wait.trigger.id == ''ask-later'' }}'
alias: Ask Later
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tony_morning_meds_notify
data:
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
}}
'
- conditions:
- condition: template
value_template: '{{ wait.trigger.id == ''left'' }}'
alias: Left
sequence:
- service: script.text_notify
data:
who: tony
type: critical
title: HEY DUMBASS
message: YOU FORGOT TO TAKE YOUR MORNING MEDS!!!!!
- conditions:
- condition: template
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
}}'
alias: None or undefined
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tony_morning_meds_notify
data:
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,1)
}}
'
- service: script.text_notify
data:
type: alert
who: tony
message: clear_notification
tag: tony-morning-meds
tony_night_meds:
alias: Tony Night Meds
icon: mdi:medication
mode: restart
sequence:
- service: script.text_notify
data:
who: tony
type: alert
title: Night Meds
message: You need to take your night meds
tag: tony-night-meds
actions:
- action: TONY_NIGHT_MEDS_TAKEN
title: Taken
- action: TONY_NIGHT_MEDS_SKIPPED
title: Skip
- action: TONY_NIGHT_MEDS_ASK_LATER
title: Ask Later
- wait_for_trigger:
- platform: event
event_type: ios.notification_action_fired
event_data:
actionName: TONY_NIGHT_MEDS_TAKEN
id: taken
alias: Taken
- platform: event
event_type: ios.notification_action_fired
event_data:
actionName: TONY_NIGHT_MEDS_SKIPPED
id: skipped
alias: Skipped
- platform: event
event_type: ios.notification_action_fired
event_data:
actionName: TONY_NIGHT_MEDS_ASK_LATER
id: ask-later
alias: Ask Later
- platform: state
entity_id: input_boolean.tony_night_meds_taken
to: 'on'
id: manual
alias: Manual
timeout: 00:30:00
continue_on_timeout: true
- choose:
- conditions:
- condition: template
value_template: '{{ wait.trigger.id in [''taken'',''manual''] }}'
alias: Taken, Manual
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.tony_night_meds_taken
data: {}
- conditions:
- condition: template
value_template: '{{ wait.trigger.id == ''ask-later'' }}'
alias: Ask Later
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tony_night_meds_notify
data:
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
}}
'
- conditions:
- condition: template
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
}}'
alias: None or undefined
sequence:
- if:
- condition: and
conditions:
- condition: state
entity_id: person.tony_stork
state: home
- condition: state
entity_id: binary_sensor.morning
state: 'off'
then:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tony_night_meds_notify
data:
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,1)
}}
'
- service: script.text_notify
data:
type: alert
who: tony
message: clear_notification
tag: tony-night-meds
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 time_from_calendar %} {{ time_from_calendar(''calendar.tony_s_twitch_schedule'',''start_time'',''set'')
}}
'
- service: input_boolean.turn_on
entity_id: input_boolean.tony_streaming_today
mode: single
timer_modify:
alias: Timer Modify
description: For adding/subtracting time from a running timer