Man, I really Bethesda'd this one... #130
This commit is contained in:
@ -470,15 +470,21 @@ automation:
|
|||||||
- platform: time
|
- platform: time
|
||||||
at: input_datetime.emma_cough_meds_notify
|
at: input_datetime.emma_cough_meds_notify
|
||||||
id: cough-notify
|
id: cough-notify
|
||||||
condition:
|
- platform: state
|
||||||
- condition: or
|
entity_id: input_boolean.emma_ibuprofen
|
||||||
conditions:
|
from: 'off'
|
||||||
- condition: state
|
to: 'on'
|
||||||
entity_id: input_boolean.emma_alternating_meds_active
|
id: ibuprofen-on
|
||||||
state: 'on'
|
- platform: state
|
||||||
- condition: state
|
entity_id: input_boolean.emma_tylenol
|
||||||
entity_id: input_boolean.emma_cough_meds_active
|
from: 'off'
|
||||||
state: 'on'
|
to: 'on'
|
||||||
|
id: tylenol-on
|
||||||
|
- platform: state
|
||||||
|
entity_id: input_boolean.emma_cough_meds
|
||||||
|
from: 'off'
|
||||||
|
to: 'on'
|
||||||
|
id: cough-on
|
||||||
action:
|
action:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
@ -552,7 +558,7 @@ script:
|
|||||||
max: 10
|
max: 10
|
||||||
sequence:
|
sequence:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions: "{{ reason == 'ibuprofen-notify' }}"
|
- conditions: "{{ reason == 'ibuprofen-notify' and is_state('input_boolean.emma_sleeping','off') }}"
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
target:
|
target:
|
||||||
@ -571,11 +577,11 @@ script:
|
|||||||
tag: emma-ibuprofen
|
tag: emma-ibuprofen
|
||||||
actions:
|
actions:
|
||||||
- action: "EMMA_IBUPROFEN_GIVEN"
|
- action: "EMMA_IBUPROFEN_GIVEN"
|
||||||
name: Given
|
title: Given
|
||||||
- action: "EMMA_IBUPROFEN_SKIPPED"
|
- action: "EMMA_IBUPROFEN_SKIPPED"
|
||||||
name: Skipped
|
title: Skipped
|
||||||
- action: "EMMA_IBUPROFEN_ASK_LATER"
|
- action: "EMMA_IBUPROFEN_ASK_LATER"
|
||||||
name: Ask Later
|
title: Ask Later
|
||||||
- wait_for_trigger:
|
- wait_for_trigger:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: ios.notification_action_fired
|
event_type: ios.notification_action_fired
|
||||||
@ -656,8 +662,8 @@ script:
|
|||||||
entity_id: input_datetime.emma_ibuprofen
|
entity_id: input_datetime.emma_ibuprofen
|
||||||
data:
|
data:
|
||||||
datetime: >
|
datetime: >
|
||||||
{% from 'time.jinja' import set_datetime %}
|
{% from 'time.jinja' import current_time %}
|
||||||
{{ set_datetime(0) }}
|
{{ current_time(24,'withdate') }}
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
entity_id: input_datetime.emma_ibuprofen_notify
|
entity_id: input_datetime.emma_ibuprofen_notify
|
||||||
@ -681,7 +687,7 @@ script:
|
|||||||
max: 10
|
max: 10
|
||||||
sequence:
|
sequence:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions: "{{ reason == 'tylenol-notify' }}"
|
- conditions: "{{ reason == 'tylenol-notify' and is_state('input_boolean.emma_sleeping','off') }}"
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
target:
|
target:
|
||||||
@ -700,11 +706,11 @@ script:
|
|||||||
tag: emma-tylenol
|
tag: emma-tylenol
|
||||||
actions:
|
actions:
|
||||||
- action: "EMMA_TYLENOL_GIVEN"
|
- action: "EMMA_TYLENOL_GIVEN"
|
||||||
name: Given
|
title: Given
|
||||||
- action: "EMMA_TYLENOL_SKIPPED"
|
- action: "EMMA_TYLENOL_SKIPPED"
|
||||||
name: Skipped
|
title: Skipped
|
||||||
- action: "EMMA_TYLENOL_ASK_LATER"
|
- action: "EMMA_TYLENOL_ASK_LATER"
|
||||||
name: Ask Later
|
title: Ask Later
|
||||||
- wait_for_trigger:
|
- wait_for_trigger:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: ios.notification_action_fired
|
event_type: ios.notification_action_fired
|
||||||
@ -758,7 +764,7 @@ script:
|
|||||||
{{ set_datetime(0,30) }}
|
{{ set_datetime(0,30) }}
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
entity_id: input_datetime.emma_ibuprofen_notify
|
entity_id: input_datetime.emma_tylenol_notify
|
||||||
data:
|
data:
|
||||||
datetime: >
|
datetime: >
|
||||||
{% from 'time.jinja' import set_datetime %}
|
{% from 'time.jinja' import set_datetime %}
|
||||||
@ -785,8 +791,8 @@ script:
|
|||||||
entity_id: input_datetime.emma_tylenol
|
entity_id: input_datetime.emma_tylenol
|
||||||
data:
|
data:
|
||||||
datetime: >
|
datetime: >
|
||||||
{% from 'time.jinja' import set_datetime %}
|
{% from 'time.jinja' import current_time %}
|
||||||
{{ set_datetime(0) }}
|
{{ current_time(24,'withdate') }}
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
entity_id: input_datetime.emma_tylenol_notify
|
entity_id: input_datetime.emma_tylenol_notify
|
||||||
@ -809,7 +815,7 @@ script:
|
|||||||
max: 10
|
max: 10
|
||||||
sequence:
|
sequence:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions: "{{ reason == 'cough-notify' }}"
|
- conditions: "{{ reason == 'cough-notify' and is_state('input_boolean.emma_sleeping','off') }}"
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
target:
|
target:
|
||||||
@ -828,11 +834,11 @@ script:
|
|||||||
tag: emma-cough
|
tag: emma-cough
|
||||||
actions:
|
actions:
|
||||||
- action: "EMMA_COUGH_GIVEN"
|
- action: "EMMA_COUGH_GIVEN"
|
||||||
name: Given
|
title: Given
|
||||||
- action: "EMMA_COUGH_SKIPPED"
|
- action: "EMMA_COUGH_SKIPPED"
|
||||||
name: Skipped
|
title: Skipped
|
||||||
- action: "EMMA_COUGH_ASK_LATER"
|
- action: "EMMA_COUGH_ASK_LATER"
|
||||||
name: Ask Later
|
title: Ask Later
|
||||||
- wait_for_trigger:
|
- wait_for_trigger:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: ios.notification_action_fired
|
event_type: ios.notification_action_fired
|
||||||
@ -906,8 +912,8 @@ script:
|
|||||||
entity_id: input_datetime.emma_cough_meds
|
entity_id: input_datetime.emma_cough_meds
|
||||||
data:
|
data:
|
||||||
datetime: >
|
datetime: >
|
||||||
{% from 'time.jinja' import set_datetime %}
|
{% from 'time.jinja' import current_time %}
|
||||||
{{ set_datetime(0) }}
|
{{ current_time(24,'withdate') }}
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
entity_id: input_datetime.emma_cough_meds_notify
|
entity_id: input_datetime.emma_cough_meds_notify
|
||||||
@ -1046,6 +1052,18 @@ script:
|
|||||||
# Lighting
|
# Lighting
|
||||||
- variables:
|
- variables:
|
||||||
brightness: "{{ state_attr('switch.adaptive_lighting_emma_bedroom','brightness_pct') | int }}"
|
brightness: "{{ state_attr('switch.adaptive_lighting_emma_bedroom','brightness_pct') | int }}"
|
||||||
|
- if:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.emma_cough_meds_active
|
||||||
|
state: 'on'
|
||||||
|
then:
|
||||||
|
- service: input_datetime.set_datetime
|
||||||
|
target:
|
||||||
|
entity_id: input_datetime.emma_cough_meds_notify
|
||||||
|
data:
|
||||||
|
datetime: >
|
||||||
|
{% from 'time.jinja' import set_datetime %}
|
||||||
|
{{ set_datetime(0,1) }}
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.basement_occupied
|
entity_id: binary_sensor.basement_occupied
|
||||||
|
Reference in New Issue
Block a user