home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.07k stars 29.13k forks source link

Sporadic error in Adax modul #90261

Closed TheDiverM closed 7 months ago

TheDiverM commented 1 year ago

The problem

From time to time the Adax heater integration fails Usually it helps to reload the integration, sometimes it doesn't

Seems like error handling isn't to stable

What version of Home Assistant Core has the issue?

2023.3.6 (all version I have tried)

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Adax

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: adax
Source: components/adax/climate.py:58
First occurred: 09:14:07 (2 occurrences)
Last logged: 09:50:01

Error connecting to Adax, response: 401
Too many requests

Additional information

Seems like it sometimes have to many requests to the API server

Would be nice to talk directly to oven, not api

home-assistant[bot] commented 1 year ago

Hey there @danielhiversen, mind taking a look at this issue as it has been labeled with an integration (adax) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `adax` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign adax` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


adax documentation adax source (message by IssueLinks)

TheDiverM commented 1 year ago

The error that makes the entire module fail is

Logger: adax Source: components/adax/climate.py:58 First occurred: 27. mars 2023 kl. 17:50:56 (2 occurrences) Last logged: 15:34:44

Too many requests Error connecting to Adax, response: 401

And it seems like when this happens it just fails and don't retry, need to reload module one or several times before it start working again

torbenbg commented 1 year ago

I do get same error - and it will not show current temperature even if reloaded.

odelma commented 1 year ago

For me it has been rather stable (maybe once every few weeks becomes unavailable, reload helps) but now after updating to 2023.4.X it has no updated since. While this is the wrong place to report, I can see some comments also in: https://github.com/Danielhiversen/home_assistant_adax/issues/49

R3eaqtor commented 1 year ago

Same here, unavalible ever now and then or the temperature freezes.

joggs commented 1 year ago

Same problem here. Adax server going down, is anoter problem. Thiis a client problem. The integration in Tibber that uses the same API works, and if you remove and re add the adax integration in Hass it works, so the 401 Unauthorized response tells me that the login session for this integration should be handled in another way.

runemoennike commented 1 year ago

I have the same issue. Reloading a few times helped this time, but since my heaters turn on based on the outside temperature, I'd like it to be more reliable.

magfro commented 1 year ago

I also have this issue with Adax:

Logger: adax
Source: components/adax/climate.py:111
First occurred: 8 May 2023 at 05:08:21 (3589 occurrences)
Last logged: 10:21:45

Timed out when connecting to Adax for token
Adax: Failed to login to retrieve token: 503
Error connecting to Adax, response: 401
Too many requests

It almost never works:

2023-05-13 22:20:45.056 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:21:45.102 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:22:45.053 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:23:45.055 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:24:45.095 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:27:45.071 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:28:45.083 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:29:45.063 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:30:45.072 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:31:45.089 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:32:45.121 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:37:45.064 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:40:45.061 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:41:45.068 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:42:45.082 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:45:45.100 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:46:45.101 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:51:45.139 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 22:54:45.117 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:01:45.110 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:02:45.131 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:17:45.167 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:18:45.112 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:19:45.176 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:24:45.113 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:25:45.302 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:26:45.161 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:27:45.174 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:28:45.153 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:31:45.164 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:32:45.187 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:37:45.141 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:40:45.162 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:41:45.135 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:46:45.187 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:47:45.165 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:54:45.138 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-13 23:59:45.152 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:00:45.179 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:03:45.267 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:04:45.212 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:07:45.161 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:12:45.201 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:15:45.171 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:16:45.230 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:19:45.158 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:22:45.173 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:23:45.324 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:26:45.192 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:29:45.224 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:32:45.314 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:33:45.304 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:40:45.233 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:41:45.342 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:42:45.175 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:43:45.334 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:44:45.199 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:45:45.182 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:48:45.220 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:49:45.224 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:58:45.253 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 00:59:45.293 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:00:45.390 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:05:45.265 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:06:45.244 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:07:45.218 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:12:45.245 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:15:45.216 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:18:45.224 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:21:45.330 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:28:45.250 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:32:45.286 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:33:45.281 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:34:45.287 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:39:45.305 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:42:45.384 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 01:43:45.338 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:07:45.295 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:12:45.303 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:15:45.324 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:20:45.316 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:23:45.308 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:24:45.424 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:27:45.415 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:32:45.430 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:35:45.299 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:36:45.326 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:41:45.350 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:44:45.327 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:45:45.320 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:54:45.506 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:55:45.335 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 02:56:45.332 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:05:45.395 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:06:45.379 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:07:45.403 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:08:45.397 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:11:45.339 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:12:45.356 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:13:45.432 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:16:45.412 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:17:45.417 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:20:45.355 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:25:45.419 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:30:45.393 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:31:45.401 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:32:45.422 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:33:45.412 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:34:45.453 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:35:45.386 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:38:45.466 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:43:45.428 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:46:45.665 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:47:45.387 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:48:45.391 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 03:49:45.469 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:00:45.438 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:01:45.458 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:02:45.442 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:03:45.457 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:04:45.448 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:05:45.417 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:10:45.439 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:13:45.438 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:14:45.449 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:15:45.461 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:18:45.438 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:19:45.435 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:24:45.481 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:25:45.507 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:26:45.470 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:29:45.496 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:32:45.520 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:35:45.459 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:36:45.443 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:39:45.484 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:40:45.467 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:41:45.462 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:46:45.479 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:55:45.458 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 04:56:45.446 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:11:45.481 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:14:45.504 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:15:45.504 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:30:45.633 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:33:45.506 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:34:45.517 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:35:45.674 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:40:45.481 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:41:45.570 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:42:45.501 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:43:45.550 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:48:45.571 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:49:45.547 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:50:45.528 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:51:45.537 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:54:45.532 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:55:45.548 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:58:45.535 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 05:59:45.500 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:00:45.578 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:05:45.598 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:10:45.600 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:11:45.563 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:12:45.572 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:13:45.545 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:14:45.526 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:15:45.668 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:24:45.589 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:43:45.637 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:44:45.596 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:47:45.672 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:54:45.571 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:55:45.581 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 06:56:45.662 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:01:45.587 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:02:45.605 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:03:45.638 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:26:45.599 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:27:45.652 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:32:45.628 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:33:45.610 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:34:45.686 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:39:45.657 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:42:45.645 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:45:45.726 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:46:45.684 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:49:45.778 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:50:45.663 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:51:45.673 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:52:45.670 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:53:45.738 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 07:54:45.655 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:03:45.660 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:10:45.783 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:11:45.763 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:12:45.668 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:15:45.655 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:16:45.692 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:23:45.817 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:24:45.696 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:25:45.671 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:32:45.713 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:33:45.725 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:34:45.735 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:40:45.710 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:41:45.779 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:44:45.710 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 08:51:45.721 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:03:45.758 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:06:45.778 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:19:45.762 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:20:45.764 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:21:45.759 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:24:45.751 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:27:45.783 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:28:45.790 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:33:45.753 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:36:45.803 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:41:45.783 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:44:45.773 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:47:45.780 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:56:45.801 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 09:57:45.821 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 10:02:45.824 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
2023-05-14 10:05:45.790 ERROR (MainThread) [adax] Error connecting to Adax, response: 401  
jeverley commented 1 year ago

Issue still present in 2023.7.2

Logger: adax Source: components/adax/climate.py:58 First occurred: 08:46:12 (3 occurrences) Last logged: 15:23:56

Error connecting to Adax, response: 401

danhusan commented 1 year ago

Just had the same issue. Reloading the integration multiple times did not help. However disabling and enabling it got it up and running immediately.

R3eaqtor commented 11 months ago

Still facing the same problem with errors, reloading problems and current temperature thats not working. Anyone knows if its Adax API that is malfuctioning or the integration i home asistant?

gavyb commented 10 months ago

Just stopped working for me yesterday after I had done some updates to HA.

zetxx commented 9 months ago

Just had the same issue. Reloading the integration multiple times did not help. However disabling and enabling it got it up and running immediately.

i think that the problem is in the adax device. what i have: 2 adax devices "adax neo wifi" my integration: local what i did: got my token and ip from: .storage/core.config_entries made a curl request as follows: curl -k https://*.*.*.*/api\?command\=stat\&time\=1696406922 -H 'Authorization: Basic <token from config>' -v and result is:

*   Trying ..........:443...
* Connected to .............. (...............) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
*  subject: CN=ADAX DEVICE
*  start date: Jul  1 00:00:00 2020 GMT
*  expire date: Jul  1 00:00:00 2040 GMT
*  issuer: CN=ADAX DEVICE
*  SSL certificate verify result: self-signed certificate (18), continuing anyway.
* using HTTP/1.x
> GET /api?command=stat&time=1696406922 HTTP/1.1
> Host: ............
> User-Agent: curl/8.3.0
> Accept: */*
> Authorization: Basic ***********************
> 
< HTTP/1.1 400 Bad Request
< Content-Type: text/html
< Content-Length: 0
< 

this response is reproducible on both of the devices, so yes, i think that the problem is in the adax api

zetxx commented 9 months ago

I managed to fix http request issue to my devices with reinit tokens ... probably adax changed something during summer :) a good documentation: https://adax.no/wi-fi/api-development/#local

and following code, 99% identical as in the example:

# registers heater to your wifi network
# install dependencies with: pip install bleak requests
import bleak
import asyncio
import operator
import urllib.parse
wifi_ssid    = 'replace with your wifi name'  # replace with your wifi name
wifi_psk     = 'replace with your wifi psk'  # replace with your wifi psk
access_token = '12345678'     # generate some strong password for your heater
UUID_ADAX_BLE_SERVICE = '3885cc10-7c18-4ad4-a48d-bf11abf7cb92'
UUID_ADAX_BLE_SERVICE_CHARACTERISTIC_COMMAND = '0000cc11-0000-1000-8000-00805f9b34fb'
# ignore registered, non heater devices
def is_available_device(manufacturer_data):
    ADAX_DEVICE_TYPE_HEATER_BLE = 5
    if manufacturer_data and len(manufacturer_data) >= 10:
        type_id = manufacturer_data[0]
        status_byte = manufacturer_data[1]
        mac_id = 0
        for byte in manufacturer_data[2:10]:
            mac_id = mac_id * 256 + byte
        registered = status_byte & (0x1 << 0)
        managed = status_byte & (0x1 << 1)
        return mac_id and type_id == ADAX_DEVICE_TYPE_HEATER_BLE and not registered and not managed
    return False
# scan and return available heater
async def scan_for_any_available_ble_device():
    print("scan_for_any_available_ble_device")
    discovered = await bleak.discover(timeout = 60)
    if discovered:
        for discovered_item in discovered:
            metadata = discovered_item.metadata
            print(metadata)
            uuids = metadata['uuids'] if 'uuids' in metadata else None
            if uuids and UUID_ADAX_BLE_SERVICE in uuids:
                manufacturer_data_list = None
                manufacturer_data = metadata['manufacturer_data'] if 'manufacturer_data' in metadata else None
                if manufacturer_data:
                    first_bytes = next(iter(manufacturer_data))
                    if first_bytes:
                        other_bytes = manufacturer_data[first_bytes]
                        manufacturer_data_list = [first_bytes % 256, operator.floordiv(first_bytes, 256)] + list(other_bytes)
                if is_available_device(manufacturer_data_list):
                    return discovered_item.address
    return None
# handle notifications for heater
def command_notification_handler(uuid, data):
    BLE_COMMAND_STATUS_OK = 0
    BLE_COMMAND_STATUS_INVALID_WIFI = 1
    byte_list = None if not data else list(data)
    status = None if not byte_list else byte_list[0]
    if status == BLE_COMMAND_STATUS_OK:
        ip = None if not byte_list or len(byte_list) < 5 else '%d.%d.%d.%d' % (byte_list[1], byte_list[2], byte_list[3], byte_list[4])
        print('Heater Registered, use client_control_demo with IP: %s and token: %s' % (ip, access_token))
    elif status == BLE_COMMAND_STATUS_INVALID_WIFI:
        print('Invalid WiFi crendentials')
# send command to heater
async def write_command(command_byte_list, client):
    MAX_BYTES_IN_COMMAND_CHUNK = 17
    byte_count = len(command_byte_list)
    chunk_count = operator.floordiv(byte_count, MAX_BYTES_IN_COMMAND_CHUNK)
    if chunk_count * MAX_BYTES_IN_COMMAND_CHUNK < byte_count:
        chunk_count += 1
    sent_byte_count = 0
    chunk_nr = 0
    while chunk_nr < chunk_count:
        is_last = chunk_nr == (chunk_count - 1)
        chunk_data_length = byte_count - sent_byte_count if is_last else MAX_BYTES_IN_COMMAND_CHUNK
        chunk = [chunk_nr, 1 if is_last else 0] + command_byte_list[sent_byte_count:(sent_byte_count + chunk_data_length)]
        await client.write_gatt_char(UUID_ADAX_BLE_SERVICE_CHARACTERISTIC_COMMAND, bytearray(chunk))
        sent_byte_count += chunk_data_length
        chunk_nr += 1
# register heater
async def register_devices(loop):
    print('Press and hold OK button of the heater until the blue led starts blinking')
    device = await scan_for_any_available_ble_device()
    if device:
        client = bleak.BleakClient(device, loop = loop)
        await client.connect()
        await client.start_notify(UUID_ADAX_BLE_SERVICE_CHARACTERISTIC_COMMAND, command_notification_handler)
        ssid_encoded = urllib.parse.quote(wifi_ssid)
        psk_encoded = urllib.parse.quote(wifi_psk)
        access_token_encoded = urllib.parse.quote(access_token)
        byte_list = list(bytearray('command=join&ssid=' + ssid_encoded + '&psk=' + psk_encoded + '&token=' + access_token_encoded, 'ascii'))
        await write_command(byte_list, client)
loop = asyncio.get_event_loop()
loop.create_task(register_devices(loop))
loop.run_forever()
wessa66 commented 8 months ago

Just had the same issue. Reloading the integration multiple times did not help. However disabling and enabling it got it up and running immediately.

i think that the problem is in the adax device. what i have: 2 adax devices "adax neo wifi" my integration: local what i did: got my token and ip from: .storage/core.config_entries made a curl request as follows: curl -k https://*.*.*.*/api\?command\=stat\&time\=1696406922 -H 'Authorization: Basic <token from config>' -v and result is:

*   Trying ..........:443...
* Connected to .............. (...............) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
*  subject: CN=ADAX DEVICE
*  start date: Jul  1 00:00:00 2020 GMT
*  expire date: Jul  1 00:00:00 2040 GMT
*  issuer: CN=ADAX DEVICE
*  SSL certificate verify result: self-signed certificate (18), continuing anyway.
* using HTTP/1.x
> GET /api?command=stat&time=1696406922 HTTP/1.1
> Host: ............
> User-Agent: curl/8.3.0
> Accept: */*
> Authorization: Basic ***********************
> 
< HTTP/1.1 400 Bad Request
< Content-Type: text/html
< Content-Length: 0
< 

this response is reproducible on both of the devices, so yes, i think that the problem is in the adax api

I see the exact same problem "to many retries" the CURL commad you mentioned where did you runed that? I looked in my file config file newer find any token only accountID and password and no IP addresses.

Danielhiversen commented 7 months ago

Closed by https://github.com/home-assistant/core/pull/104660