Remove Emma naptime entities and related code
This commit is contained in:
@ -5132,11 +5132,6 @@
|
|||||||
- input_number.emma_bedtime_hours
|
- input_number.emma_bedtime_hours
|
||||||
id: hours-update
|
id: hours-update
|
||||||
alias: Hours Update
|
alias: Hours Update
|
||||||
- platform: state
|
|
||||||
entity_id:
|
|
||||||
- input_datetime.emma_up_from_nap
|
|
||||||
id: up-from-nap
|
|
||||||
alias: Up From Nap
|
|
||||||
condition:
|
condition:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.emma_sleeping
|
entity_id: input_boolean.emma_sleeping
|
||||||
|
@ -591,38 +591,20 @@
|
|||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro emma_sleep(type,method) %}
|
{% macro emma_sleep(type,method) %}
|
||||||
{% set asleep = state_attr('input_datetime.emma_down_for_nap','timestamp') | int %}
|
{% if is_state('input_boolean.emma_sleeping','on') %}
|
||||||
{% set wakeup = state_attr('input_datetime.emma_up_from_nap','timestamp') | int %}
|
|
||||||
{% set day = now().strftime("%-d") %}
|
|
||||||
{% set asleep_day = asleep | timestamp_custom("%-d") %}
|
|
||||||
{% set wakeup_day = wakeup | timestamp_custom("%-d") %}
|
|
||||||
{% if is_state('input_boolean.emma_sleeping','off') and (is_state('input_boolean.emma_has_napped','on') or ((asleep_day == day) and (wakeup > asleep))) %}
|
|
||||||
Emma napped today for {{ custom_time_between('input_datetime.emma_down_for_nap','input_datetime.emma_up_from_nap','hour,minute') }}. She was retrieved from her room at around {{ input_datetime_read('input_datetime.emma_up_from_nap') | trim }}.
|
|
||||||
{% elif (is_state('input_boolean.emma_has_napped','off') and (((asleep_day == day) and (wakeup_day != day)) or wakeup < asleep)) and is_state('input_boolean.emma_sleeping','on') %}
|
|
||||||
Emma is down for nap. She was put down at around {{ input_datetime_read('input_datetime.emma_down_for_nap') | trim }}. She has been asleep for {{ custom_time('input_datetime.emma_down_for_nap','hour,minute') }}.
|
|
||||||
{% elif is_state('input_boolean.emma_sleeping','on') %}
|
|
||||||
{% if is_state('binary_sensor.early_night_mode','on') %}
|
{% if is_state('binary_sensor.early_night_mode','on') %}
|
||||||
Emma is asleep for the night. She went to bed at {{ input_datetime_read('input_datetime.emma_asleep_at') | trim }}.
|
Emma is asleep for the night. She went to bed at {{ input_datetime_read('input_datetime.emma_asleep_at') | trim }}.
|
||||||
{% else %}
|
{% else %}
|
||||||
Emma has not yet awoken for the day. She went to bed at {{ input_datetime_read('input_datetime.emma_asleep_at') | trim }}. Her wakeup time is scheduled for {{ input_datetime_read('input_datetime.emma_wakeup') | trim }}.
|
Emma has not yet awoken for the day. She went to bed at {{ input_datetime_read('input_datetime.emma_asleep_at') | trim }}. Her wakeup time is scheduled for {{ input_datetime_read('input_datetime.emma_wakeup') | trim }}.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
Emma is awake, and does not appear to have napped yet. She woke up at {{ input_datetime_read('input_datetime.emma_awake_at') | trim }}.
|
Emma is awake. She woke up at {{ input_datetime_read('input_datetime.emma_awake_at') | trim }}.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro emma_sleep_notification(type,method) %}
|
{% macro emma_sleep_notification(type,method) %}
|
||||||
{% set asleep = state_attr('input_datetime.emma_down_for_nap','timestamp') | int %}
|
{% if is_state('input_boolean.emma_sleeping','off') %}
|
||||||
{% set wakeup = state_attr('input_datetime.emma_up_from_nap','timestamp') | int %}
|
|
||||||
{% set day = now().strftime("%-d") %}
|
|
||||||
{% set asleep_day = asleep | timestamp_custom("%-d") %}
|
|
||||||
{% set wakeup_day = wakeup | timestamp_custom("%-d") %}
|
|
||||||
{% if is_state('input_boolean.emma_sleeping','off') and (is_state('input_boolean.emma_has_napped','on') or ((asleep_day == day) and (wakeup > asleep))) %}
|
|
||||||
Emma has awoken. She napped today for {{ custom_time_between('input_datetime.emma_down_for_nap','input_datetime.emma_up_from_nap','hour,minute') }}. She was retrieved from her room at {{ clock('12-hr') }}
|
|
||||||
{% elif is_state('input_boolean.emma_has_napped','off') and is_state('input_boolean.emma_sleeping','off') and ((asleep_day != day) or (wakeup_day != day)) %}
|
|
||||||
Emma has awoken for the day at {{ clock('12-hr') }}
|
Emma has awoken for the day at {{ clock('12-hr') }}
|
||||||
{% elif is_state('input_boolean.emma_has_napped','off') and ((asleep_day == day) and (wakeup_day != day)) and is_state('input_boolean.emma_sleeping','on') %}
|
|
||||||
Emma is being put down for nap. She was put down at {{ clock('12-hr') }}
|
|
||||||
{% elif is_state('input_boolean.emma_sleeping','on') %}
|
{% elif is_state('input_boolean.emma_sleeping','on') %}
|
||||||
Emma is asleep for the night (or at least, her sleep switch is active) at {{ clock('12-hr') }}
|
Emma is asleep for the night (or at least, her sleep switch is active) at {{ clock('12-hr') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -238,13 +238,6 @@ input_select:
|
|||||||
- White Noise
|
- White Noise
|
||||||
- N/A
|
- N/A
|
||||||
icon: mdi:home-thermometer
|
icon: mdi:home-thermometer
|
||||||
naptime_climate_mode_emma_aircon:
|
|
||||||
name: Naptime Climate Mode - Emma Aircon
|
|
||||||
options:
|
|
||||||
- AC
|
|
||||||
- White Noise
|
|
||||||
- N/A
|
|
||||||
icon: mdi:home-thermometer
|
|
||||||
scheduled_climate_mode_kallen_fan:
|
scheduled_climate_mode_kallen_fan:
|
||||||
name: Scheduled Climate Mode - Kallen Fan
|
name: Scheduled Climate Mode - Kallen Fan
|
||||||
options:
|
options:
|
||||||
@ -310,13 +303,6 @@ input_number:
|
|||||||
step: 1
|
step: 1
|
||||||
unit_of_measurement: °F
|
unit_of_measurement: °F
|
||||||
icon: mdi:thermometer
|
icon: mdi:thermometer
|
||||||
emma_naptime_aircon_threshold:
|
|
||||||
name: Emma Naptime Aircon Threshold
|
|
||||||
min: 40
|
|
||||||
max: 80
|
|
||||||
step: 1
|
|
||||||
unit_of_measurement: °F
|
|
||||||
icon: mdi:thermometer
|
|
||||||
kallen_fan_threshold:
|
kallen_fan_threshold:
|
||||||
name: Kallen Fan Threshold
|
name: Kallen Fan Threshold
|
||||||
min: 40
|
min: 40
|
||||||
|
@ -4,9 +4,6 @@ input_boolean:
|
|||||||
emma_sleeping:
|
emma_sleeping:
|
||||||
name: Emma Sleeping
|
name: Emma Sleeping
|
||||||
icon: mdi:sleep
|
icon: mdi:sleep
|
||||||
emma_has_napped:
|
|
||||||
name: Emma Has Napped
|
|
||||||
icon: mdi:check
|
|
||||||
emma_alternating_meds_active:
|
emma_alternating_meds_active:
|
||||||
name: Emma Alternating Meds Active
|
name: Emma Alternating Meds Active
|
||||||
icon: mdi:medication
|
icon: mdi:medication
|
||||||
@ -71,16 +68,6 @@ input_datetime:
|
|||||||
has_date: false
|
has_date: false
|
||||||
has_time: true
|
has_time: true
|
||||||
icon: mdi:weather-sunset-up
|
icon: mdi:weather-sunset-up
|
||||||
emma_down_for_nap:
|
|
||||||
name: Emma Down For Nap
|
|
||||||
has_date: true
|
|
||||||
has_time: true
|
|
||||||
icon: mdi:sleep
|
|
||||||
emma_up_from_nap:
|
|
||||||
name: Emma Up From Nap
|
|
||||||
has_date: true
|
|
||||||
has_time: true
|
|
||||||
icon: mdi:eye
|
|
||||||
# These are for use in remembering which medications she has had when she is sick, and when to safely give them again
|
# These are for use in remembering which medications she has had when she is sick, and when to safely give them again
|
||||||
emma_ibuprofen:
|
emma_ibuprofen:
|
||||||
name: Emma Ibuprofen
|
name: Emma Ibuprofen
|
||||||
@ -145,31 +132,13 @@ automation:
|
|||||||
id: sleep-on
|
id: sleep-on
|
||||||
sequence:
|
sequence:
|
||||||
- service: script.emma_sleep
|
- service: script.emma_sleep
|
||||||
- if:
|
- service: input_datetime.set_datetime
|
||||||
- condition: and
|
target:
|
||||||
conditions:
|
entity_id: input_datetime.emma_asleep_at
|
||||||
- condition: state
|
data:
|
||||||
entity_id: input_boolean.emma_has_napped
|
time: >
|
||||||
state: 'off'
|
{% from 'time.jinja' import current_time %}
|
||||||
- condition: time
|
{{ current_time('time',24) }}
|
||||||
before: "23:00:00"
|
|
||||||
after: "07:00:00"
|
|
||||||
then:
|
|
||||||
- service: input_datetime.set_datetime
|
|
||||||
target:
|
|
||||||
entity_id: input_datetime.emma_down_for_nap
|
|
||||||
data:
|
|
||||||
datetime: >
|
|
||||||
{% from 'time.jinja' import current_time %}
|
|
||||||
{{ current_time('datetime',24) }}
|
|
||||||
else:
|
|
||||||
- service: input_datetime.set_datetime
|
|
||||||
target:
|
|
||||||
entity_id: input_datetime.emma_asleep_at
|
|
||||||
data:
|
|
||||||
time: >
|
|
||||||
{% from 'time.jinja' import current_time %}
|
|
||||||
{{ current_time('time',24) }}
|
|
||||||
- delay:
|
- delay:
|
||||||
seconds: 1
|
seconds: 1
|
||||||
- service: script.text_notify
|
- service: script.text_notify
|
||||||
@ -186,28 +155,6 @@ automation:
|
|||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: sleep-off
|
id: sleep-off
|
||||||
sequence:
|
sequence:
|
||||||
- if:
|
|
||||||
- condition: and
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.emma_has_napped
|
|
||||||
state: 'off'
|
|
||||||
- condition: time
|
|
||||||
after: "18:00:00"
|
|
||||||
before: "01:00:00"
|
|
||||||
then:
|
|
||||||
- service: input_boolean.turn_on
|
|
||||||
target:
|
|
||||||
entity_id: input_boolean.emma_has_napped
|
|
||||||
- service: input_datetime.set_datetime
|
|
||||||
target:
|
|
||||||
entity_id: input_datetime.emma_up_from_nap
|
|
||||||
data:
|
|
||||||
datetime: >
|
|
||||||
{% from 'time.jinja' import current_time %}
|
|
||||||
{{ current_time('datetime',24) }}
|
|
||||||
- delay:
|
|
||||||
seconds: 1
|
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.emma_scheduling_evening_ran
|
entity_id: input_boolean.emma_scheduling_evening_ran
|
||||||
@ -260,41 +207,6 @@ automation:
|
|||||||
target:
|
target:
|
||||||
entity_id: input_boolean.emma_sleeping
|
entity_id: input_boolean.emma_sleeping
|
||||||
|
|
||||||
- id: e44c2ab8-00cd-40ab-9b42-824511ac20aa
|
|
||||||
alias: Emma Naptime Climate
|
|
||||||
description: Sets the climate mode for when Emma goes down for nap
|
|
||||||
mode: restart
|
|
||||||
trigger:
|
|
||||||
- platform: time_pattern
|
|
||||||
minutes: "/5"
|
|
||||||
- platform: state
|
|
||||||
entity_id: input_number.emma_naptime_aircon_threshold
|
|
||||||
- platform: state
|
|
||||||
entity_id: input_boolean.hot_day
|
|
||||||
condition:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.emma_sleeping
|
|
||||||
state: 'off'
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.emma_bedroom_climate_override
|
|
||||||
state: 'off'
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.emma_bedroom_aircon_installed
|
|
||||||
state: 'on'
|
|
||||||
action:
|
|
||||||
- service: input_select.select_option
|
|
||||||
target:
|
|
||||||
entity_id: input_select.naptime_climate_mode_emma_aircon
|
|
||||||
data:
|
|
||||||
option: >
|
|
||||||
{% set temp = state_attr('weather.iron_nerd_weather_station','temperature') | int %}
|
|
||||||
{% set threshold = states('input_number.emma_naptime_aircon_threshold') | int %}
|
|
||||||
{% if (temp >= threshold) or is_state('input_boolean.hot_day','on') %}
|
|
||||||
AC
|
|
||||||
{% else %}
|
|
||||||
White Noise
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
- id: 5b45eeb2-171e-4bac-825b-8ac7aa672dab
|
- id: 5b45eeb2-171e-4bac-825b-8ac7aa672dab
|
||||||
alias: Emma Asleep Update
|
alias: Emma Asleep Update
|
||||||
description: Attempt to make readouts of when Emma went to bed more accurate
|
description: Attempt to make readouts of when Emma went to bed more accurate
|
||||||
@ -310,11 +222,6 @@ automation:
|
|||||||
event_data:
|
event_data:
|
||||||
entity_id: timer.emma_bedtime_update
|
entity_id: timer.emma_bedtime_update
|
||||||
id: bedtime-timer-finished
|
id: bedtime-timer-finished
|
||||||
- platform: event
|
|
||||||
event_type: timer.finished
|
|
||||||
event_data:
|
|
||||||
entity_id: timer.emma_naptime_update
|
|
||||||
id: naptime-timer-finished
|
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: light.emma_bedroom_light
|
entity_id: light.emma_bedroom_light
|
||||||
to: 'off'
|
to: 'off'
|
||||||
@ -325,37 +232,11 @@ automation:
|
|||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: initial
|
id: initial
|
||||||
sequence:
|
sequence:
|
||||||
- choose:
|
- service: timer.start
|
||||||
- conditions:
|
target:
|
||||||
- condition: and
|
entity_id: timer.emma_bedtime_update
|
||||||
conditions:
|
data:
|
||||||
- condition: state
|
duration: "01:00:00"
|
||||||
entity_id: input_boolean.emma_has_napped
|
|
||||||
state: 'off'
|
|
||||||
- condition: time
|
|
||||||
before: "23:00:00"
|
|
||||||
after: "07:00:00"
|
|
||||||
sequence:
|
|
||||||
- service: timer.start
|
|
||||||
target:
|
|
||||||
entity_id: timer.emma_naptime_update
|
|
||||||
data:
|
|
||||||
duration: "01:00:00"
|
|
||||||
- conditions:
|
|
||||||
- condition: or
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.emma_has_napped
|
|
||||||
state: 'on'
|
|
||||||
- condition: time
|
|
||||||
after: "23:00:00"
|
|
||||||
before: "07:00:00"
|
|
||||||
sequence:
|
|
||||||
- service: timer.start
|
|
||||||
target:
|
|
||||||
entity_id: timer.emma_bedtime_update
|
|
||||||
data:
|
|
||||||
duration: "01:00:00"
|
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: lights-off
|
id: lights-off
|
||||||
@ -364,71 +245,18 @@ automation:
|
|||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- timer.emma_bedtime_update
|
- timer.emma_bedtime_update
|
||||||
- timer.emma_naptime_update
|
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.emma_sleeping
|
entity_id: input_boolean.emma_sleeping
|
||||||
state: 'on'
|
state: 'on'
|
||||||
then:
|
then:
|
||||||
- choose:
|
|
||||||
- conditions:
|
|
||||||
- condition: and
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.emma_has_napped
|
|
||||||
state: 'off'
|
|
||||||
- condition: time
|
|
||||||
before: "23:00:00"
|
|
||||||
after: "07:00:00"
|
|
||||||
sequence:
|
|
||||||
- service: input_datetime.set_datetime
|
|
||||||
target:
|
|
||||||
entity_id: input_datetime.emma_down_for_nap
|
|
||||||
data:
|
|
||||||
datetime: >
|
|
||||||
{% from 'time.jinja' import current_time %}
|
|
||||||
{{ current_time('datetime',24) }}
|
|
||||||
- conditions:
|
|
||||||
- condition: or
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.emma_has_napped
|
|
||||||
state: 'on'
|
|
||||||
- condition: time
|
|
||||||
after: "23:00:00"
|
|
||||||
before: "07:00:00"
|
|
||||||
sequence:
|
|
||||||
- service: input_datetime.set_datetime
|
|
||||||
target:
|
|
||||||
entity_id: input_datetime.emma_asleep_at
|
|
||||||
data:
|
|
||||||
time: >
|
|
||||||
{% from 'time.jinja' import current_time %}
|
|
||||||
{{ current_time('time',24) }}
|
|
||||||
- conditions:
|
|
||||||
- condition: trigger
|
|
||||||
id: naptime-timer-finished
|
|
||||||
sequence:
|
|
||||||
- if:
|
|
||||||
- condition: state
|
|
||||||
entity_id: light.emma_bedroom_light
|
|
||||||
state: 'on'
|
|
||||||
then:
|
|
||||||
- delay:
|
|
||||||
seconds: 1
|
|
||||||
- service: timer.start
|
|
||||||
target:
|
|
||||||
entity_id: timer.emma_naptime_update
|
|
||||||
data:
|
|
||||||
duration: "01:00:00"
|
|
||||||
else:
|
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
entity_id: input_datetime.emma_down_for_nap
|
entity_id: input_datetime.emma_asleep_at
|
||||||
data:
|
data:
|
||||||
datetime: >
|
time: >
|
||||||
{% from 'time.jinja' import current_time %}
|
{% from 'time.jinja' import current_time %}
|
||||||
{{ current_time('datetime',24) }}
|
{{ current_time('time',24) }}
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: bedtime-timer-finished
|
id: bedtime-timer-finished
|
||||||
@ -986,18 +814,13 @@ script:
|
|||||||
who: basement
|
who: basement
|
||||||
type: normal
|
type: normal
|
||||||
message: Emma has awoken, so it is time to make your way upstairs now
|
message: Emma has awoken, so it is time to make your way upstairs now
|
||||||
- if:
|
- service: input_datetime.set_datetime
|
||||||
- condition: time
|
target:
|
||||||
before: "18:00:00"
|
entity_id: input_datetime.emma_awake_at
|
||||||
after: "07:00:00"
|
data:
|
||||||
then:
|
time: >
|
||||||
- service: input_datetime.set_datetime
|
{% from 'time.jinja' import current_time %}
|
||||||
target:
|
{{ current_time('time',24) }}
|
||||||
entity_id: input_datetime.emma_awake_at
|
|
||||||
data:
|
|
||||||
time: >
|
|
||||||
{% from 'time.jinja' import current_time %}
|
|
||||||
{{ current_time('time',24) }}
|
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
|
@ -697,9 +697,6 @@ script:
|
|||||||
emma_bedroom_scheduling_morning:
|
emma_bedroom_scheduling_morning:
|
||||||
alias: 'Emma Bedroom Scheduling Morning'
|
alias: 'Emma Bedroom Scheduling Morning'
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_boolean.turn_off
|
|
||||||
target:
|
|
||||||
entity_id: input_boolean.emma_has_napped
|
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.emma_wakeup_override
|
entity_id: input_boolean.emma_wakeup_override
|
||||||
@ -709,11 +706,6 @@ script:
|
|||||||
entity_id: input_datetime.emma_wakeup
|
entity_id: input_datetime.emma_wakeup
|
||||||
data:
|
data:
|
||||||
time: "{{ states('input_datetime.master_bedroom_wakeup') }}"
|
time: "{{ states('input_datetime.master_bedroom_wakeup') }}"
|
||||||
- service: input_select.select_option
|
|
||||||
target:
|
|
||||||
entity_id: input_select.naptime_climate_mode_emma_aircon
|
|
||||||
data:
|
|
||||||
option: "{{ states('input_select.scheduled_climate_mode_emma_aircon') }}"
|
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: input_boolean.emma_scheduling_morning_ran
|
entity_id: input_boolean.emma_scheduling_morning_ran
|
||||||
@ -731,15 +723,9 @@ script:
|
|||||||
data:
|
data:
|
||||||
time: >
|
time: >
|
||||||
{% set awake = state_attr('input_datetime.emma_awake_at','timestamp') | int %}
|
{% set awake = state_attr('input_datetime.emma_awake_at','timestamp') | int %}
|
||||||
{% set up_from_nap = state_attr('input_datetime.emma_up_from_nap','timestamp') | int %}
|
|
||||||
{% set hours = states('input_number.emma_bedtime_hours') | int %}
|
{% set hours = states('input_number.emma_bedtime_hours') | int %}
|
||||||
{% set math = (hours * 60) * 60 %}
|
{% set math = (hours * 60) * 60 %}
|
||||||
{% set math_nap = 14400 %}
|
{{ (awake + math) | timestamp_custom('%H:%M',false) }}
|
||||||
{% if is_state('input_boolean.emma_has_napped','on') %}
|
|
||||||
{{ (up_from_nap + math_nap) | timestamp_custom('%H:%M') }}
|
|
||||||
{% else %}
|
|
||||||
{{ (awake + math) | timestamp_custom('%H:%M',false) }}
|
|
||||||
{% endif %}
|
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.emma_bedroom_climate_override
|
entity_id: input_boolean.emma_bedroom_climate_override
|
||||||
|
195
scripts.yaml
195
scripts.yaml
@ -2830,162 +2830,95 @@ emma_sleep:
|
|||||||
after: 04:00:00
|
after: 04:00:00
|
||||||
before: '17:00:00'
|
before: '17:00:00'
|
||||||
then:
|
then:
|
||||||
- service: script.emma_bedroom_scheduling_evening
|
- data: {}
|
||||||
data: {}
|
action: script.emma_bedroom_scheduling_evening
|
||||||
alias: Run scheduling if it hasn't already been run
|
alias: Run scheduling if it hasn't already been run
|
||||||
- service: script.turn_off
|
- target:
|
||||||
target:
|
|
||||||
entity_id:
|
entity_id:
|
||||||
- script.emma_ibuprofen
|
- script.emma_ibuprofen
|
||||||
- script.emma_tylenol
|
- script.emma_tylenol
|
||||||
- script.emma_cough_meds
|
- script.emma_cough_meds
|
||||||
data: {}
|
data: {}
|
||||||
alias: Reset med trackers
|
alias: Reset med trackers
|
||||||
- service: light.turn_on
|
action: script.turn_off
|
||||||
target:
|
- target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- light.emma_bedroom_light
|
- light.emma_bedroom_light
|
||||||
data: {}
|
data: {}
|
||||||
alias: Turn on light
|
alias: Turn on light
|
||||||
|
action: light.turn_on
|
||||||
- delay:
|
- delay:
|
||||||
seconds: 1
|
seconds: 1
|
||||||
- service: input_select.select_option
|
- target:
|
||||||
target:
|
|
||||||
entity_id:
|
entity_id:
|
||||||
- input_select.emma_bedroom_scenes
|
- input_select.emma_bedroom_scenes
|
||||||
data:
|
data:
|
||||||
option: Adaptive
|
option: Adaptive
|
||||||
alias: Set lights to adaptive
|
alias: Set lights to adaptive
|
||||||
- alias: Climate Controls
|
action: input_select.select_option
|
||||||
|
- alias: Select climate mode
|
||||||
choose:
|
choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
- alias: If Emma has napped or it is clearly bedtime
|
- alias: AC
|
||||||
condition: or
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.emma_has_napped
|
|
||||||
state: 'on'
|
|
||||||
alias: Emma has napped
|
|
||||||
- condition: time
|
|
||||||
after: '23:00:00'
|
|
||||||
before: 04:00:00
|
|
||||||
alias: It is definitely bedtime
|
|
||||||
sequence:
|
|
||||||
- alias: Select climate mode
|
|
||||||
choose:
|
|
||||||
- conditions:
|
|
||||||
- alias: AC
|
|
||||||
condition: and
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_select.scheduled_climate_mode_emma_aircon
|
|
||||||
state: AC
|
|
||||||
alias: Scheduled mode is AC
|
|
||||||
- condition: state
|
|
||||||
entity_id: fan.emma_air_conditioner
|
|
||||||
state: 'off'
|
|
||||||
alias: Air conditioner is not already on
|
|
||||||
sequence:
|
|
||||||
- service: fan.turn_on
|
|
||||||
target:
|
|
||||||
entity_id: fan.emma_air_conditioner
|
|
||||||
data: {}
|
|
||||||
alias: Turn on air conditioner
|
|
||||||
- service: script.text_notify
|
|
||||||
data:
|
|
||||||
who: parents
|
|
||||||
title: Emma Climate Schedule
|
|
||||||
message: The air conditioner in Emma's Bedroom has been activated.
|
|
||||||
type: normal
|
|
||||||
tag: emma-climate
|
|
||||||
alias: Send AC notification
|
|
||||||
- conditions:
|
|
||||||
- alias: White Noise
|
|
||||||
condition: and
|
|
||||||
conditions:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_select.scheduled_climate_mode_emma_aircon
|
|
||||||
state: White Noise
|
|
||||||
alias: Scheduled mode is White Noise
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.white_noise_emma_bedroom
|
|
||||||
state: 'off'
|
|
||||||
alias: White Noise is not already on
|
|
||||||
sequence:
|
|
||||||
- service: input_boolean.turn_on
|
|
||||||
target:
|
|
||||||
entity_id: input_boolean.white_noise_emma_bedroom
|
|
||||||
data: {}
|
|
||||||
alias: Turn on white noise
|
|
||||||
- service: script.text_notify
|
|
||||||
data:
|
|
||||||
who: parents
|
|
||||||
title: Emma Climate Schedule
|
|
||||||
message: White noise has been activated in Emma's Bedroom.
|
|
||||||
type: normal
|
|
||||||
tag: emma-climate
|
|
||||||
alias: Send white noise notification
|
|
||||||
default:
|
|
||||||
- service: script.text_notify
|
|
||||||
data:
|
|
||||||
who: parents
|
|
||||||
title: Emma Climate Schedule
|
|
||||||
message: No option selected for Emma's climate mode. No devices will be
|
|
||||||
activated.
|
|
||||||
type: normal
|
|
||||||
tag: emma-climate
|
|
||||||
alias: Send notification that no climate mode is selected
|
|
||||||
- conditions:
|
|
||||||
- alias: If Emma has NOT napped and the time is appropriate
|
|
||||||
condition: and
|
condition: and
|
||||||
conditions:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.emma_has_napped
|
entity_id: input_select.scheduled_climate_mode_emma_aircon
|
||||||
|
state: AC
|
||||||
|
alias: Scheduled mode is AC
|
||||||
|
- condition: state
|
||||||
|
entity_id: fan.emma_air_conditioner
|
||||||
state: 'off'
|
state: 'off'
|
||||||
alias: Emma has not napped
|
alias: Air conditioner is not already on
|
||||||
- condition: time
|
|
||||||
before: '23:00:00'
|
|
||||||
after: 04:00:00
|
|
||||||
alias: It is not bedtime
|
|
||||||
sequence:
|
sequence:
|
||||||
- alias: Select naptime climate mode
|
- target:
|
||||||
choose:
|
entity_id: fan.emma_air_conditioner
|
||||||
- conditions:
|
data: {}
|
||||||
- alias: AC
|
alias: Turn on air conditioner
|
||||||
condition: and
|
action: fan.turn_on
|
||||||
conditions:
|
- data:
|
||||||
- condition: state
|
who: parents
|
||||||
entity_id: input_select.naptime_climate_mode_emma_aircon
|
title: Emma Climate Schedule
|
||||||
state: AC
|
message: The air conditioner in Emma's Bedroom has been activated.
|
||||||
alias: Scheduled naptime mode is AC
|
type: normal
|
||||||
- condition: state
|
tag: emma-climate
|
||||||
entity_id: fan.emma_air_conditioner
|
alias: Send AC notification
|
||||||
state: 'off'
|
action: script.text_notify
|
||||||
alias: Air conditioner is not already on
|
- conditions:
|
||||||
sequence:
|
- alias: White Noise
|
||||||
- service: fan.turn_on
|
condition: and
|
||||||
target:
|
conditions:
|
||||||
entity_id: fan.emma_air_conditioner
|
- condition: state
|
||||||
data: {}
|
entity_id: input_select.scheduled_climate_mode_emma_aircon
|
||||||
alias: Turn on AC
|
state: White Noise
|
||||||
- conditions:
|
alias: Scheduled mode is White Noise
|
||||||
- alias: White Noise
|
- condition: state
|
||||||
condition: and
|
entity_id: input_boolean.white_noise_emma_bedroom
|
||||||
conditions:
|
state: 'off'
|
||||||
- condition: state
|
alias: White Noise is not already on
|
||||||
entity_id: input_select.naptime_climate_mode_emma_aircon
|
sequence:
|
||||||
state: White Noise
|
- target:
|
||||||
alias: Scheduled naptime mode is White Noise
|
entity_id: input_boolean.white_noise_emma_bedroom
|
||||||
- condition: state
|
data: {}
|
||||||
entity_id: input_boolean.white_noise_emma_bedroom
|
alias: Turn on white noise
|
||||||
state: 'off'
|
action: input_boolean.turn_on
|
||||||
alias: White Noise is not already on
|
- data:
|
||||||
sequence:
|
who: parents
|
||||||
- service: input_boolean.turn_on
|
title: Emma Climate Schedule
|
||||||
target:
|
message: White noise has been activated in Emma's Bedroom.
|
||||||
entity_id: input_boolean.white_noise_emma_bedroom
|
type: normal
|
||||||
data: {}
|
tag: emma-climate
|
||||||
alias: Turn on white noise
|
alias: Send white noise notification
|
||||||
|
action: script.text_notify
|
||||||
|
default:
|
||||||
|
- data:
|
||||||
|
who: parents
|
||||||
|
title: Emma Climate Schedule
|
||||||
|
message: No option selected for Emma's climate mode. No devices will be activated.
|
||||||
|
type: normal
|
||||||
|
tag: emma-climate
|
||||||
|
alias: Send notification that no climate mode is selected
|
||||||
|
action: script.text_notify
|
||||||
icon: mdi:lightbulb-night
|
icon: mdi:lightbulb-night
|
||||||
mode: restart
|
mode: restart
|
||||||
tina_morning_meds:
|
tina_morning_meds:
|
||||||
|
Reference in New Issue
Block a user