Fully Kiosk: Launch local Android apps from your HA dashboard

Tags: #<Tag:0x00007f73b4dd8298> #<Tag:0x00007f73b4dd80e0>

Fully Kiosk is a great solution for wall-mounted tablets running Lovelace dashboards. Alongside Home Assistant, it can be useful to run local Android apps, for example to control a device which is not yet integrated into Home Assistant.

There are a few different methods of launching local Android apps from a Lovelace dashboard running in Fully Kiosk. You can use Android intents, the Fully Kiosk JavaScript API or the Fully Kiosk REST API.

JavaScript and REST API docs are here. Both APIs are Plus features, but Fully Kiosk is well worth paying for anyway.

For the JavaScript and REST API methods, you’ll need the package name of the Android app. There are a few simple ways to find the names. I’ll cover them at the end of the post.

For the Android Intent method, you’ll need to know the entire Android intent, not just the package name. It is more difficult to track down the correct intent to use than it is to find package names. You’ll find a couple of tips at the end of the post.

There are three key considerations when choosing the method of launching an local Android app:

  1. Is any Home Assistant configuration required outside of the Lovelace card config?
  2. Does the method open a new tab in Fully Kiosk? If so, you’ll have to press back twice on your Android device to get back to Fully after using the local Android app.
  3. Will the same configuration work on any Android device with the app installed, or do you have to know the IP address of the device that’s in use?

Here is a sampling of methods using the Android Chrome app as an example.

ANDROID INTENT

Con: Opens a new tab when used as a tap_action, for example in a Button Card or Picture Card.

Con: You need to know the entire Android intent, not just the package name.

Note: Works with the Free version of Fully Kiosk.

Pro: Does not open a new tab with an Entities Card, as in the example below.

Pro: Requires no configuration outside of the Lovelace card.

Pro: Works on any device with the local Android app installed.

entities:
  - icon: 'mdi:web'
    name: Chrome
    type: weblink
    url: 'intent:#Intent;component=com.android.chrome/.MainActivity;end'
type: entities

To use this method, replace the intent URL with the intent for the app that you want to launch. You can often just replace com.android.chrome with the the package name of your app, but it doesn’t work for all apps. See the end of the post.

JAVASCRIPT API

Con: Opens a new tab when used as a tap_action, for example in a Button Card or Picture Card. However, this method does not open a new tab if used in a template in a custom button card. See example below.

Note: Requires the Plus version of Fully Kiosk.

Pro: Does not open a new tab with an Entities Card, as in the example below.

Pro: Requires no configuration outside of the Lovelace card.

Pro: Works on any device with the local Android app installed.

entities:
  - icon: 'mdi:web'
    name: Chrome
    type: weblink
    url: 'javascript:fully.startApplication(''com.android.chrome'')'
type: entities

To use this method, pay for the Plus version of Fully Kiosk, then enable the JavaScript API: In Fully Kiosk go to Settings/Advance Web Settings, then turn on Enable JavaScript interface (PLUS).

Replace com.android.chrome with the name of the package you want to launch.

If you want to use the JavaScript method with a button card but without opening a new tab, you can instead use it in a template in a custom button card as below:

type: 'custom:button-card'
name: Chrome
icon: 'mdi:web'
tap_action:
  action: javascript
  launch: |
    [[[
      fully.startApplication('com.android.chrome')
    ]]]

Note that javascript and launch are just placeholders with no specific meaning. You could have any values that are not real options there. For example, this would also work:

...
tap_action:
  action: orange
  purple: |
    [[[
...

REST API

Note: Requires the Plus version of Fully Kiosk.

Con: Requires configuration outside of the Lovelace card.

Con: You must know the IP address of the Android device being used.

Pro: Never opens a new tab when used with any Lovelace or custom card I’ve tried.

Pro: Very flexible. Can be used with any card that can call a service.

icon: 'mdi:web'
name: Chrome
tap_action:
  action: call-service
  service: rest_command.your_rest_command_that_launches_chrome
type: button

To use this method, pay for the Plus version of Fully Kiosk, then enable the REST API in Fully Kiosk:

  1. Go to Settings/Remote Administration (PLUS)
  2. Turn on Enable Remote Administration
  3. Set a Remote Admin Password - Use your password in place of [pass] in the url above. Do not include the brackets.
  4. Turn on Remote Admin from Local Network - Note the IP address. It goes in place of [ip-address] in the URL in the example below (You should set the address as a static IP on your router.)

Next, create a rest_command corresponding to the app you want to launch and the device that you want to launch it on.

The REST command format for launching an app using the Fully Kiosk REST API is:

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

[ip-address] = IP address of the Android device you want to launch the app on. Don’t include the brackets.
[pkg] = Android app package name, for example com.android.chrome. Don’t include the brackets.
[pass] = Your Fully Kiosk API password. Don’t include the brackets.

Edit configuration.yaml, for example to launch Chrome:

rest_command:
  your_rest_command_that_launches_chrome:
    url: http://192.168.xxx.xxx:2323/?cmd=startApplication&package=com.android.chrome&password=your_password
    method: POST

Restart Home Assistant, and you should be good to go.

If you have more than one Android device that you want to launch apps on, there are a few different ways you can manage it.

I’m currently using a template with the custom button card as follows.

  1. I’ve created a Home Assistant user for each device.

  2. The custom button card checks which user is initiating the action and calls the appropriate rest_command.

    icon: 'mdi:web'
    name: Chrome
    tap_action:
      action: call-service
      service: |
        [[[
          if ( user.name == 'TOPFLOORTAB' )
            return 'rest_command.chrome_topfloortab_launch';    
          else
            return 'rest_command.chrome_groundfloortab_launch';
        ]]]
    type: 'custom:button-card'
    
  3. There is a REST command for each device:

    rest_command:
      chrome_groundfloortab_launch:
        url: http://192.168.xxx.xxx:2323/?cmd=startApplication&package=com.android.chrome&password=MyPassword
        method: POST
      chrome_topfloortab_launch:
        url: http://192.168.xxx.yyy:2323/?cmd=startApplication&package=com.android.chrome&password=MyPassword
        method: POST
    

Instead of using a custom card and templates to differentiate between users/devices, you could instead create separate Lovelace dashboards for each device.

TO STOP FULLY KIOSK FROM REFRESHING THE PAGE WHEN YOU GO BACK FROM AN APP

Simply go to Settings/Web Auto Reload and turn all settings off.

FINDING PACKAGE NAMES

Finding package names is easy. Here are three ways to do it:

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

  2. You can also see package names in the app’s URL if you open the Play Store in a browser on a computer:
    image

  3. You can also use an app on your Android device, such as this one.

FINDING INTENTS

Intents can be more difficult to track down that package names.

  1. Google is the first place to start, e.g., try searching “android intent for Spotify”.

  2. Some apps such as Activity Launcher list available intents for all apps. With Activity Launcher, you can try out the various intents for an app to find the one that serves your purpose. You may be able to initiate a specific activity in an app in addition to launching it.

4 Likes

Hello,

thank you for the good instructions.
Does anyone have an idea, I would like to go to a website in the Fully Browser if an event was triggered:

For example:
Alarm system is activated, I’m coming home (device tracker), now I have 30 seconds to deactivate the alarm system, the website with the alarm panel is called up and displayed on the tablet in the browser.
My system works with the REST interface, but I can’t get the website …
I need a tip for the URL.

Greetings from Germany,
Stephan