Move wife's med tracker to UI, add reminder counts
This commit is contained in:
113
automations.yaml
113
automations.yaml
@ -5095,3 +5095,116 @@
|
||||
entity_id: binary_sensor.upstairs_bathroom_window
|
||||
state: 'off'
|
||||
mode: restart
|
||||
- id: '1721782673415'
|
||||
alias: Tina Meds Handler
|
||||
description: Make sure Tina has taken her meds in the morning and at night
|
||||
trigger:
|
||||
- platform: time
|
||||
at: input_datetime.tina_morning_meds_notify
|
||||
id: wakeup
|
||||
alias: Morning Notify
|
||||
- platform: state
|
||||
entity_id: input_boolean.tina_morning_meds_taken
|
||||
to: 'on'
|
||||
id: boolean-morning
|
||||
alias: Morning Taken
|
||||
- platform: time
|
||||
at: input_datetime.tina_night_meds_notify
|
||||
id: sleep
|
||||
alias: Night Notify
|
||||
- platform: state
|
||||
entity_id: input_boolean.tina_night_meds_taken
|
||||
to: 'on'
|
||||
id: boolean-night
|
||||
alias: Night Taken
|
||||
condition: []
|
||||
action:
|
||||
- alias: Routing
|
||||
choose:
|
||||
- conditions:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: wakeup
|
||||
- condition: state
|
||||
entity_id: input_boolean.tina_morning_meds_taken
|
||||
state: 'off'
|
||||
alias: Morning Notify
|
||||
sequence:
|
||||
- service: counter.increment
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: counter.tina_morning_meds_reminder_count
|
||||
alias: Increment counter
|
||||
- service: script.turn_on
|
||||
target:
|
||||
entity_id: script.tina_morning_meds
|
||||
data: {}
|
||||
alias: Run morning script
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: boolean-morning
|
||||
alias: Morning Taken
|
||||
sequence:
|
||||
- service: counter.reset
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: counter.tina_morning_meds_reminder_count
|
||||
alias: Reset counter
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.tina_morning_meds_taken
|
||||
data:
|
||||
datetime: '{% from ''time.jinja'' import current_time %} {{ current_time(''datetime'',24)
|
||||
}}
|
||||
|
||||
'
|
||||
alias: Set time morning meds were taken
|
||||
- conditions:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: sleep
|
||||
- condition: state
|
||||
entity_id: input_boolean.tina_night_meds_taken
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_sleeping
|
||||
state: 'off'
|
||||
alias: Night Notify
|
||||
sequence:
|
||||
- alias: Increment counter
|
||||
service: counter.increment
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: counter.tina_night_meds_reminder_count
|
||||
- service: script.turn_on
|
||||
target:
|
||||
entity_id: script.tina_night_meds
|
||||
data: {}
|
||||
alias: Run night script
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: boolean-night
|
||||
sequence:
|
||||
- alias: Reset counter
|
||||
service: counter.reset
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: counter.tina_night_meds_reminder_count
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.tina_night_meds_taken
|
||||
data:
|
||||
datetime: '{% from ''time.jinja'' import current_time %} {{ current_time(''datetime'',24)
|
||||
}}
|
||||
|
||||
'
|
||||
alias: Set time night meds were taken
|
||||
alias: Night Taken
|
||||
mode: parallel
|
||||
max: 4
|
||||
|
Reference in New Issue
Block a user