Android Intents - Sending & Receiving List (Starting Activities too!)

Can someone help me? I am just trying to set up a command_activity to open tinyCam Pro to a specific camera.
What am I doing wrong?

service: notify.mobile_app_nate_phone
data:
  message: "command_activity"
  title: "com.alexvas.dvr.activity.MainActivity"
  data:
    channel: com.alexvas.dvr.pro
    tag: "android.intent.action.VIEW"
    group: "com.alexvas.dvr.intent.extra.shortcut.NAME:Nursery"

Try changing the tag to match the intent action used in the example from Reddit.

android.intent.action.MAIN

The Intent.ACTION_MAIN can be found on google’s docs site Intent  |  Android Developers

Thanks for the quick reply… I forgot, I was trying to open to a specific camera instead of the main activity, so here is what I have:

service: notify.mobile_app_nate_phone
data:
  message: "command_activity"
  title: "com.alexvas.dvr.activity.LiveViewActivity"
  data:
    channel: com.alexvas.dvr.pro
    tag: "android.intent.action.VIEW"
    group: "com.alexvas.dvr.intent.extra.shortcut.NAME:Nursery"

I don’t even get a toast message or anything

You misunderstand use the proper action and keep the extra tag there. You need to follow the directions, you won’t see an error message if you send a valid formatted intent. Apps listen for certain actions to do things you can’t just pick and choose.

Yeah, I guess I don’t understand. The app comes up for a split second and then it goes away. If I go into recent apps, it is there, but when I try to open tinyCam it just closes

the first time you used this command you made sure to grant the requested draw over apps permission right?

Yeah both HA and tinycam have those permissions

are you running tinycam pro or regular tiny cam? Not sure if it matters but I am running pro

I just tested this command and it worked and my camera is called Baby Monitor

service: notify.mobile_app_dannys_pixel_4_xl
data:
  message: command_activity
  data:
    intent_action: "android.intent.action.MAIN"
    intent_extras: "com.alexvas.dvr.intent.extra.shortcut.NAME:Baby Monitor"
    intent_package_name: "com.alexvas.dvr.pro"
1 Like

That did it! I didn’t realize I didn’t need the title, but that makes sense when running the main intent action

1 Like

removing the title was goign to be my next suggestion but I had a moment to test the command myself to provide a proper example :slight_smile:

Thats why we say in the docs you have to play with it. If we were to provide examples it could be never ending lol.

I’m not sure if my question belongs here so apologies if it doesn’t.

When sending an attachment e.g. a .jpg, is there a way to have the picture shown full screen when tapping the notification rather than the notification disappearing?

Would this be an intent?

Unless it’s trivial (and therefore easy to tell me here), I don’t need specific instructions, just a pointer to where I should look.

Perhaps make the notification actionable and the action is open the image url?
Not sure if that works but that is what I would try.

I have a hard time starting Audible:

action:
  - service: notify.mobile_app_n20
    data:
      message: "command_activity"
      data:
        tag: "android.intent.action.MAIN"
        channel: "com.audible.application"

This should do it, but i get “Unable to send activity intent…”

Got this from Shortcut Maker:

Action=android.intent.action.MAIN
Package Name=com.audible.application
Class Name=com.audible.application/com.audible.application.SplashScreen
Extras=>
Flags=>
ACTIVITY_NEW_TASK

And also this:

Action=android.intent.action.MAIN
Package Name=com.audible.application
Class Name=com.audible.application/com.audible.application.SplashScreen
Extras=>

and while both create working shortcuts, no combination of strings in Home Assistant was able to start the app.

Any ideas are more than welcome.

doing a quick google search leads to this stackoverflow which suggest Audible listens to its own intent strings as well.

try using tag: "com.audible.application.app.PLAY"

Thanks, I did try google before posting, but all of what i found, including the linked thread, suggest that these are not working. This is also what I experience.
In the example above i am just trying to open Audible, instead playing it. It’s not opening to begin with, so i thought that i might be missing something obvious.

the person who wrote the post actually said the app launched and did not play anything

if you already tried a known working intent as mentioned in stackoverflow then you need to look at Audibles manifest to see if the intents have changed.

Yeah, they seem to have changed. None of the ones mentioned in that thread are there, but again, that’s not the point.

I can already play/pause audible using “command_media” targeted at com.audible.application if it’s running. The problem is that i can’t start it from HA with “command_activity”, while it’s working just right for a bunch of other apps including GMaps, Instagram, Philips Hue…

On the other side:

alias: Launch Audible
sequence:
  - service: notify.mobile_app_n20
    data:
      message: "command_broadcast_intent"
      title: "com.audible.application.SplashScreen"
      data: 
        channel: "com.audible.application"
        
mode: single

This doesn’t trigger an error, but nothing happens.

And here’re the activities listed for Audible:

Activities are not the same thing as intents which I had mentioned previously to look into. You would need to use an app that will allow you to view the apps manifest to see what data it will expect to work. In an android apps manifest intents and their data are registered to certain activities which is what you are after. This is why I said its a lot of trial and error earlier. So after using an app to inspects Audibles manifest I found a working command for you.

service: notify.mobile_app
data:
  message: command_activity 
  data:
    intent_uri: "https://audible.smart.link"
    intent_action: "android.intent.action.VIEW"
    intent_package_name: "com.audible.application"

Thank you very much. I am currently looking at the manifest but haven’t got around to decode it. I assumed (and was obviously wrong) that there’s a simple way to ‘just’ launch the app without needing extra parameters and such.

By any chance, has anyone tried to open a camera from the tuya/smart life application, I’m looking for their documentation regarding opening activities/intents but I can’t find it, does anyone know anything about it?