Copy content to Android clipboard with command notification

Hi all,

I previously posted my issue here but was redirected on mobile apps category.

The need is to copy to clipboard the content of the input text ‘etsy_link_x’ when clicking on ‘etsy_x’. (Which I update throught a webscrapper script).

Someone propose to fire an intent throught an app notification. I tried so but I didn’t manage to make it work.

From Notification Commands | Home Assistant Companion Docs, I tried something like this :

service: notify.mobile_app_pixel_6_pro
data:
  message: "command_activity"
  title: "?text:test"
  data:
    channel: "com.google.android.apps.docs.app.SendTextToClipboard"
    tag: "android.intent.action.SEND"
    

My app tells me there is something wrong with the format of this intent.

I don’t know if any of parameters are the good ones (channel nor tag nor title…) and I can’t find any documentation about it. Have you any idea about what channel or tag or title to use ?
I guess it need some type of URI for the title but I don’t know the expected format.

THX ! :slight_smile:

Hi @rdorys,

I’m facing the same problem now. Did you ever manage to make it work? Does anybody else have an idea how to make it work?

Thx!

Hi @OnTarget,
Sorry I didn’t manage to do it.

I just copy paste the link manually. It only takes a second.

I remember that I found a solution that worked only on browser (both on computer or on Android browser) but not in the companion app.

It consisted in using button card action in JavaScript to store the desired value in the clipboard. GitHub - custom-cards/button-card: ❇️ Lovelace button-card for home assistant

And How to save a string to clipboard in JavaScript - DEV Community

Sorry I don’t have a working example anymore because it didn’t fit my need at the time and I didn’t keep it.

Could it work with you ?
Regards