Skip to content

Cannot connect to HA in Companion App via Internal URL #3608

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

Open
merryflag4173 opened this issue May 20, 2025 · 6 comments
Open

Cannot connect to HA in Companion App via Internal URL #3608

merryflag4173 opened this issue May 20, 2025 · 6 comments
Assignees

Comments

@merryflag4173
Copy link

iOS device model, version and app version

Model Name: iPad Pro (11-inch) (3rd generation)
Software Version: 18.5
App version: 2025.5

Model Name: iPhone 11 Pro
Software Version: 18.5
App version: 2025.5

Home Assistant Core Version

2025.5

Describe the bug
I am unable to connect to my HA instance via Internal URL. External URL works (via HA Cloud). I'm also able to connect to the Internal URL from my laptop.

To Reproduce

  • Enter Internal URL under Settings > Companion app > Home > Internal URL
  • Quit app & relaunch
  • App does not connect to HA

Expected behavior

  • App should connect to HA

Screenshots

Additional context

@bgoncal
Copy link
Member

bgoncal commented May 21, 2025

Can you connect to this internal URL using iOS Safari? Any security warnings it gives you?

@bgoncal bgoncal self-assigned this May 21, 2025
@merryflag4173
Copy link
Author

merryflag4173 commented May 21, 2025 via email

@bgoncal
Copy link
Member

bgoncal commented May 22, 2025

Your images weren't uploaded to GitHub, can you try again?

@charlespick
Copy link

I think I am encountering the same issue. The new app isn't respecting the scheme defined when connecting to a server. I specify https://servername when adding the server but:
In nginx access log, I see 301 redirects to HTTPS on the /api/websocket endpoint
In the app I get a Starscream.HTTPUpgradeError
In the exported app logs I see
[Error] [main] [Environment.swift:75] init() > WebSocket: Error: Optional(Starscream.HTTPUpgradeError.notAnUpgrade(301, ["Server": "nginx/1.26.3 (Ubuntu)", "Content-Type": "text/html", "Date": "Mon, 26 May 2025 03:17:41 GMT", "Connection": "keep-alive", "Location": "https://dev-hass.makerland.xyz/api/websocket", "Content-Length": "178"]))
With TCPdump I see traffic going to port 80
04:05:09.417593 eth0 In IP 10.3.5.140.52083 > hass02.makerland.xyz.http: Flags [S], seq 600926463, win 65535, options [mss 1460,nop,wscale 6,nop,nop,TS val 4049053127 ecr 0,sackOK,eol], length 0
In the configuration.yaml, I've defined the URLs with HTTPS also. HTTP isn't mentioned anywhere but starscream is trying to connect via insecure websocket. Not sure if that makes it a bug better suited for the starscream repo. I can't tell if it's a bug in the implementation of the library or the lib itself. Swift is up there with the programming languages that confuse me the most.

@charlespick
Copy link

charlespick commented May 26, 2025

Actually now that I think about it, this might not be related. The original poster probably isn't using https. I will open a new issue if nobody tells me otherwise.

@PeterPudney
Copy link

My iOS Home Assistant Companion app stopped working today. I can still connect to my HA server (a local Raspberry Pi) via browsers from my laptop, but not from Safari or from the app on my iPhone. Perhaps it is an iOS issue.

iOS version: 18.5
Home Assistant Companion version: 2025.5 (2025.1264)

Safari says: Safari couldn't open the page because the server stopped responding.

When I try to add a server from the app, it cannot find any servers. When I try to add the server URL manually I get:

We couldn't connect to Home Assistant
...
Description: The request timed out.
Domain: HomeAssistant.OnboardingAuthError
Code: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants