Kiosk not working with chrome on Android?

I put in my chrome browser on android

https:xxx.duckdns.org/kiosk/group.all_lights_view

then I use the function ADD TO HOME SCREEN

When on the home screen I click on the icon it opens up the regular view (NOT kiosk mode)

I am in the same boat as you, I think it is chrome that makes it like an webapp in that process. I tried firefox, but for me that was super slow. A workaround for me is to use this app. The best way is to add support for choose “myview” as default view in home assistant.

As a workaround, you can edit /srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/frontend/init.py. Line 42 (in version 0.53.1) says
‘start_url’: ‘/’,
Change that to for example
‘start_url’: ‘/kiosk/group.lights’,

Then restart HASS, visit HASS in Chrome on Android, add to home screen.

Note that path varies depending on how it was installed. I expect the change to reset after each upgrade of HASS, but the shortcut will keep working. Also, I notice that my underscore, underscore, init, underscore, underscored was f*cked up by the WYSIWYG-editor.

3 Likes

Hey there,
thanks for the hint where it is located. I found out today that the manifest.json is the reason behind the strange behavior that it opens the main page even when you add a (sub)page with a different URL to the homescreen.
I’m quite annoyed by the default_view behavior of HA but don’t want to remove it altoghether as I’m still extending my hardware. On mobile devices it just sucks to start on the slowest page of the whole thing every time.

Instead of your solution (which is fine if you always want to start from there) you can also just remove the start_url line from that file completely. This should allow you to bookmark any home assistant screen to the homescreen.

In case of a docker installation, the file in question is
/usr/lib/python3.6/site-packages/homeassistant/components/frontend/__init__.py
around line 50.

Cheers

ps. finding useful threads about this is also hard. So here are a couple of tags for future searchers:
“Android” “Add to homescreen” “PWA” “manifest.json” :robot:

3 Likes

@jo-me , on my install of hassio the above path is not correct, in usr/lib I don’t have python3.6. im on hassio version 0.61.0.dev0. i’m a bit of a noob with hassio/home assistant and not sure where else to look for that file. any pointers??

You can always search for that file. Assuming that it is called the same you can execute:

find / -name "__init__.py" | grep "/components/frontend"

If this does not yield results look for other similar named files in the frontend component:

find / | grep "/components/frontend"

1 Like

sorry to be a pain but both commands return nothing.

The name of the file depends on the installation type. I have it in docker. Refer to the post above mine for the file name in a different situation, e.g. Try init.py instead of init.py.

1 Like

@jo-me I tried every combo and just cant find it, my srv folder is empty so the above post doesn’t help either. can you just confirm im doing it right please. I ssh into my hassio install, then run the following
cd /usr/lib
ls (also tried # ls -al)
and then i should see a dir called python3.6 ???

Are you running hassio or another container based setup? If so, you have to look inside of the HA container.

1 Like

hi jo, i’m running Hassio 0.61.1