Be more annoying about making sure I take my meds. Also, #184

This commit is contained in:
2023-12-18 19:09:10 -05:00
parent a9d7c38c28
commit d03c7b1283
2 changed files with 68 additions and 28 deletions

View File

@ -2540,6 +2540,11 @@
state: 'off'
alias: Morning Notify
sequence:
- service: counter.increment
target:
entity_id: counter.tony_morning_meds_reminder_count
data: {}
alias: Increment counter
- service: script.turn_on
target:
entity_id: script.tony_morning_meds
@ -2556,6 +2561,11 @@
entity_id: input_boolean.tony_afternoon_meds_taken
state: 'off'
sequence:
- service: counter.increment
target:
entity_id: counter.tony_afternoon_meds_reminder_count
data: {}
alias: Increment counter
- service: script.tony_afternoon_meds
data: {}
alias: Run afternoon meds script
@ -2795,6 +2805,12 @@
- input_boolean.tina_morning_meds_taken
- input_boolean.tony_afternoon_meds_taken
data: {}
- service: counter.reset
target:
entity_id:
- counter.tony_morning_meds_reminder_count
- counter.tony_afternoon_meds_reminder_count
data: {}
- conditions:
- condition: trigger
id: 6am

View File

@ -1871,20 +1871,32 @@ tony_morning_meds:
icon: mdi:medication
mode: restart
sequence:
- service: script.text_notify
data:
who: tony
type: alert
title: Morning Meds
message: You need to take your morning meds
tag: tony-morning-meds
actions:
- action: TONY_MORNING_MEDS_TAKEN
title: Taken
- action: TONY_MORNING_MEDS_SKIPPED
title: Skip
- action: TONY_MORNING_MEDS_ASK_LATER
title: Ask Later
- parallel:
- if:
- condition: numeric_state
entity_id: counter.tony_morning_meds_reminder_count
above: 2
then:
- service: script.speech_engine
data:
who: common_areas
type: alert
message: Tony, you need to take your morning meds. This is reminder number
{{ states('counter.tony_morning_meds_reminder_count') }} for today.
- service: script.text_notify
data:
who: tony
type: alert
title: Morning Meds
message: You need to take your morning meds
tag: tony-morning-meds
actions:
- action: TONY_MORNING_MEDS_TAKEN
title: Taken
- action: TONY_MORNING_MEDS_SKIPPED
title: Skip
- action: TONY_MORNING_MEDS_ASK_LATER
title: Ask Later
- wait_for_trigger:
- platform: event
event_type: ios.notification_action_fired
@ -2217,20 +2229,32 @@ tony_custom_meds:
tony_afternoon_meds:
alias: Tony Afternoon Meds
sequence:
- service: script.text_notify
data:
who: tony
type: alert
title: Afternoon Meds
message: You need to take your afternoon meds
tag: tony-afternoon-meds
actions:
- action: TONY_AFTERNOON_MEDS_TAKEN
title: Taken
- action: TONY_AFTERNOON_MEDS_SKIPPED
title: Skip
- action: TONY_AFTERNOON_MEDS_ASK_LATER
title: Ask Later
- parallel:
- if:
- condition: numeric_state
entity_id: counter.tony_afternoon_meds_reminder_count
above: 2
then:
- service: script.speech_engine
data:
who: common_areas
type: alert
message: Tony, you need to take your afternoon meds. This is reminder number
{{ states('counter.tony_afternoon_meds_reminder_count') }} for today.
- service: script.text_notify
data:
who: tony
type: alert
title: Afternoon Meds
message: You need to take your afternoon meds
tag: tony-afternoon-meds
actions:
- action: TONY_AFTERNOON_MEDS_TAKEN
title: Taken
- action: TONY_AFTERNOON_MEDS_SKIPPED
title: Skip
- action: TONY_AFTERNOON_MEDS_ASK_LATER
title: Ask Later
- wait_for_trigger:
- alias: Taken
platform: event