Reconnecting all the time?

Hi,
today I read that Home Habit is out of beta. Nice, but I’m wondering that this issue is not solved before. It’s not a small bug e.g. for one item but instead totallly blocking me from using Home Habit. I have 3 different tablets at home and all of them are not working anymore, just doing connect and reconnect. If you’re interested I can send you more details about the three different tablets ans OS versions, but I think it’s more a general issue with regards to certificate, reverse proxy ?
My setup is Home Assistant with Let’s Encrypt Certificate and using an NGINX reverse proxy with no authorization (besides the Home Assistant Logon).

Hoping to get this solved soon.

Regards,
Michel

Hi I also have the same issue with reconnecting all the time. Firstly I was thinking that my Android tablet is disconnecting from WiFi, but I tried wired ethernet with same results so it’s not in internet connection. Then I tried every other Android device at my home that I have (5 phones and 4 tablets) and everyone had the same problem… So I tried fresh installing HASS on my spare Pi3 and I didn’t changed or added anything to it and that worked… So now I’m thinking if it is issue on my main VM HASS install? Is problem if my port was changed from 8123 to 80 or maybe something else?

Maybe someone who has Home Habit app working with Home Assistant can share us their setup!
My setup is currently:
Internet -> Cloudflare HTTPS (certificate) -> NGINX proxy HTTPS (letsencrypt certificate) -> Home assistant (https - own certificate)
I can also say that home assistant is blocking the home habit app after couple of minutes. So it seems there is a problem with the authentification!

1 Like

@michelm thank you for uploading the logs. It looks like your issue is similar, or same, to something that is being investigated right now. It does appear to be authentication-related. However, the weird part is that only some requests fail, even though initial connection test succeeds.

On a side note, I noticed you have both Nginx and HA have separate certificates - is there a benefit to this setup? I personally use certificate on Nginx side only, so wondering if I’m missing some security benefits.

Normally you also want to secure your network communication within your own network. If the connection from NGINX to your HA is using http then someone can listen to your network traffic. That’s why I also try to secure all my inter-LAN traffic with https. In regards for this connection issue, I also tried with a HA instance which listen to http port instead of https. Some problem with the connection issues.

So in your case Nginx and HA are not on the same machine, right?
That makes sense then.

@michelm do you have anything special in Nginx proxy config that affects only specific URIs?

@igor It’s not related to NGINX. I just connected my tablet directly to HA instance (https with own certificate) and it forwards me to the login page, then authentification succed and then I get the same error also with direct connection. I also uploaed today (04/08/20) the logs for connecting to HA without any proxy where I get the same issue.

Just wanted to update that this is still under investigation.
It looks like HA streaming API endpoint gives authentication error even when provided with valid credentials. So there might be a bug in HA, since this is not expected behavior. Will update with more later.

1 Like

Hi @igor,

are you able to reproduce the issue?
Today I setup another HA instance from scratch as a development instance for testing. I also added the https certificate to this server and the home habit client connects without any issues.
So it might be that a specific component in HA is causing the issue. Do you have any idea which component could be the reason? Then I could verify and test. I already added some camera streams which are working fine.

/Michel

I think I found the issue at least for my setup!
I always used a separate user which had limited authorizations (no admin). Once I added the admin privileges to the user as well it’s working.

Hope this solves the issue for other users as well!

1 Like

Oh, that’s great news!
Will test that on my side as well.

I can indeed confirm that the issue exists when using non-admin Home Assistant users. This is not documented, but confirmed through HA source code as well.

@michelm thanks for sticking with it!

1 Like