hatl / hasscontrol

Simple garmin widget to control home assistant scenes
Other
134 stars 19 forks source link

Constantly need to log in #68

Open protist opened 1 month ago

protist commented 1 month ago

Hi, this initially works perfectly on my Garmin vívoactive 5. I can log in, provide credentials, and access Home Assistant fine. However, within 24 hours or so, it will fail. When I try and trigger something on my watch, it either stalls at Running or shows the "IQ" logo with an exclamation mark. My phone will show the Home Assistant log in screen, and I have to log in again on my phone.

I'm happy to provide more logs etc. if helpful.

hatl commented 1 month ago

hi have you tried using a long-lived access token?

protist commented 1 month ago

Thanks for the quick reply @hatl . I just tried using the token instead, and I have not been prompted to log in again on my phone. It's definitely working better, but it's pretty flaky. I just tried testing eight times. It worked twice, but failed the other six. Three times I got Failed. Unknown error code -300, and three times I got Failed. Unknown error code -2. These occurred in no particular order, i.e. it appeared to cycle through working and the various codes.

hatl commented 1 month ago

could you please do a short video to show the issue? i'll then try to reproduce it thanks

protist commented 3 weeks ago

Thank @hatl . I've been trying to make a video, but it's been surprisingly stable most times I try! I wonder if it's because I'm trying to use my phone to record the video... which obviously means that the phone is awake! In contrast, when the phone is off hasscontrol works around ~15% of the time. However, with the phone in use, it works >90% of the time. I do have a Samsung though, which is notorious for killing background tasks. I just checked battery optimisation, and the "Connect" App is "Unrestricted" (i.e. prevent killing it). "Connect IQ" was "Optimised", but I just changed it to "Unrestricted" to see if that helps.

In any case, I'll post still images of what I see when it fails.

  1. I start by launching HassControl

1 launch-crop

  1. I tap the script

2 command-crop

  1. I see "Running", with a rotating border showing that it's in progress.

3 running-crop

  1. I see the error.

4 error-crop

hatl commented 2 weeks ago

this really could be a connection issues caused by your phone restricting the app

protist commented 2 weeks ago

@hatl very possibly. I recently tested the other HA app in the Garmin store, and this has similar issues. FWIW the HA app on my phone always works, although presumably I'm tapping on the icon, so that forces it to wake up. IDK if there's another way for hasscontrol to force a wakeup of my phone.

hatl commented 2 weeks ago

unfortunately, i don't think that there is an option to wake up the phone.