Desktop notifications for Tony's meds
This commit is contained in:
118
automations.yaml
118
automations.yaml
@@ -5354,72 +5354,96 @@
|
||||
- id: '1722378602352'
|
||||
alias: Tony Meds Cleanup
|
||||
description: Handles the setting/clearing of medication configs for Tony
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
triggers:
|
||||
- entity_id:
|
||||
- input_boolean.tony_morning_meds_reminder
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
id: morning-reminders-off
|
||||
alias: Morning reminders off
|
||||
trigger: state
|
||||
- alias: Afternoon reminders off
|
||||
platform: state
|
||||
entity_id:
|
||||
- input_boolean.tony_afternoon_meds_reminder
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
id: afternoon-reminders-off
|
||||
trigger: state
|
||||
- alias: Night reminders off
|
||||
platform: state
|
||||
entity_id:
|
||||
- input_boolean.tony_night_meds_reminder
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
id: night-reminders-off
|
||||
- platform: event
|
||||
event_type: ios.notification_action_fired
|
||||
trigger: state
|
||||
- event_type: ios.notification_action_fired
|
||||
event_data:
|
||||
actionName: TONY_MORNING_MEDS_TAKEN
|
||||
id: morning-taken
|
||||
alias: Morning taken
|
||||
- alias: Afternoon taken
|
||||
platform: event
|
||||
alias: Morning taken iOS
|
||||
trigger: event
|
||||
- alias: Morning taken PC
|
||||
event_type: hass_agent_notifications
|
||||
event_data:
|
||||
action: TONY_MORNING_MEDS_TAKEN
|
||||
id: morning-taken
|
||||
trigger: event
|
||||
- alias: Afternoon taken iOS
|
||||
event_type: ios.notification_action_fired
|
||||
event_data:
|
||||
actionName: TONY_AFTERNOON_MEDS_TAKEN
|
||||
id: afternoon-taken
|
||||
- alias: Night taken
|
||||
platform: event
|
||||
trigger: event
|
||||
- alias: Afternoon taken PC
|
||||
event_type: hass_agent_notifications
|
||||
event_data:
|
||||
action: TONY_AFTERNOON_MEDS_TAKEN
|
||||
id: afternoon-taken
|
||||
trigger: event
|
||||
- alias: Night taken iOS
|
||||
event_type: ios.notification_action_fired
|
||||
event_data:
|
||||
actionName: TONY_NIGHT_MEDS_TAKEN
|
||||
id: night-taken
|
||||
- alias: Morning skipped
|
||||
platform: event
|
||||
trigger: event
|
||||
- alias: Morning skipped iOS
|
||||
event_type: ios.notification_action_fired
|
||||
event_data:
|
||||
actionName: TONY_MORNING_MEDS_SKIPPED
|
||||
id: morning-skipped
|
||||
- alias: Afternoon skipped
|
||||
platform: event
|
||||
trigger: event
|
||||
- alias: Morning skipped PC
|
||||
event_type: hass_agent_notifications
|
||||
event_data:
|
||||
action: TONY_MORNING_MEDS_SKIPPED
|
||||
id: morning-skipped
|
||||
trigger: event
|
||||
- alias: Afternoon skipped iOS
|
||||
event_type: ios.notification_action_fired
|
||||
event_data:
|
||||
actionName: TONY_AFTERNOON_MEDS_SKIPPED
|
||||
id: afternoon-skipped
|
||||
- alias: Night skipped
|
||||
platform: event
|
||||
trigger: event
|
||||
- alias: Afternoon skipped PC
|
||||
event_type: hass_agent_notifications
|
||||
event_data:
|
||||
action: TONY_AFTERNOON_MEDS_SKIPPED
|
||||
id: afternoon-skipped
|
||||
trigger: event
|
||||
- alias: Night skipped iOS
|
||||
event_type: ios.notification_action_fired
|
||||
event_data:
|
||||
actionName: TONY_NIGHT_MEDS_SKIPPED
|
||||
id: night-skipped
|
||||
- platform: state
|
||||
entity_id:
|
||||
trigger: event
|
||||
- entity_id:
|
||||
- person.tony_stork
|
||||
from: home
|
||||
id: left
|
||||
alias: Left
|
||||
condition: []
|
||||
action:
|
||||
trigger: state
|
||||
conditions: []
|
||||
actions:
|
||||
- alias: Routing
|
||||
choose:
|
||||
- conditions:
|
||||
@@ -5428,19 +5452,19 @@
|
||||
- morning-reminders-off
|
||||
alias: Morning Reminders Off
|
||||
sequence:
|
||||
- service: counter.reset
|
||||
metadata: {}
|
||||
- metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: counter.tony_morning_meds_reminder_count
|
||||
alias: Reset morning reminder count
|
||||
- service: script.text_notify
|
||||
data:
|
||||
action: counter.reset
|
||||
- data:
|
||||
type: alert
|
||||
who: tony
|
||||
message: clear_notification
|
||||
tag: tony-morning-meds
|
||||
alias: Clear morning notification
|
||||
action: script.text_notify
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
@@ -5448,18 +5472,18 @@
|
||||
alias: Afternoon reminders off
|
||||
sequence:
|
||||
- alias: Reset afternoon reminder count
|
||||
service: counter.reset
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: counter.tony_afternoon_meds_reminder_count
|
||||
- service: script.text_notify
|
||||
data:
|
||||
action: counter.reset
|
||||
- data:
|
||||
type: alert
|
||||
who: tony
|
||||
message: clear_notification
|
||||
tag: tony-afternoon-meds
|
||||
alias: Clear afternoon notification
|
||||
action: script.text_notify
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
@@ -5467,90 +5491,90 @@
|
||||
alias: Night reminders off
|
||||
sequence:
|
||||
- alias: Reset night reminder count
|
||||
service: counter.reset
|
||||
metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: counter.tony_night_meds_reminder_count
|
||||
- service: script.text_notify
|
||||
data:
|
||||
action: counter.reset
|
||||
- data:
|
||||
type: alert
|
||||
who: tony
|
||||
message: clear_notification
|
||||
tag: tony-night-meds
|
||||
alias: Clear night notification
|
||||
action: script.text_notify
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
- alias: Morning taken
|
||||
condition: trigger
|
||||
id:
|
||||
- morning-taken
|
||||
alias: Morning taken
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
metadata: {}
|
||||
- metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.tony_morning_meds_taken
|
||||
alias: Turn on morning meds taken
|
||||
action: input_boolean.turn_on
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- afternoon-taken
|
||||
alias: Afternoon taken
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
metadata: {}
|
||||
- metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.tony_afternoon_meds_taken
|
||||
alias: Turn on afternoon meds taken
|
||||
action: input_boolean.turn_on
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- night-taken
|
||||
alias: Night taken
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
metadata: {}
|
||||
- metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.tony_night_meds_taken
|
||||
alias: Turn on night meds taken
|
||||
action: input_boolean.turn_on
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- morning-skipped
|
||||
alias: Morning skipped
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
metadata: {}
|
||||
- metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.tony_morning_meds_reminder
|
||||
alias: Deactivate morning reminders
|
||||
action: input_boolean.turn_off
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- afternoon-skipped
|
||||
alias: Afternoon skipped
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
metadata: {}
|
||||
- metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.tony_afternoon_meds_reminder
|
||||
alias: Deactivate afternoon reminders
|
||||
action: input_boolean.turn_off
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- night-skipped
|
||||
alias: Night skipped
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
metadata: {}
|
||||
- metadata: {}
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.tony_night_meds_reminder
|
||||
alias: Deactivate night reminders
|
||||
action: input_boolean.turn_off
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
@@ -5576,7 +5600,6 @@
|
||||
alias: Night meds reminder active
|
||||
then:
|
||||
- alias: Send critical TTS notification
|
||||
service: script.text_notify
|
||||
metadata: {}
|
||||
data:
|
||||
type: critical
|
||||
@@ -5584,6 +5607,7 @@
|
||||
title: HEY DUMBASS
|
||||
message: YOU FORGOT TO TAKE YOUR MEDS!!!!!
|
||||
tag: tony-left-meds
|
||||
action: script.text_notify
|
||||
mode: queued
|
||||
max: 10
|
||||
- id: '1722386174249'
|
||||
|
||||
48
scripts.yaml
48
scripts.yaml
@@ -1785,6 +1785,18 @@ tony_morning_meds:
|
||||
- action: TONY_MORNING_MEDS_SKIPPED
|
||||
title: Skip
|
||||
action: script.text_notify
|
||||
- alias: Send PC notification
|
||||
action: script.pc_notify
|
||||
metadata: {}
|
||||
data:
|
||||
who: tony
|
||||
title: Morning Meds
|
||||
message: '{{ response.data.notification_text }}'
|
||||
actions:
|
||||
- action: TONY_MORNING_MEDS_TAKEN
|
||||
title: Taken
|
||||
- action: TONY_MORNING_MEDS_SKIPPED
|
||||
title: Skip
|
||||
- alias: Send TTS if reminders > 2 and Tony is home
|
||||
if:
|
||||
- alias: When reminders > 2 and Tony is home
|
||||
@@ -1826,6 +1838,18 @@ tony_morning_meds:
|
||||
title: Skip
|
||||
message: You need to take your morning meds
|
||||
action: script.text_notify
|
||||
- alias: Send PC notification
|
||||
action: script.pc_notify
|
||||
metadata: {}
|
||||
data:
|
||||
who: tony
|
||||
title: Morning Meds
|
||||
message: You need to take your morning meds
|
||||
actions:
|
||||
- action: TONY_MORNING_MEDS_TAKEN
|
||||
title: Taken
|
||||
- action: TONY_MORNING_MEDS_SKIPPED
|
||||
title: Skip
|
||||
- alias: Send TTS if reminders > 2 and Tony is home
|
||||
if:
|
||||
- alias: When reminders > 2 and Tony is home
|
||||
@@ -2113,6 +2137,18 @@ tony_afternoon_meds:
|
||||
- action: TONY_AFTERNOON_MEDS_SKIPPED
|
||||
title: Skip
|
||||
action: script.text_notify
|
||||
- action: script.pc_notify
|
||||
metadata: {}
|
||||
data:
|
||||
who: tony
|
||||
title: Afternoon Meds
|
||||
message: '{{ response.data.notification_text }}'
|
||||
actions:
|
||||
- action: TONY_AFTERNOON_MEDS_TAKEN
|
||||
title: Taken
|
||||
- action: TONY_AFTERNOON_MEDS_SKIPPED
|
||||
title: Skip
|
||||
alias: Send PC notification
|
||||
- alias: Send TTS if reminders > 2 and Tony is home
|
||||
if:
|
||||
- alias: When reminders > 2 and Tony is home
|
||||
@@ -2154,6 +2190,18 @@ tony_afternoon_meds:
|
||||
title: Skip
|
||||
message: You need to take your afternoon meds
|
||||
action: script.text_notify
|
||||
- alias: Send PC notification
|
||||
action: script.pc_notify
|
||||
metadata: {}
|
||||
data:
|
||||
who: tony
|
||||
title: Afternoon Meds
|
||||
message: You need to take your afternoon meds
|
||||
actions:
|
||||
- action: TONY_AFTERNOON_MEDS_TAKEN
|
||||
title: Taken
|
||||
- action: TONY_AFTERNOON_MEDS_SKIPPED
|
||||
title: Skip
|
||||
- alias: Send TTS if reminders > 2 and Tony is home
|
||||
if:
|
||||
- alias: When reminders > 2 and Tony is home
|
||||
|
||||
Reference in New Issue
Block a user