Automation that reminds me to take my pills

I want to receive notification to my phone every morning at 10:00 am asking my if I have taken my pills.

  1. If I click YES, it says “Bye until tomorrow”
  2. If I click NO, it reminds me after 1 hour (runs the same automations basically)

I have done all this and is working fine. The only thing I want to add is if I dont click anything, lets says I clear my notificationd and I dont click NO no YES. No input from me. Then I want to run the automations notification again, asking me if I have taken my pills.

Basically NO and “not input” does the same.

I have done this with 2 automations. Here they are:

Automation 1:

alias: "Person: Alex pills reminder"
description: ""
trigger:
  - platform: time
    at: "10:00:00"
condition: []
action:
  - service: notify.mobile_app_alexphone
    data:
      data:
        actions:
          - action: take_pills
            title: "Yes"
          - action: not_taken_pills
            title: "No"
      message: Don't forget to take your pills. Did you take them already?
      title: "Reminder:"
  - condition: state
    entity_id: sensor.alexphone_wifi_connection
    state: AkeNet
  - service: notify.alexa_media_polk_react
    data:
      message: Don't forget to take your pills. Did you take them already?
  - service: notify.alexdesktop
    data:
      message: Don't forget to take your pills. Check your phone!
      title: "Reminder:"
mode: single

Automation 2:

alias: "Person: Alex pills reminder response"
description: ""
trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: take_pills
    id: taken
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: not_taken_pills
    id: notaken
  - platform: time
    at: "00:00:00"
    id: reset
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: taken
          - condition: state
            entity_id: input_boolean.pills_taken
            enabled: true
            state: "off"
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.pills_taken
          - service: notify.mobile_app_alexphone
            data:
              message: Great! See you tomorrow.
      - conditions:
          - condition: trigger
            id: notaken
          - condition: state
            entity_id: input_boolean.pills_taken
            state: "off"
            enabled: true
        sequence:
          - service: notify.mobile_app_alexphone
            data:
              message: I will give you 1 minute to do it, then remind you again!
          - delay:
              hours: 0
              minutes: 1
              seconds: 0
              milliseconds: 0
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.pills_taken
          - service: automation.trigger
            data:
              skip_condition: true
            target:
              entity_id: automation.person_alex_pills_reminder
      - conditions:
          - condition: trigger
            id: reset
        sequence:
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.pills_taken
mode: single

My best guess is doing some modification to automation 1 (the trigger automation). Can anyone helps?

1 Like

I’ve added a second trigger, and also added another condition that checks your pills boolean.

This should work :slight_smile: I hope

- alias: "Person: Alex pills reminder"
  description: ""
  trigger:
    - platform: time
      at: "10:00:00"
    - platform: time
      at: "10:30:00"
  condition:
    - condition: and
      conditions:
        - condition: state
          entity_id: sensor.alexphone_wifi_connection
          state: AkeNet
        - condition: state
          entity_id: input_boolean.pills_taken
          state: "off"
  action:
    - service: notify.mobile_app_alexphone
      data:
        data:
          actions:
            - action: take_pills
              title: "Yes"
            - action: not_taken_pills
              title: "No"
        message: Don't forget to take your pills. Did you take them already?
        title: "Reminder:"
    - service: notify.alexa_media_polk_react
      data:
        message: Don't forget to take your pills. Did you take them already?
    - service: notify.alexdesktop
      data:
        message: Don't forget to take your pills. Check your phone!
        title: "Reminder:"
      mode: single

Am using something lets-call-it similar but I am using the in-byuilt schedule as some pills morning, some evening
Have you by any chance found a solution to make this a bit more ‘complex’ as the above (like mine) is just a notification if a slot is entered (unless input ticked)
With more complex I mean…I have 3 pills two morning, 1 evening and I have friends where the schedule is not daily…just asking