232 lines
6.5 KiB
YAML
232 lines
6.5 KiB
YAML
# This file is for entities/automations that are specific to Tina
|
|
|
|
input_boolean:
|
|
work_today:
|
|
name: Work Today
|
|
icon: mdi:briefcase
|
|
work_today_extended:
|
|
name: Work Today Extended
|
|
icon: mdi:briefcase-plus
|
|
tina_morning_meds_reminder:
|
|
name: Tina Morning Meds Reminder
|
|
icon: mdi:medication
|
|
tina_morning_meds_taken:
|
|
name: Tina Morning Meds Taken
|
|
icon: mdi:medication
|
|
tina_night_meds_reminder:
|
|
name: Tina Night Meds Reminder
|
|
icon: mdi:medication
|
|
tina_night_meds_taken:
|
|
name: Tina Night Meds Taken
|
|
icon: mdi:medication
|
|
tina_ibuprofen_active:
|
|
name: Tina Ibuprofen Active
|
|
icon: mdi:medication
|
|
tina_ibuprofen_taken:
|
|
name: Tina Ibuprofen Taken
|
|
icon: mdi:medication
|
|
tina_tylenol_active:
|
|
name: Tina Tylenol Active
|
|
icon: mdi:medication
|
|
tina_tylenol_taken:
|
|
name: Tina Tylenol Taken
|
|
icon: mdi:medication
|
|
tina_awake:
|
|
name: Tina Awake
|
|
icon: mdi:eye-check
|
|
|
|
input_datetime:
|
|
tina_workday_start:
|
|
name: Tina Workday Start
|
|
has_date: false
|
|
has_time: true
|
|
icon: mdi:briefcase
|
|
tina_workday_end:
|
|
name: Tina Workday End
|
|
has_date: false
|
|
has_time: true
|
|
icon: mdi:briefcase-off
|
|
tina_morning_meds_taken:
|
|
name: Tina Morning Meds Taken
|
|
has_date: true
|
|
has_time: true
|
|
icon: mdi:medication
|
|
tina_morning_meds_notify:
|
|
name: Tina Morning Meds Notify
|
|
has_date: true
|
|
has_time: true
|
|
icon: mdi:medication
|
|
tina_night_meds_taken:
|
|
name: Tina Night Meds Taken
|
|
has_date: true
|
|
has_time: true
|
|
icon: mdi:medication
|
|
tina_night_meds_notify:
|
|
name: Tina Night Meds Notify
|
|
has_date: true
|
|
has_time: true
|
|
icon: mdi:medication
|
|
tina_ibuprofen_taken:
|
|
name: Tina Ibuprofen Taken
|
|
has_date: true
|
|
has_time: true
|
|
icon: mdi:medication
|
|
tina_ibuprofen_notify:
|
|
name: Tina Ibuprofen Notify
|
|
has_date: true
|
|
has_time: true
|
|
icon: mdi:medication
|
|
tina_tylenol_taken:
|
|
name: Tina Tylenol Taken
|
|
has_date: true
|
|
has_time: true
|
|
icon: mdi:medication
|
|
tina_tylenol_notify:
|
|
name: Tina Tylenol Notify
|
|
has_date: true
|
|
has_time: true
|
|
icon: mdi:medication
|
|
|
|
automation:
|
|
- id: cd9f921f-71c7-4e29-9aee-7421ef19bdd3
|
|
alias: Work Today
|
|
initial_state: true
|
|
trigger:
|
|
- platform: time
|
|
at: '03:55:00'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.tina_work_schedule_override
|
|
state: 'off'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.work_today_extended
|
|
- if:
|
|
- condition: template
|
|
value_template: >
|
|
{% from 'time.jinja' import calendar_event_today %}
|
|
{{ calendar_event_today('calendar.family_tinawork') }}
|
|
then:
|
|
- service: script.tina_work_today
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.work_today_ran
|
|
|
|
- id: a6eeb075-d21b-436c-983f-39188ee9b016
|
|
alias: Work Reset
|
|
initial_state: true
|
|
trigger:
|
|
- platform: zone
|
|
entity_id: person.christina_stork
|
|
zone: zone.home
|
|
event: enter
|
|
id: home
|
|
variables:
|
|
reason: "{{ trigger.id }}"
|
|
- platform: time
|
|
at: input_datetime.tina_workday_end
|
|
id: end
|
|
variables:
|
|
reason: "{{ trigger.id }}"
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.work_today
|
|
state: 'on'
|
|
- condition: time
|
|
after: "15:00:00"
|
|
before: "01:00:00"
|
|
action:
|
|
- service: script.tina_work_reset
|
|
data:
|
|
reason: "{{ reason }}"
|
|
|
|
script:
|
|
tina_work_today:
|
|
alias: 'Tina Work Today'
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tina_workday_start
|
|
data:
|
|
time: >
|
|
{% from 'time.jinja' import time_from_calendar %}
|
|
{{ time_from_calendar('calendar.family_tinawork','start_time','set') }}
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tina_workday_end
|
|
data:
|
|
time: >
|
|
{% from 'time.jinja' import time_from_calendar %}
|
|
{{ time_from_calendar('calendar.family_tinawork','end_time','set') }}
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id:
|
|
- input_boolean.work_today
|
|
- input_boolean.work_today_extended
|
|
|
|
tina_work_reset:
|
|
alias: 'Tina Work Reset'
|
|
variables:
|
|
reason: '{{ reason|default("{}") }}'
|
|
sequence:
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: "{{ reason == 'home' }}"
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.work_today
|
|
- conditions:
|
|
- condition: template
|
|
value_template: "{{ reason == 'end' }}"
|
|
sequence:
|
|
- if:
|
|
- condition: template
|
|
value_template: "{{ states('person.christina_stork') not in ['Bob Evans','BobEvans'] }}"
|
|
then:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.work_today
|
|
default:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.work_today
|
|
|
|
# This is in case her schedule changes after the regular 4:00AM scheduling scripts run
|
|
tina_schedule_change:
|
|
alias: 'Tina Schedule Change'
|
|
sequence:
|
|
- if:
|
|
- condition: template
|
|
value_template: >
|
|
{% from 'time.jinja' import calendar_event_today %}
|
|
{{ calendar_event_today('calendar.family_tinawork') }}
|
|
then:
|
|
- service: script.tina_work_today
|
|
else:
|
|
- service: script.tina_work_reset
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.work_today_extended
|
|
- choose:
|
|
- conditions:
|
|
- condition: time
|
|
after: "04:00:00"
|
|
before: "16:00:00"
|
|
sequence:
|
|
- service: script.house_scheduling_morning
|
|
- service: script.emma_bedroom_scheduling_morning
|
|
- service: script.master_bedroom_scheduling_morning
|
|
- service: script.security_scheduling
|
|
- conditions:
|
|
- condition: time
|
|
after: "16:00:00"
|
|
before: "04:00:00"
|
|
sequence:
|
|
- service: script.house_scheduling_evening
|
|
- service: script.master_bedroom_scheduling_evening
|
|
- service: script.emma_bedroom_scheduling_evening
|
|
- service: script.security_scheduling
|