Trigger an shellcommand/service before opening an app with URI

Hey, i have below

On notification below when i click on “hikconnect” acrions, it opens my hikconnect app on android
but is t also possible to fire an service right before opening the app?
Basicly when i click on that action, it want it to do 2 things :slight_smile:

  - service: !secret notify_ha_fabio
    data:
      title: "Doorbell"
      message: "Someone at the door..."
      data:
        channel: Deurbel
        clickAction: !secret camera_url
        actions:
          - action: "URI"
            title: "HikConnect"
            uri: "app://com.hikvision.hikconnect"

you can try to see if you get a notification cleared event, otherwise you can try to have the action send back an event and from there you fire your service and launch the app using command_activity

ah, that command activity is indeed new to me, thnx for pointing
I was reading about it, seems there is a tag/title

Does that actually means you can go a a specific setting/page within an app?
I have a doorcom app, i need to open it, access the specific device and start audio , so basicly i need todo 3 things, can this be simulated somehow? or am i misunderstanding this?

also, another question, can i also use the command_activity ; but not from an notification action? but based on a state of a sensor in HA? lets say, a a sensor changes, state, instead of sending a notification, can i also open the an app or the HA app and wake the device?

also, what do you mean by: “you can try to see if you get a notification cleared event”

was already trying just opening the app on my phone with this script :

openapp:
  alias: Test APP
  sequence:
  - service: !secret notify_ha_fabio
    data:
      message: command_activity
      title: com.hikvision.hikconnect
      data:
        channel: com.hikvision.hikconnect
        tag: android.intent.action.VIEW

but, when i do that, i receive an error on my HA app something : cannot send job, check layout? :slight_smile:
thnx

already test from a weblink, thats seems to work , but i need to to fire from a script or from a service that i can use in an action on HA companion app


          - type: entities
            title: Asterisk
            show_header_toggle: false
            entities:
              - type: weblink
                name: Hikvision
                url: "app://com.hikvision.hikconnect"