Hernas / homebridge-salus-sq610

Apache License 2.0
7 stars 2 forks source link

Error: Request failed with status code 401 #1

Closed lukasztuszynski closed 1 year ago

lukasztuszynski commented 1 year ago

Describe The Bug: After some time (hours?) the plugin stops working. The accessories are presentig an outdated state. There are thousands of entries in the logs U(each couple of seconds). After restarting the service, it works fine again for a while.

To Reproduce: Start the homebridge service and wait for a while (hours?).

Expected behavior: continues update of the thermostat data

Logs:

[2/21/2023, 2:37:30 PM] [@hernas/homebridge-salus-sq610] Error: Request failed with status code 401
[2/21/2023, 2:37:30 PM] [@hernas/homebridge-salus-sq610] Error: Request failed with status code 401
[2/21/2023, 2:37:45 PM] [@hernas/homebridge-salus-sq610] Error: Request failed with status code 401
[2/21/2023, 2:37:54 PM] [Homebridge UI] Homebridge restart request received
[2/21/2023, 2:37:54 PM] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process
[2/21/2023, 2:38:19 PM] [@hernas/homebridge-salus-sq610] Restoring existing accessory from cache: Łazienka
[2/21/2023, 2:38:19 PM] [@hernas/homebridge-salus-sq610] Restoring existing accessory from cache: Gabinet

Plugin Config:

{
            "email": "my@email.com",
            "password": "password",
            "refreshTime": 15,
            "_bridge": {
                "username": "0E:D1:CA:2F:42:5B",
                "port": 55084
            },
            "platform": "SalusSQ610HomebridgePlugin"
}

Environment:

bimusiek commented 1 year ago

Thanks for the report. I already saw it in my Homebridge and it looks like the token is not refreshed. I have an idea why, just need some time to fix it.

bimusiek commented 1 year ago

Can you please try v1.0.2? It should handle token refresh correctly.

lukasztuszynski commented 1 year ago

Thanks. It looks like it helped. I didn’t spot the error any more. When it gets 401 - it refreshes the token. I guess it’s just fine.