Advanced medication reminder

All good, as long as it’s solved! :+1: And thanks for reporting back, that’s unfortunately not the standard behaviour! :slight_smile:

Same here error solved after submit repair🙂

Great blueprint. What would be the best way to send a notification to parents phones based on the action selected from the alert based off this blueprint?

You can check the state of the input_boolean, if it’s still off at x hours, you can trigger a notification ?

Thanks, but would that show taken, skipped, remind later though?

I dont understand, you want send a notification to your parents according to what is answered on a notification on your phone?
Or just send the notification on your parents’ phone?

What I am trying to accomplish is a notification to send to my phone when my kid takes their medication. So I get a notification if they took it, skipped it or delayed it. So the Blueprint notification goes to their phone. They select taken. I get a notification on my phone based on the answer they selected on their phones notification.

This is great, thank you. Would it be possible please to have the option to specify the notification channel for android so that I can set different notification sounds for each med/water?

1 Like

you can add an action for each statement (https://github.com/Aohzan/hass-blueprints/blob/87209ae2617b8523e5779a02214a19a946252ed6/blueprints/medication_reminder_android.yaml#L153 , 162, 172)

you can edit the blueprint to customize it

Is it possible to have this only notify you if you’re in the home zone?

This has been a very useful blueprint. I like the “optional” items which makes it quite expandable for doing something after the automation has run through (it seems to me)

Instead - how would I change the blueprint such that “optional” happens after “taken” is pressed on the notification" rather than after the automation has run?

I tried created an “optional_action_2” and putting it under

conditions: '{{ wait.trigger and wait.trigger.event.data.action == ''taken''}}'

but could not figure out how to place it in a sequence.

Anyway - thanks

hello, you can put the action before the choose : https://github.com/Aohzan/hass-blueprints/blob/87209ae2617b8523e5779a02214a19a946252ed6/blueprints/medication_reminder_android.yaml#L143

Thanks.
I also got it to work by adding a service call to a script under taken.

Lovely blueprint - thanks

Actually after some testing, if I move the the optional iems to the location you indicated, the actions listed as optional fire for all the wait triggers - taken, later and skip.
Where would I put it just for the taken trigger?
Thanks

between 153 and 154

Thanks - Sorry. That’s what I was thinking when I started as ‘taken’ was the conditions trigger I was waiting for. But I couldn’t figure out how to put the optional_action_rtaken choose/condition stament inside the trigger taken choose/conditions - if that makes sense.

But your first suggestion worked when I placed it like code below which runs the optional_action_taken (eg increment counter) for all the taken, later and skip

    - choose:
      - conditions: '{{ true }}'
        sequence: !input optional_action_taken
    - choose:
      - conditions: '{{ wait.trigger and wait.trigger.event.data.action == ''taken''
          }}'
        sequence:
        - service: input_boolean.turn_on
          target:
            entity_id: !input input_boolean
        - service: logbook.log
          data:
            name: !input notification_title
            message: !input logbook_message_taken
            entity_id: !input input_boolean
            ...

What I can’t figure out is how do I put it between 153-154 to run . The whole choose staement inside the choose statement gives me an error


    - choose:
      - conditions: '{{ wait.trigger and wait.trigger.event.data.action == ''taken''
          }}'
        sequence:
         ... as above
        - service: logbook.log
          data:
            name: !input notification_title
            message: !input logbook_message_taken
            entity_id: !input input_boolean
How does this go here which is line 153-154? This doesn't work
        - conditions: '{{ true }}'
          sequence: !input optional_action_taken

again thanks for your help. This is my first crack at blueprints and just trying to get my head around them.

In the meantime I have added an input

    script_target:
      name: Script
      description: Script to run when pill has been taken
      selector:
        entity:
          filter:
            - domain: script

and added it to the waittrigger taken like this

    - choose:
      - conditions: '{{ wait.trigger and wait.trigger.event.data.action == ''taken''
          }}'
        sequence:
        - service: input_boolean.turn_on
          target:
            entity_id: !input input_boolean
        - service: !input script_target
          metadata: {}
          data:
            message: !input input_boolean
        - service: logbook.log
          data:
            name: !input notification_title
            message: !input logbook_message_taken
            entity_id: !input input_boolean

depending on the boolean passed in I can fire off different actions from the script.
But it would be nice to do it in the UI with the optional_action_token :slight_smile:

1 Like

I also use HA to track my medication stocks. For example I created a sensor named ‘counter.medication_1’ using helpers function, so whenever I press ‘taken’ it decrements 1 medication from total medications I set manually. This way I can tell when to call my pharmacy!

5 Likes

Great idea. Going to give it a go right now. What card is that?