Actionable Notifications for Android: confirm receive by clicking

I want to notify the sender of a notification when I press the notification on my android smartphone.

I’ve done this at the moment with the “clickAction” usage, which opens a webpage with a webhook that is linked to an automation that sends a notification to the sender (to confirm that I received and read it)

However, this is not optimal as it opens a page on my smartphone.

How could I do the same with Actionable Notifications? I am unsure, even after reading Actionable Notifications | Home Assistant Companion Docs
Below is my current code where the webhook is called and below that the webhook automation

alias: Script Notify 
sequence:
  - service: notify.mobile_app_sm_s901b
    data:
      message: You are summoned!
      title: Summon
      data:
        channel: Summon
        importance: high
        priority: high
        ttl: 0
        vibrationPattern: 100, 100, 100, 100, 100, 100
        clickAction: >-
          https://hooks.nabu.casa/gAAAAABj_<WEBHOOK>
mode: single
icon: mdi:alarm-light
alias: Automation_Confirm_Summon_Notification
description: ""
trigger:
  - platform: webhook
    webhook_id: "-<SNIP>"
condition: []
action:
  - service: notify.mobile_app_iphone
    data:
      message: I Confirm Your Summon!
      title: Confirm Summon!
mode: single

an actionable notification will send back an event once clicked to HA so you can process it like any other automation like a webhook. The example on the linked page shows how it works with 2 actions

1 Like

Thank you for the reply. I am still unsure, I don’t want to open a URI, I’d like to activate a script. How would I do that?

You don’t have to call an URI. If the action is clicked, the app will send an event to Home Assistant. You have to listen for an event with event_type: mobile_app_notification_action and your defined action in the event_data

platform: event
event_type: mobile_app_notification_action
event_data:
  action: YOUR_ACTION

Have a look at the example in the docs: Actionable Notifications | Home Assistant Companion Docs

1 Like

Thanks, This works!