home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.27k stars 629 forks source link

AAOS companion app times out connecting to server #4482

Open palengh opened 3 months ago

palengh commented 3 months ago

Home Assistant Android app version(s): AAOS: 2024.6.1-full Android version(s): AAOS 12 Device model(s): Polestar 2 Home Assistant version:

Core: 2024.6.4 Supervisor: 2024.06.2 Operating System: 12.4

Last working Home Assistant release (if known):

Description of problem, include YAML if issue is related to notifications: Loading entities times out? See video

Companion App Logs:

Screenshot or video of problem:

https://github.com/home-assistant/android/assets/12332161/cbfeba64-ea7d-4b05-81ab-9e6cb4bdebd1

Additional information: https://discord.com/channels/330944238910963714/562408603345092636/1255619349629370368

palengh commented 3 months ago

Not Android Auto; Android Automotive!

dshokouhi commented 3 months ago

Not Android Auto; Android Automotive!

its the just a label as the code impacts both

palengh commented 3 months ago

I installed the AAOS app today, only succeeding loading cover (once), even getting response pressing it (opening the garage door), and I successfully loaded all my scripts. Never testet any of them.

palengh commented 3 months ago

My predefined Zones are recognized and logged when out driving today :-)

"Ble oppdaget på" ---> "was seen at"

Skjermbilde 2024-06-27 kl  23 08 35

Still no difference in using the app outside my home address.

dshokouhi commented 3 months ago

so data can be sent from app to server, seems some issue reading the entities as we can generate teh domain list just fine. i think we definitely needs logs or more data on the entities in question. Can you share all the data from your cover entity? Like whatever is listed in developer options states tab? maybe something will give us a clue.

palengh commented 3 months ago

Not much here. The entity is an ESP32 device. See log below. cover.garasjeport

device_class: garage friendly_name: Garasjeport supported_features: 11

INFO ESPHome 2024.6.3 INFO Reading configuration /config/esphome/garasjeport.yaml... INFO Detected timezone 'Europe/Oslo' INFO Starting log output from 192.168.xx.xxx using esphome API INFO Successfully connected to garasjeport @ 192.168.xx.xxx in 0.004s INFO Successful handshake with garasjeport @ 192.168.xx.xxx in 0.015s [09:00:27][I][app:100]: ESPHome version 2024.6.3 compiled on Jun 26 2024, 21:09:43

[09:00:27][C][wifi:427]: Local MAC: BC:DD:C2:6C:XX:XX [09:00:27][C][wifi:432]: SSID: 'xxxx-xxxx'[redacted] [09:00:27][C][wifi:435]: IP Address: 192.168.x.xxx [09:00:27][C][wifi:438]: BSSID: 40:3C:FC:03:XX:XX[redacted]

[09:00:27][C][wifi:442]: Signal strength: -63 dB ▂▄▆█ [09:00:27][C][wifi:446]: Channel: 1 [09:00:27][C][wifi:447]: Subnet: 255.255.255.0 [09:00:27][C][wifi:448]: Gateway: 192.168.xx.xx [09:00:27][C][wifi:449]: DNS1: 192.168.xx.xx [09:00:27][C][wifi:450]: DNS2: 8.8.8.8

[09:00:27][C][logger:186]: Level: DEBUG [09:00:27][C][logger:188]: Log Baud Rate: 115200 [09:00:27][C][logger:189]: Hardware UART: UART0 [09:00:27][C][uptime.sensor:031]: Uptime Sensor 'Garasjeport Uptime' [09:00:27][C][uptime.sensor:031]: Device Class: 'duration' [09:00:27][C][uptime.sensor:031]: State Class: 'total_increasing' [09:00:27][C][uptime.sensor:031]: Unit of Measurement: 's' [09:00:27][C][uptime.sensor:031]: Accuracy Decimals: 0

[09:00:27][C][switch.gpio:068]: GPIO Switch 'Garasjeport åpner' [09:00:27][C][switch.gpio:090]: Restore Mode: always OFF [09:00:27][C][switch.gpio:031]: Pin: GPIO5 [09:00:27][C][template.cover:073]: Template Cover 'Garasjeport' [09:00:27][C][template.cover:073]: Device Class: 'garage' [09:00:27][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Garasjeport OPEN' [09:00:27][C][gpio.binary_sensor:015]: Device Class: 'opening' [09:00:27][C][gpio.binary_sensor:016]: Pin: GPIO12 [09:00:27][C][wifi_info:013]: WifiInfo Mac Address 'ESP MAC Wifi Address' [09:00:27][C][restart:068]: Restart Switch 'Garasjeport restart'

[09:00:27][C][restart:090]: Restore Mode: always OFF [09:00:27][C][web_server:173]: Web Server: [09:00:27][C][web_server:174]: Address: garasjeport.local:80 [09:00:27][C][sntp:048]: SNTP Time: [09:00:27][C][sntp:049]: Server 1: '0.pool.ntp.org' [09:00:27][C][sntp:050]: Server 2: '1.pool.ntp.org' [09:00:27][C][sntp:051]: Server 3: '2.pool.ntp.org'

[09:00:27][C][mdns:116]: Hostname: garasjeport [09:00:27][C][esphome.ota:073]: Over-The-Air updates: [09:00:27][C][esphome.ota:074]: Address: xxxxx:nnnn [09:00:27][C][esphome.ota:075]: Version: 2 [09:00:27][C][safe_mode:018]: Safe Mode: [09:00:27][C][safe_mode:019]: Boot considered successful after 60 seconds [09:00:27][C][safe_mode:021]: Invoke after 10 boot attempts [09:00:27][C][safe_mode:022]: Remain in safe mode for 300 seconds [09:00:27][C][api:139]: API Server: [09:00:27][C][api:140]: Address: xxxx:nnnn [09:00:27][C][api:144]: Using noise encryption: NO [09:00:27][C][wifi_signal.sensor:009]: WiFi Signal 'Garasjeport WiFi signal' [09:00:27][C][wifi_signal.sensor:009]: Device Class: 'signal_strength' [09:00:27][C][wifi_signal.sensor:009]: State Class: 'measurement' [09:00:27][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm' [09:00:27][C][wifi_signal.sensor:009]: Accuracy Decimals: 0 [09:00:27][C][wifi_info:011]: WifiInfo SSID 'ESP Connected SSID' [09:00:27][C][wifi_info:012]: WifiInfo BSSID 'ESP Connected BSSID' [09:00:27][C][wifi_info:010]: WifiInfo Scan Results 'ESP Latest Scan Results' [09:00:27][C][wifi_info:014]: WifiInfo DNS Address 'ESP DNS Address' [09:00:27][C][wifi_info:009]: WifiInfo IPAddress 'ESP IP Address' [09:00:28][D][sensor:093]: 'Garasjeport Uptime': Sending state 979.97101 s with 0 decimals of accuracy [09:00:38][D][sensor:093]: 'Garasjeport Uptime': Sending state 989.97400 s with 0 decimals of accuracy [09:00:48][D][sensor:093]: 'Garasjeport Uptime': Sending state 999.97198 s with 0 decimals of accuracy [09:00:49][D][sensor:093]: 'Garasjeport WiFi signal': Sending state -64.00000 dBm with 0 decimals of accuracy

dshokouhi commented 3 months ago

ok we will need logs in order to proceed here, which may be challenging if you cannot get to app settings. When this issue occurs I assume the app exits is that correct? If so then getting logs may be more challenging as our app wont be able to pull the logs if we crash.

palengh commented 2 months ago

The app exits.

palengh commented 1 month ago

This is on a brand new car, MY2025 running Android 12, Polestar version P3.1.10

https://github.com/user-attachments/assets/97fdc988-a4ca-4ed4-98ab-61e03b50c0c3

Then the app times out and terminate.

dshokouhi commented 1 month ago

In both videos you are trying the cover domain, what about the other domains? Can you check them all and see if the same issue occurs?

palengh commented 1 month ago

All the other domains fail the same. There are also some equally observations from other users reported in my post on the HA Facebook group.

dshokouhi commented 1 month ago

ok unfortunately without logs we wont be able to continue troubleshooting and getting logs off the car may not be doable

dshokouhi commented 1 month ago

i am personally unable to reproduce using the emulator

image

even executing an entity works: image

so logs are definitely required here

I suspect the issue may be with a problem entity or possibly related to the servers networking. Whats strange is that we get list of entities on the screen where the domains are listed . Can you share all the attribute data from states panel for every cover entity you have please? At this point we need more data.

palengh commented 1 month ago

image

CrallH commented 1 month ago

I have a volvo C40 with Automotive. I have the same issue as TS to. It does not matter what domain I try to open, it times our almost all the time. Some times I can retry once or twice and the get access, but most of the time it just times out. Same server works fine in Android Auto i my other car. I gave up using it in Automotive. How would I log this to help?

dshokouhi commented 1 month ago

How would I log this to help?

thast what we are currently stuck on trying to figure out. I am not sure an app like Logcat Reader will work and I am also not sure if you can connect the car to android studio to pull the logs. The fact that it works sometimes and not all the times is peculiar.

CrallH commented 1 month ago

How would I log this to help?

thast what we are currently stuck on trying to figure out. I am not sure an app like Logcat Reader will work and I am also not sure if you can connect the car to android studio to pull the logs. The fact that it works sometimes and not all the times is peculiar.

I can't enter developer mode in the car, Volvo seams to have blocked that. Can't find an app called logcat reader in AA play store either. Made a video showing how it works and not works, to big so a Google photos link here: https://photos.app.goo.gl/yJcAfskyMt1WXvZDA

palengh commented 1 month ago

@dshokouhi you have reports from other car vendors? Volvo owns Polestar, so those two implementations would be related somehow.

dshokouhi commented 1 month ago

@dshokouhi you have reports from other car vendors? Volvo owns Polestar, so those two implementations would be related somehow.

Only what's been reported here. The emulator used is the one provided by polestar too.