Automation modifications for custom med tracker concept
This commit is contained in:
@ -2221,22 +2221,44 @@
|
|||||||
trigger:
|
trigger:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: input_datetime.tony_morning_meds_notify
|
at: input_datetime.tony_morning_meds_notify
|
||||||
id: wakeup
|
id: morning-notify
|
||||||
|
alias: Morning Notify
|
||||||
- platform: time
|
- platform: time
|
||||||
at: input_datetime.tony_night_meds_notify
|
at: input_datetime.tony_night_meds_notify
|
||||||
id: sleep
|
id: night-notify
|
||||||
|
alias: Night Notify
|
||||||
|
- platform: time
|
||||||
|
at: input_datetime.tony_custom_meds_notify_1
|
||||||
|
alias: Custom Notify 1
|
||||||
|
id: custom-1
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_boolean.tony_morning_meds_taken
|
entity_id:
|
||||||
|
- input_boolean.tony_morning_meds_taken
|
||||||
to: 'on'
|
to: 'on'
|
||||||
id: boolean-morning
|
id: boolean-morning
|
||||||
|
alias: Morning Taken
|
||||||
|
from: 'off'
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_boolean.tony_night_meds_taken
|
entity_id:
|
||||||
to: 'on'
|
- input_boolean.tony_night_meds_taken
|
||||||
id: boolean-night
|
id: boolean-night
|
||||||
|
alias: Night Taken
|
||||||
|
from: 'off'
|
||||||
|
to: 'on'
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_boolean.master_bedroom_sleeping
|
entity_id:
|
||||||
to: 'off'
|
- input_boolean.tony_custom_meds_taken_1
|
||||||
|
from: 'off'
|
||||||
|
to: 'on'
|
||||||
|
id: boolean-custom-1
|
||||||
|
alias: Custom 1 Taken
|
||||||
|
- platform: state
|
||||||
|
entity_id:
|
||||||
|
- input_boolean.master_bedroom_sleeping
|
||||||
id: sleep-off
|
id: sleep-off
|
||||||
|
alias: Sleep Off
|
||||||
|
from: 'on'
|
||||||
|
to: 'off'
|
||||||
condition: []
|
condition: []
|
||||||
action:
|
action:
|
||||||
- choose:
|
- choose:
|
||||||
@ -2244,31 +2266,37 @@
|
|||||||
- condition: and
|
- condition: and
|
||||||
conditions:
|
conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: wakeup
|
id: morning-notify
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.tony_morning_meds_taken
|
entity_id: input_boolean.tony_morning_meds_taken
|
||||||
state: 'off'
|
state: 'off'
|
||||||
|
alias: Morning Notify
|
||||||
sequence:
|
sequence:
|
||||||
- service: script.turn_on
|
- service: script.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: script.tony_morning_meds
|
entity_id: script.tony_morning_meds
|
||||||
data: {}
|
data: {}
|
||||||
|
alias: Run morning meds script
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: and
|
- condition: and
|
||||||
conditions:
|
conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: sleep
|
id:
|
||||||
|
- night-notify
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.tony_night_meds_taken
|
entity_id: input_boolean.tony_night_meds_taken
|
||||||
state: 'off'
|
state: 'off'
|
||||||
|
alias: Night Notify
|
||||||
sequence:
|
sequence:
|
||||||
- service: script.turn_on
|
- service: script.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: script.tony_night_meds
|
entity_id: script.tony_night_meds
|
||||||
data: {}
|
data: {}
|
||||||
|
alias: Run night meds script
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: boolean-morning
|
id: boolean-morning
|
||||||
|
alias: Morning Taken
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
@ -2278,9 +2306,11 @@
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
'
|
'
|
||||||
|
alias: Set time morning meds were taken
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: boolean-night
|
id: boolean-night
|
||||||
|
alias: Night Taken
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
@ -2290,9 +2320,26 @@
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
'
|
'
|
||||||
|
alias: Set time night meds were taken
|
||||||
|
- conditions:
|
||||||
|
- condition: trigger
|
||||||
|
id:
|
||||||
|
- boolean-custom-1
|
||||||
|
alias: Custom 1 Taken
|
||||||
|
sequence:
|
||||||
|
- service: input_datetime.set_datetime
|
||||||
|
data:
|
||||||
|
datetime: '{% from ''time.jinja'' import current_time %} {{ current_time(24,''withdate'')
|
||||||
|
}}
|
||||||
|
|
||||||
|
'
|
||||||
|
target:
|
||||||
|
entity_id: input_datetime.tony_custom_meds_taken_1
|
||||||
|
alias: Set time custom meds 1 were taken
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: sleep-off
|
id: sleep-off
|
||||||
|
alias: Sleep Off
|
||||||
sequence:
|
sequence:
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
@ -2302,6 +2349,8 @@
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
'
|
'
|
||||||
|
alias: Set time to start notifying for morning meds
|
||||||
|
alias: Routing
|
||||||
mode: parallel
|
mode: parallel
|
||||||
max: 4
|
max: 4
|
||||||
- id: '1696288939707'
|
- id: '1696288939707'
|
||||||
|
Reference in New Issue
Block a user