Closed LeaderbotX400 closed 8 months ago
Issue persists every day, same error.
I have to resetup the integration every day in the morning so far because it is unable to request a token.
Have you checked to see if your thermostat is going offline? Another user had this issue and that was the reason.
I have added some additional debugging to the code.
Add debug to your configuration.yaml to show more info:
logger:
default: error
logs:
custom_components.daikinskyport: debug
daikinskyport: debug
daikinskyport.daikin_set_thermostat_schedule: debug
climate.daikinskyport: debug
Reviewing the logs this morning and it seems to not have an issue thus far. My thermostat seems to go unavalible on occasion so maybe that is overlapping when it requests a new token causing it to fail?
That would be my guess. There is an updated check in the latest version (I think I fixed it) to see if the device is offline which may have fixed it as well. Look through your logs and see if it says the device is offline anywhere.
I'm assuming since there's no update that this issue is closed.
I think this issue might be related to what I am seeing. Currently have two Amana thermostats and all entities from both go offline once every hour then come back seconds later. Enabled debug and error logging and will update when I have more info.
2024-02-19 12:36:31.307 DEBUG (SyncWorker_0) [daikinskyport] Error connecting to Daikin Skyport while attempting to get thermostat data. Status code: 401 Message: {"message":"Unauthorized"}
2024-02-19 12:36:31.308 DEBUG (MainThread) [custom_components.daikinskyport] Daikin Skyport tokens expired
2024-02-19 12:36:31.308 DEBUG (MainThread) [custom_components.daikinskyport] Refreshing Daikin Skyport tokens and updating config entry
2024-02-19 12:36:31.725 DEBUG (MainThread) [custom_components.daikinskyport] Update listener:
Getting 401 Unauthorized then recovers
For now that is normal behavior. It happens when the token expires and the integration needs to request a new one. I haven't had a chance to look into why it goes offline
For now that is normal behavior. It happens when the token expires and the integration needs to request a new one. I haven't had a chance to look into why it goes offline
If this has a known interval for timeout, could the integration potentially request a new token before the old one expires?
No clue how this would affect the existing token
I have noticed this issue has shown up in several other issues.
Steps tried: