apetrycki / daikinskyport

API for accessing a DaikinOne+ Thermostat
63 stars 27 forks source link

Fails to Load when starting #78

Closed unc2k3 closed 1 year ago

unc2k3 commented 1 year ago

Hello,

I've had an issue popup where the integration will not load unless I go into the integration settings and click Reload. This seems to happen every morning and I think once or twice throughout the day (but don't quote me on that). I'm running the latest version and my system details are:

Home Assistant 2023.10.1 Supervisor 2023.10.0 Operating System 10.5 Frontend 20231005.0 - latest

Logger: homeassistant.config_entries Source: config_entries.py:399 First occurred: October 9, 2023 at 8:20:06 PM (2 occurrences) Last logged: 9:16:23 AM

Error setting up entry Daikin for daikinskyport Traceback (most recent call last): File "/config/custom_components/daikinskyport/init.py", line 161, in _async_update_data current = await self.hass.async_add_executor_job(self.daikinskyport.update) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update result = self.get_thermostats() ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikinskyport/daikinskyport.py", line 156, in get_thermostats thermostat_info = self.get_thermostat_info(thermostat['id']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikinskyport/daikinskyport.py", line 203, in get_thermostat_info raise ExpiredTokenError ("Daikin Skyport token expired") custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikinskyport/init.py", line 79, in async_setup_entry await coordinator._async_update_data() File "/config/custom_components/daikinskyport/init.py", line 165, in _async_update_data await self.hass.async_add_executor_job(self.daikinskyport.update) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update result = self.get_thermostats() ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikinskyport/daikinskyport.py", line 156, in get_thermostats thermostat_info = self.get_thermostat_info(thermostat['id']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikinskyport/daikinskyport.py", line 203, in get_thermostat_info raise ExpiredTokenError ("Daikin Skyport token expired") custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

apetrycki commented 1 year ago

Have you tried re-downloading the integration? This exception should get caught by _async_update_data and request new tokens. If that doesn't work, please set your logging to debug and capture all daikinskyport messages.

unc2k3 commented 1 year ago

Still having issues after uninstalling and reinstalling the integration.

Here are the logs:

Error setting up entry Daikin for daikinskyport

3:20:27 AM – (ERROR) config_entries.py - message first occurred at October 11, 2023 at 7:35:04 PM and shows up 2 times

Update of sensor.master_bedroom_outdoor_temperature is taking over 10 seconds

3:20:21 AM – (WARNING) helpers/entity.py - message first occurred at October 11, 2023 at 2:08:01 PM and shows up 5 times

Error setting up entry Daikin for daikinskyport

October 11, 2023 at 1:03:56 PM – (ERROR) config_entries.py - message first occurred at October 11, 2023 at 1:02:31 PM and shows up 4 times

Error refreshing Daikin Skyport tokens

October 11, 2023 at 1:03:53 PM – (ERROR) Daikin Skyport (custom integration) - message first occurred at October 11, 2023 at 1:02:28 PM and shows up 4 times

Error while requesting tokens from daikinskyport.com. Status code: 400

October 11, 2023 at 1:03:53 PM – (ERROR) Daikin Skyport (custom integration) - message first occurred at October 11, 2023 at 1:02:24 PM and shows up 6 times

Could not refresh tokens: 400 Trying to re-request

October 11, 2023 at 1:03:52 PM – (WARNING) Daikin Skyport (custom integration) - message first occurred at October 11, 2023 at 1:02:27 PM and shows up 4 times


2023-10-11 12:55:04.760 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration daikinskyport which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2023-10-11 13:02:24.151 ERROR (SyncWorker_4) [daikinskyport] Error while requesting tokens from daikinskyport.com. Status code: 400

2023-10-11 13:02:27.679 WARNING (SyncWorker_3) [daikinskyport] Could not refresh tokens: 400 Trying to re-request

2023-10-11 13:02:28.179 ERROR (SyncWorker_3) [daikinskyport] Error while requesting tokens from daikinskyport.com. Status code: 400

2023-10-11 13:02:28.181 ERROR (MainThread) [custom_components.daikinskyport] Error refreshing Daikin Skyport tokens

2023-10-11 13:02:31.593 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Daikin for daikinskyport

File "/config/custom_components/daikinskyport/init.py", line 161, in _async_update_data

current = await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 171, in get_thermostats

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

File "/config/custom_components/daikinskyport/init.py", line 79, in async_setup_entry

File "/config/custom_components/daikinskyport/init.py", line 165, in _async_update_data

await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 171, in get_thermostats

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

2023-10-11 13:02:55.248 WARNING (SyncWorker_2) [daikinskyport] Could not refresh tokens: 400 Trying to re-request

2023-10-11 13:02:55.784 ERROR (SyncWorker_2) [daikinskyport] Error while requesting tokens from daikinskyport.com. Status code: 400

2023-10-11 13:02:55.786 ERROR (MainThread) [custom_components.daikinskyport] Error refreshing Daikin Skyport tokens

2023-10-11 13:02:59.189 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Daikin for daikinskyport

File "/config/custom_components/daikinskyport/init.py", line 161, in _async_update_data

current = await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 171, in get_thermostats

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

File "/config/custom_components/daikinskyport/init.py", line 79, in async_setup_entry

File "/config/custom_components/daikinskyport/init.py", line 165, in _async_update_data

await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 171, in get_thermostats

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

2023-10-11 13:03:35.798 ERROR (SyncWorker_8) [daikinskyport] Error while requesting tokens from daikinskyport.com. Status code: 400

2023-10-11 13:03:39.924 WARNING (SyncWorker_9) [daikinskyport] Could not refresh tokens: 400 Trying to re-request

2023-10-11 13:03:40.510 ERROR (SyncWorker_9) [daikinskyport] Error while requesting tokens from daikinskyport.com. Status code: 400

2023-10-11 13:03:40.511 ERROR (MainThread) [custom_components.daikinskyport] Error refreshing Daikin Skyport tokens

2023-10-11 13:03:43.928 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Daikin for daikinskyport

File "/config/custom_components/daikinskyport/init.py", line 161, in _async_update_data

current = await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 171, in get_thermostats

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

File "/config/custom_components/daikinskyport/init.py", line 79, in async_setup_entry

File "/config/custom_components/daikinskyport/init.py", line 165, in _async_update_data

await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 171, in get_thermostats

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

2023-10-11 13:03:52.928 WARNING (SyncWorker_10) [daikinskyport] Could not refresh tokens: 400 Trying to re-request

2023-10-11 13:03:53.589 ERROR (SyncWorker_10) [daikinskyport] Error while requesting tokens from daikinskyport.com. Status code: 400

2023-10-11 13:03:53.591 ERROR (MainThread) [custom_components.daikinskyport] Error refreshing Daikin Skyport tokens

2023-10-11 13:03:56.993 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Daikin for daikinskyport

File "/config/custom_components/daikinskyport/init.py", line 161, in _async_update_data

current = await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 171, in get_thermostats

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

File "/config/custom_components/daikinskyport/init.py", line 79, in async_setup_entry

File "/config/custom_components/daikinskyport/init.py", line 165, in _async_update_data

await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 171, in get_thermostats

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

File "/config/custom_components/daikinskyport/init.py", line 161, in _async_update_data

current = await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 156, in get_thermostats

File "/config/custom_components/daikinskyport/daikinskyport.py", line 203, in get_thermostat_info

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

File "/config/custom_components/daikinskyport/sensor.py", line 183, in async_update

File "/config/custom_components/daikinskyport/init.py", line 165, in _async_update_data

await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 156, in get_thermostats

File "/config/custom_components/daikinskyport/daikinskyport.py", line 203, in get_thermostat_info

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

2023-10-11 19:35:04.608 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Daikin for daikinskyport

File "/config/custom_components/daikinskyport/init.py", line 161, in _async_update_data

current = await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 156, in get_thermostats

File "/config/custom_components/daikinskyport/daikinskyport.py", line 203, in get_thermostat_info

raise ExpiredTokenError ("Daikin Skyport token expired")

custom_components.daikinskyport.daikinskyport.ExpiredTokenError: Daikin Skyport token expired

File "/config/custom_components/daikinskyport/init.py", line 79, in async_setup_entry

File "/config/custom_components/daikinskyport/init.py", line 165, in _async_update_data

await self.hass.async_add_executor_job(self.daikinskyport.update)

File "/config/custom_components/daikinskyport/daikinskyport.py", line 258, in update

File "/config/custom_components/daikinskyport/daikinskyport.py", line 156, in get_thermostats

File "/config/custom_components/daikinskyport/daikinskyport.py", line 203, in get_thermostat_info

raise ExpiredTokenError ("Daikin Skyport token expired")

From: apetrycki @.> Sent: Tuesday, October 10, 2023 2:43 PM To: apetrycki/daikinskyport @.> Cc: unc2k3 @.>; Author @.> Subject: Re: [apetrycki/daikinskyport] Fails to Load when starting (Issue #78)

Have you tried re-downloading the integration? This exception should get caught by _async_update_data and request new tokens. If that doesn't work, please set your logging to debug and capture all daikinskyport messages.

— Reply to this email directly, view it on GitHub https://github.com/apetrycki/daikinskyport/issues/78#issuecomment-1756026643 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOK5J3IWPI5LDRPLSPK4UD3X6WJL3AVCNFSM6AAAAAA52XK2YWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJWGAZDMNRUGM . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AOK5J3MTJN6IR7B736LL233X6WJL3A5CNFSM6AAAAAA52XK2YWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTIVLLRG.gif Message ID: @. @.> >

apetrycki commented 1 year ago

It looks like something's not right with your system or connection. You should never get an error when requesting tokens with your username and password. Did you type your email and password correctly? The integration can't recover from multiple 400 errors. That's not normal. Also, if you set your logging to debug, it'll give me more information.

unc2k3 commented 1 year ago

Figured out the problem at least for now. Apparently my AC controller for my garage was disconnected from the internet and after reconnecting and reloading the integration, it is working again.

From: apetrycki @.> Sent: Thursday, October 12, 2023 11:25 AM To: apetrycki/daikinskyport @.> Cc: unc2k3 @.>; Author @.> Subject: Re: [apetrycki/daikinskyport] Fails to Load when starting (Issue #78)

It looks like something's not right with your system or connection. You should never get an error when requesting tokens with your username and password. Did you type your email and password correctly? The integration can't recover from multiple 400 errors. That's not normal. Also, if you set your logging to debug, it'll give me more information.

— Reply to this email directly, view it on GitHub https://github.com/apetrycki/daikinskyport/issues/78#issuecomment-1759833363 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOK5J3NGMLRQKL5SS3JS2ELX7ADTDANCNFSM6AAAAAA52XK2YU . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AOK5J3NOPE3KO6BQTCZBPJLX7ADTDA5CNFSM6AAAAAA52XK2YWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTI4TWRG.gif Message ID: @. @.> >

apetrycki commented 1 year ago

Hmm, that's interesting. Someone else had that issue and provided a patch to check if the thermostat was offline, but they were still able to log in and retrieve tokens. It's just when it went to retrieve the thermostat data, there was no data and it returned an error code and a message that the device was offline. I think they had multiple thermostats, though, so maybe that's why.

unc2k3 commented 1 year ago

Yea it is definitely odd. I do have 3 total thermostats (Bedroom, Living Room, & Garage). At least I know where to look if it happens again. Thanks for the assistance!

From: apetrycki @.> Sent: Thursday, October 12, 2023 12:16 PM To: apetrycki/daikinskyport @.> Cc: unc2k3 @.>; Author @.> Subject: Re: [apetrycki/daikinskyport] Fails to Load when starting (Issue #78)

Hmm, that's interesting. Someone else had that issue and provided a patch to check if the thermostat was offline, but they were still able to log in and retrieve tokens. It's just when it went to retrieve the thermostat data, there was no data and it returned an error code and a message that the device was offline. I think they had multiple thermostats, though, so maybe that's why.

— Reply to this email directly, view it on GitHub https://github.com/apetrycki/daikinskyport/issues/78#issuecomment-1759941698 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOK5J3MHL6RW5I5Z4NLFQRDX7AJVHANCNFSM6AAAAAA52XK2YU . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AOK5J3O6VUG7PO4YU6PUZJLX7AJVHA5CNFSM6AAAAAA52XK2YWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTI42KEE.gif Message ID: @. @.> >

apetrycki commented 1 year ago

I added some more debug output so hopefully I can capture what is happening when a thermostat is offline. Unfortunately I only have one, so I may need someone to try out any changes I make to see if it works properly with multiple thermostats.