How to use the "Notification Cleared" function with HA companion app

Hi,

I have configured my HA to send notifications when outdoor IPcams detect motion while nobody is home and the alarm is armed.

When arriving home and the alarm did not detect any indoor breach while away, I want HA to automatically remove the notifications about outdoor motion at IPCAMs. These I consider a false positive (such as clouds suddenly moving in front of the sun) and should automatically be removed. BTW recordings will still reside on the HDD of my standalone NVR (not HA), so I could always look them back.

I struggle with how I can get these notification(s) cleared on our phones (1x android, 1x ios) .
The instruction on this page;

Notification Cleared | Home Assistant Companion Docs
https://companion.home-assistant.io/docs/notifications/notification-cleared

should do the job I guess, but this is insufficiently clear to me.

Could anybody help me with an example automation on how I should clear notifications on ios and android?

thanks!
Jules

automation to create the notification:

service: notify.mobile_app_oneplus9pro
data:
title: 'Hikvision detected Motion ’
message: 'Hikvision detected Motion while away ’
data:
ttl: 0
priority: high
image: /local/hikvision/CAM98_garagevoordeur.jpg
clickAction: >-
https://XXXX.ui.nabu.casa/local/hikvision/CAM98_garagevoordeur.jpg
url: >-
https://XXXX.ui.nabu.casa/local/hikvision/CAM98_garagevoordeur.jpg

For Android, it’s fairly straightforward and based on the ‘tag’ data element.

For example. if I send a notification about my garage door being open too long with a specific tag:

        - service: notify.all_mobile
          data:
            title: "Security Alert"
            message: "The Garage Door has been open for <b>{{ (15 + ((repeat.index - 1) * 5)) }}</b> minutes."
            data: 
              image: "{{ states('sensor.snapshot_remote_garage') }}{{ notify_image }}"
              clickAction: "/lovelace/camera_garage"
              ttl: 0
              color: red
              priority: high
              tag: garage_door_open
              channel: Security Alert
              group: Security
              actions:
                - action: "URI"
                  title: "View Camera"
                  uri: "/lovelace/camera_garage"
                - action: "alert_close_garage_door"
                  title: "Close Door"

I can then clear that message when it is closed using:

    - service: notify.all_mobile
      data:
        message: clear_notification
        data:
          tag: garage_door_open

We don’t have any iOS devices so I can’t comment on that.

I added a tag. On both IOS and Android this works perfect, thanks!