I have two android phones (Samsung), and have installet HA companion app on both of them. It connects fine and cards with info updates as expected.
However, when I’m creating a widget supposedly showing entity status, only one of the phones updates “instantly” when the status change, whereas the other only updates when you tap the widget.
I have tried “everything”. Yes, background run is allowed, Yes, datasaver is disabled for the companion app, Yes all permissions has been set…
I have no idea why this is happening on only one of the phones (they are different models), and I’m kind of lost here.
I have done that just about 99 times, with the exact same result every time. I can open the fresh Companion app, go through the installation with tracking and everything. The companion app itself works flawlessly and so does tracking. No error messages.
The second I try to add a widget, I start getting unauth messages. The call service widget work flawlessly and the entity state widget only works when i tap it. No auto update on state change (which is my problem).
When I start from fresh I do the following:
Close the companion app
Go to app data and clear out both data and cache
Go to home assistant (server) and clear out the phone entity
Restart home assistand server - and wait for it to come online
Open companion app again, it prompts for URL to server etc.
Log in with my wifes account (non-admin)
Everything works - autoupdate on cards works inside the compagnion app
(at this point no error messages in the server log)
Create a widget
(unauth messages start to appear in the server log)…
When I do the same on my phone, everything works as expected. Both phones are samsung/android although different models.
My server-url is an external url and my router does local redirect. I have port forwarded 8123 to my raspberry pi. No SSL involved yet.
The action button works on both phones both internally and externally - it is only the auto-update that doesn’t work.
So you are removing the integration right? Did you check to see if there is more than 1 from the same device that needs to be removed?
Maybe check to see if the websocket from the app is being blocked on the network. This works different from the frontend for widget updates.
Have you also checked companion app logs for errors? The logs you posted above are from HA core and not the app directly. You need to go to Settings > Companion App > show and share logs to get the actual on device logs which may show the actual issue.
I still have the issue. So, to rule out basically everything, I started from fresh - I removed the user, the person, the device, cleared data and cache so there was no trace of the app on the phone nor the server.
I set up a SSL tunnel with cloudflare, so now everything is running https and there are no port forwards.
I can still use both the app and the widgets on my phone, without any log entries on the server.
Then i created a new user/person pair and reinstalled the companion app on the troublesome phone. Logged in and navigated around in the app - everything works, and the server log is empty.
Then i created a widget (entity status) and immidiately i get the “unauthorized” error in the server log and it repeats itself everytime i turn on/off the screen, which makes sense.
I then collected the log from the phone which is included - clearly there is something about web-services not connecting, but why?