Blueprint to Remind someone to take the medicine at a specified time

This blueprint is designed to notify a phone to take medicine out of a cabinet at a specified time and will repeat until the cabinet has been opened after the specified time. Things to set up beforehand.

  • Counter Helper (used to tell how many times the cabinet has been open)
  • Second Automation to increase the counter by 1 every time the cabinet has been opened
  • Mobile app has been installed on specified phone.

This is the first time I have made a blueprint and maybe missing some things, I am also not a wizard at yaml so sorry.

blueprint:
  name: Reminder for Medication
  description: Sends reminders to take medication and tracks if it's taken on time.
  domain: automation
  input:
    reminder_time:
      name: Reminder Time
      description: Time to send the initial reminder.
      selector:
        time:
    late_reminder_delay:
      name: Delay for Late Reminder
      description: Time to wait before sending a reminder if medication is not taken.
      selector:
        time:
    door_sensor:
      name: Door Sensor
      description: Binary sensor to check if the door is closed.
      selector:
        entity:
          domain: binary_sensor
    notification_device:
      name: Notification Device
      description: Device to receive the reminders.
      selector:
        device:
          integration: mobile_app
    counter:
      name: Counter
      description: Counter to track if medication is taken on time.
      selector:
        entity:
          domain: counter
  trigger:
    platform: time
    at: !input reminder_time
  condition:
    - condition: device
      type: is_not_open
      device_id: !input door_sensor
      entity_id: !input door_sensor
  action:
    - service: counter.reset
      target:
        entity_id: !input counter
    - service: notify.mobile_app
      data:
        message: Please Take Your Medicine!!
        title: Reminder!!
      target:
        device_id: !input notification_device
    - repeat:
        until:
          - condition: numeric_state
            entity_id: !input counter
            attribute: step
            above: 1
        sequence:
          - delay: !input late_reminder_delay
          - service: notify.mobile_app
            data:
              message: Your Late to taking your medication!!
              title: Reminder
            target:
              device_id: !input notification_device
  mode: single
1 Like