-
-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reconnection logic error (internal and external url) #4294
Comments
yes that just means you have a local URL defined. |
so your logs do not indicate taht WiFi is being used for data, that would indeed be a reason why the URL switching is not working as we only use the internal URL if we determine the user is on local WiFi.
what happens if you bypass this ad use the local IP address instead?
this could also be the cause of the issue |
When I bypass the rewrite rule and set the local IP address as internal URL I get I SSL handshake error because I have to use SSL and the cert is signed to the domain. |
we dont get all the states a server can be in so we have the pop-up setup, for your own use case you may want to consider changing the setting "When loading dashboard and unknown if connected to home network WiFi" to "use internal connection URL" under Settings > Companion app > Selecting your server > select home network this will allow the other URL to be tried regardless if we determine the user is on the correct network. |
I've already tried this setting, but the behaviour is the same. I think my use case fits to everyone who uses cloudflare as external URL. If possible I would change my setup in a way that this issue is solved, but I tried every combination and I don't know any more. Could you modify the code to this use case or show me in the right direction/to the responsible code? This situation is a little bit annoying. |
we have gotten a few PRs on cloudflare and have turned those down so we will not be making changes for that specific situation. your logs also do not demonstrate that the app should be changing the URL used so as of now we do not see an issue |
ok, i`ve tried also with the same domain, but without cloudflare (but with ssl on internal and external connection). same issue. it looks like the app don´t come around with the port in the external url. |
@dshokouhi Thanks for your fast answers and help! awesome community here 👍 |
Home Assistant Android app version(s):
2024.1.5-full
Android version(s):
13
Device model(s):
Samsung Galaxy S21
Home Assistant version:
2024.3.3
Last working Home Assistant release (if known):
not known
Description of problem, include YAML if issue is related to notifications:
Related Issues:
#1361
HA roaming
On my phone I can connect to both internal/external URLs, but switching between the two requires me to shutdown the HA app.
When leaving the Home Network Wifi, th HA app gives: "Connection lost. Reconnecting..." until I shutdown the HA app and start it again.
This happens in both directions:
The internal is "mydomain.de" and the external "mydomain.de:8123".
The external url is a cloudflare tunnel. On internal use with same url "mydomain.de" there's a dns rewrite rule to the correct HA ip.
If i leave my home wlan, the connection is lost. It appears a pop-up mentioned here but nothing changes with these options. After closing the app it connects to the external URL when i'm connected to GSM.
If i dont close the app and reconnect to my home wlan again, the app connects to homeassistant successfully. So i think the app never tries to connect to the external URL automatically (don`t see any reconnection logic, see attached log).
I also receive a ssl handshake error (didn't close the app) if coming from external url when connecting to my home wifi. Then the app log shows:
when closing app and reopen it, it connects as normal.
The issue is exists at least for one year for me.
Companion App Logs:
Screenshot or video of problem:
![image](https://private-user-images.githubusercontent.com/49484063/316424588-20747679-920b-4dce-97c4-2de96c87e13e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjA2ODUsIm5iZiI6MTczOTMyMDM4NSwicGF0aCI6Ii80OTQ4NDA2My8zMTY0MjQ1ODgtMjA3NDc2NzktOTIwYi00ZGNlLTk3YzQtMmRlOTZjODdlMTNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAwMzMwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYzNWRjMjI4YzNhZGE0OTcwOTBhM2FlOTM1YjhkNzJiMjExNGNlNDU5YWM4MzlhNzg5ZTI5MmM3M2FjMjM2M2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.IANrC-QAhjO5WfyCDwOf4mLpEshWLQSMf8_CfzbbqKY)
![image](https://private-user-images.githubusercontent.com/49484063/316424652-83c8dd6d-a504-4e8a-af52-db23871bcc5a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjA2ODUsIm5iZiI6MTczOTMyMDM4NSwicGF0aCI6Ii80OTQ4NDA2My8zMTY0MjQ2NTItODNjOGRkNmQtYTUwNC00ZThhLWFmNTItZGIyMzg3MWJjYzVhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAwMzMwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY4M2QxNzE0ODdhYjIyODZmNGQyZjhjMGMyOWZhODNlNTc1ZDc4ZDk4YmU5ZmJjMWZjYTA5MTk0MThlYjY3MTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9rVnwY7aOdS3Tq_yboPU6adW3--d1Ita41BAH77hF0Q)
Additional information:
another log:
log.txt
is it a normal behaviour that "ServerConnectionInfo: localUrl is: true" is always "true"?
related issue #1361
The text was updated successfully, but these errors were encountered: