Help with notification actions on android

Hi all,
My dog is needing regular tablets now unfortunately.
So I created a calendar of the times etc and set up a automation to send a notification to me and my wife’s phone to remind us with 2 actions, 1 to say ‘done’ and the other to open the calendar.
I then created another automation that fires when the ‘done’ action has been pressed and that sends a ‘clear_notification’ command to the other phone.
But I would like to work out a way of finding out which user pressed the ‘done’ action.
So if my wife pressed it I can then send a notification to myself saying she’s done it instead of the notification just disappearing and vice versa.
Anyone any ideas if I can do that ? I did look at the 'catch all triggers in the documentation but wasn’t sure if that would.
Thanks

This is the main automation.

alias: Calendar notification
> description: For Baileys tablets
> trigger:
>   - platform: calendar
>     event: start
>     entity_id: calendar.baileys_tablets
> action:
>   - service: notify.mobile_app_sara_mobile
>     data:
>       title: Baileys Tablets
>       message: "{{ trigger.calendar_event.description }}"
>       data:
>         actions:
>           - action: tabsdone
>             title: Done
>           - action: URI
>             title: Open Calendar
>             uri: /calendar
>         channel: tablets
>         importance: high
>         persistent: true
>         icon_url: /local/images/icon/dog.png
>         notification_icon: mdi:dog
>         tag: tablets
>   - service: notify.mobile_app_steve_mobile
>     data:
>       title: Baileys Tablets
>       message: "{{ trigger.calendar_event.description }}"
>       data:
>         actions:
>           - action: tabsdone
>             title: Done
>           - action: URI
>             title: Open Calendar
>             uri: /calendar
>         channel: tablets
>         importance: high
>         persistent: true
>         icon_url: /local/images/icon/dog.png
>         notification_icon: mdi:dog
>         tag: tablets
> mode: single

The other automation to run the script that clears the notification

alias: Clear Notifications and action
description: ""
trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: tabsdone
condition: []
action:
  - service: script.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: script.tablets
mode: single

Events from the app have a user id if I remember correctly.
Open the developer tools → events and listen to the mobile_app_notification_action event when you click on the button.

I’m fairly sure there should be context data and user id which should be different.

Make sure you do it twice to that the one you believe it is is just random characters.

1 Like

Thanks that’s great,
I’ve never noticed a events tab in the developer tools ha ha.
I’ll do that when I’ve got my wife’s phone nearby.