[SOLVED] Lovelace: Launch local Android app in Fully Kiosk Browser?

For Spotify, use:

url: intent:#Intent;launchFlags=0x10000000;component=com.spotify.music/.MainActivity;end

Here’s a good write-up of how to find intents for various apps:
https://support.actiontiles.com/communities/12/topics/1255-open-android-app-or-app-activity-via-url-formatted-shortcut

There doesn’t appear to be much of a pattern which would help in guessing.

1 Like

What is weird is that I tried setting up the weblink component in configuration.yaml using the two examples you gave, but Home Assistant failed to setup the component. I tried with the config below:

weblink:
  entities:
    - name: Spotify
      url: intent://#Intent;launchFlags=0x10000000;component=com.spotify.music/.MainActivity;end
      icon: mdi:spotify   

and I also tried with the one below, but both created errors for me.

url: intent:#Intent;launchFlags=0x10000000;component=com.spotify.music/.MainActivity;end

I would look into it more but rebooting my HA instance takes too long, haha.

That’s strange. I have the following in configuration.yaml which always works without errors.

weblink:
  entities:
    - name: Sonos
      url: intent://sonos/#Intent;launchFlags=0x10000000;component=com.sonos.acr/.SonosLaunchActivity;end
      icon: mdi:speaker
    - name: Calendar
      url: intent://calendar/#Intent;launchFlags=0x10000000;component=com.google.android.calendar/com.android.calendar.AllInOneActivity;end
      icon: mdi:calendar

Does a simple link to just a web page like the one below work for you?

weblink:
  entities:
    - name: BBC
      url: http://www.bbc.co.uk

The BBC weblink works using Chrome and my Fire HD8, but Calendar doesn’t work, though I have the app installed. It is probably an Amazon Fire tablet issue.

Hello.
I am using the same technic as described here to launch spotify on my tablet from fully kiosk. It works great. I have a small problem however. The weblink from lovelace always open a new blank tab in fully kiosk. As anyone found a way to avoid that ? It s not very user friendly to have to close the blank tab each time :wink:

I don’t think you can avoid a new tab being opened using an intent. However, using Fully Kiosk’s REST API as originally suggested by @thomasloven in this thread does not open another tab. It’s a bit more work, though.

The REST command format for launching an app is:

http://ip-address:2323/?cmd=startApplication&package=[pkg]&password=[pass]

[pkg] refers to the Android package name. Some package name examples:

  • Sonos - com.sonos.acr
  • Spotify - com.spotify.music
  • Tado - com.tado
  • Google Maps - com.google.android.gm

To find the package name of an installed app, go to Settings/Universal Launcher/Select Items to Show/Add Application in Fully Kiosk. You’ll see a list of installed apps with the package name underneath each.

To enable the REST API in Fully Kiosk go to Settings/Remote Administration (PLUS):

  1. Turn on Enable Remote Administration
  2. Set a Remote Admin Password - Use your password in place of [pass] in the url above. Do not include the brackets.
  3. Turn on Remote Admin from Local Network - Note the IP address. It goes in place of ip-address in the URL above. (You’ll probably want to set a that as a static IP on your router.)

EXAMPLE: Launch Spotify

Edit configuration.yaml:

rest_command:
  launch_spotify_on_android_tab:
    url: http://192.168.xx.xx:2323/?cmd=startApplication&package=com.spotify.music&password=YourPassword
    method: POST

script:
  spotify_app:
    sequence:
       - service: rest_command.launch_spotify_on_android_tab

Add a Lovelace button using the frontend UI or raw config editor:

type: entity-button
name: Spotify
icon: 'mdi:speaker'
tap_action:
  action: call-service
  service: script.turn_on
  service_data:
    entity_id: script.spotify_app
entity: script.spotify_app
hold_action:
  action: none
6 Likes

Thanks a lot for the detailed answer. I’ll do that :slight_smile:

1 Like

Thanks that’s working great, is there a way to pass the ip of the calling device as a parameter, as i have 3 of wall mounted kiosks, and want to know which one called the service, or perhaps having 3 ui conditional elements for each kiosk and only show 1 per device but i dont know hiw to implement this. Any advice?

I don’t think that you can pass parameters such as the IP address directly, but there are other ways that you can differentiate among more than one tablet.

I have two tablets. I handle them as follows:

  1. Create two Lovelace tabs, one for each tablet with different script entity_ids in the launch buttons on each, e.g. on one tablet the action looks like this:
tap_action:
  action: call-service
  service: script.turn_on
  service_data:
    entity_id: script.call_spotify_topfloortab_launch

And on the other tablet a different entity_id in the action, e.g.,

entity_id: script.call_spotify_diningroomtab_launch

  1. Control which tab is available on which tablet using Compact Custom Header: CCH.

  2. Create two separate scripts and rest commands that correspond to each tablet. For example, the script for one tablet:

  alias: "Launch Sonos app on DININGROOMTAB" 
  sequence:
    - service: rest_command.sonos_diningroomtab_launch

and the corresponding rest command:

sonos_topfloortab_launch:
  url: http://192.168.xxx.xxx:2323/?cmd=startApplication&package=com.sonos.acr&password=xxxxxxxxx
  method: POST

and on the other tablet:

  alias: "Launch Sonos app on TOPFLOORTAB" 
  sequence:
    - service: rest_command.sonos_topfloortab_launch

and

sonos_topfloortab_launch:
  url: http://192.168.xxx.xxx:2323/?cmd=startApplication&package=com.sonos.acr&password=xxxxxxxxx
  method: POST

You could reduce the duplication using templates and perhaps conditional cards, but this works. I haven’t gotten around to making it more elegant.

How do you differentiate with CCH the 2 tablets are they using different users? Or you can query ip/mac ?

I created a “user” for each of the tablets and set exception conditions for each of those users.

I wander if there is a possibility to have a floting buttun to get back home to lovelace after launching another app, like an overlays button.

I have seen this in a home, i like this idea on a akuvok system that launches IVMS (android app for cameras) and keeps a small virtual green home button at the right bottom curner, see thsi video
https://youtu.be/lgVYyHYxnH8, at 00:19

Ran into this thread today and ronschaeffer’s solutions works great. Now find something to return to Home-Assistant

I just use the home button to return to HA running in kiosk mode.

Old thread, but thought I would point out that if you have javascript enabled in Fully, this lovelace weblink will open your app with no round trip to the server and no new tab. Gets around the few seconds “reconnecting” time when I turn my tablet on.

entities:
  - icon: 'mdi:speaker'
    name: Spotify
    type: weblink
    url: 'javascript:fully.startApplication(''com.spotify.music'')'
show_header_toggle: false
type: entities

Unfortunately I haven’t been able to get it working with any picture card. The url tap action seems to want to still open a new tab

Thank you for this!

Do you know if it is possible to prevent HA from reloading the HA front page when going back from spotify using the home button on tablet?

Thanks!

Mine does not reload when going back to HA from Android apps via the home button.

Are any of the Web Auto Reload settings turned on? All of mine are turned off. That might the culprit.

Hello, I had ‘load start url on home button’ enabled. Everything is working now, thanks!

1 Like

Hello!

What now when weblink has been deprecated?
Any ideas?
(I haven’t updated HA yet)

You don’t need to use weblink. See here [SOLVED] Lovelace: Launch local Android app in Fully Kiosk Browser?