Android "add to home screen" bug with ssl

I’m facing a very strange behaviour with the “add to home screen” link on chome browser of android. If I do this on the http version of home assistant page, it asks me the name I would like for the link and add it to the home screen. However if SSL is enabled and I acess the https version of the site, when I click the “add to home screen” it does not ask for a link name, informs that the link was created, but no link is created. is anybody facing a similar issue?

No problem here

android version?
phone model?
which browser?

1 Like

Android 7.0, Moto G5, Chome 60.3112.116

Don’t know if it make any sense, but after setup of html5 notifications, the add to home screen is working as expected.

I seem to be having the same issue, I had set up a web app with A2HS a number of months ago but I just set up SSL (using a CA-issued certificate) so I needed to recreate the icon. Setting up html5 push notifications did not solve it for me.

Android 9.0, Google Pixel, Chrome 58.0.3029.125, Chrome 61.0.3163.98, Chrome Beta 62.0.3202.52

So after much playing around I was finally able to get the option to appear and work. I changed my default launcher to the Pixel Launcher, then completely closed chrome and re-launched it. Then the option to add to home screen appeared so I switched the default launcher back to Action Launcher, switched back to Chrome, and add to homescreen worked.

Curiously, the shortcut no longer launches in a standalone, full screen instance - it now just opens as another tab within Chrome. So it didn’t really as it as a Portable Web App but rather just created a shortcut.

Same to me. Don’t know what I did, but now I have a link that open a full screen app,and other that open as a chrome tab.

I have the same issue, I think what chrome is doing is installing the app (which is really just a shortcut) rather than creating an icon for the web app. I’ll try setting up html 5 notifications and see if that works for me.

So I ran into some similar issues. For anybody that cares I found that using example.com would fail but www.example.com worked. I needed to add the www version of the URL to the SSL cert to get it to come up with out complaining about “Not secure” but then it seemed fine.

I have the same issue and didn’t see this thread until now so had created another one. Using your suggestion with adding the ‘www’ has allowed it to link properly and open in kiosk mode rather than a chrome tab however I now have a warning bar across the top of the screen… It’s still far better than it opening a chrome tab though

Just cross-posting this here from the other thread:

Seems to have something to to with googles “Progressive Web Apps”. I’m currently assuming PWAs only work with valid SSL. So HA is probably not configured right for PWA support?

EDIT: just confirmed, this is on a page about PWA: “Served via TLS to prevent snooping and ensure content hasn’t been tampered with.” This is definetly the reason this only happens with SSL enabled.

Current workaround that works for me to force a non PWA web app install:

  1. Start HA with a self-signed (invalid) certificate
  2. Install the webapp
  3. Start HA with your valid certificate again, it will continue to work.

Let’s hope that someone with enough knowledge of PWAs can fix this.

Thanks for posting that info from the other linked thread. I found this thread first. I just wanted to add that I am experiencing the same issue. The workaround did work for me so at least it is working properly for now. Hopefully the devs can find the real issue and get it resolved in a future release.

Im having the same issue. Without ssl enabled, adding to the Home screen worked perfectly fine and created the web-app. After setting up DuckDNS and Let’s Encrypt, it now opens a tab in chrome instead. I’m still working on getting the push notifications working but not sure if that will fix the issue.

Same issue here

Found another quick little work around after reading this post.
just go into your config and # out ssl_certificate: /ssl/fullchain.pem and ssl_key: /ssl/privkey.pem. Then restart home assistant. while its restarting navigate to your https url and hit add to home screen and it should work normal. Then un # your ssl_certificate and ssl_key in your config and issue another restart. Now your shortcut on your home screen should be working =]

1 Like

I was able to port forward 443 to 8123 on my router and it fixed the issue with the certificate. Now loading https://example.duckdns.org and Adding to home screen works fine. It’s still an issue if you use https://example.duckdns.org:8123 or https://www.example.duckdns.org since the certificate using the DuckDNS addon doesnt get a cert for that domain.

2 Likes

thank you for that @Neil_Grewal! you saved my evening [was just starting to curse very loud at my hass.io installation ;)]

1 Like

No problem! Glad I could help. I went through the same thing, reset my whole Hass.io setup and was about to give up and found that small trick worked.

Never had this issue, as i added it to my old phone before i setup a valid ssl cert. now added it to my new phone and i get this :frowning:

Tried using 443 instead of 8123 and it works properly. Somehow Android Chrome it isn’t liking HTTPS on a non-standard port.