iOS Actionable Notification with an "OK" button that clears it

What I want to do seems like it should be simple - when an automation triggers, have it send a notification to my phone with an “ok” button, and let the “ok” button clear the notification. But I can’t seem to find a way to do it. I’ve cobbled together some stuff from things I found in the docs (see here: - alias: "Dryer Finished" trigger: platform: state entity_id: senso - Pastebin.com), but it doesn’t work.

A “regular” notification works just fine using the following code:

    - service: notify.mobile_app_juliean_s_iphone_13
      data:
        message: Washer Done
        title: Laundry
        data:
          push:
            interruption-level: critical

But with the code in the link I get no notification at all…

Can anyone either share some code that does work, or explain what I did wrong in the linked code?

Thanks.

I don’t think you can template that action field… You can in the action_data field though.

When I have actionable notifications, there’s a dismiss option by default.

Either way, if you just add an action that you don’t handle, it should clear it as a side effect.