Skip to content

"Integration requires reconfiguration" After restart always asking for credentials user/password only #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bigtarget opened this issue Feb 8, 2024 · 11 comments

Comments

@bigtarget
Copy link

Hello,

Thanks for all your work !!! It is working nice, but i have problem with expired session or something.

obraz
Of course after enter user and password all starting to work, but it is annoying to do it every day/restart.

Can you please check it?

@bigtarget
Copy link
Author

More details:

Logger: custom_components.vaillant_vsmart
Source: helpers/update_coordinator.py:366
Integration: Vaillant vSMART (documentation, issues)
First occurred: 09:46:16 (1 occurrences)
Last logged: 09:46:16
Authentication failed while fetching vaillant_vsmart data: ('Access token is invalid or expired. Refresh the access token and try again.', {'method': 'POST', 'url': URL('https://api.netatmo.com/api/getthermostatsdata'), 'body': b'device_type=NAVaillant&data_amount=app&sync_device_id=all&access_token=&'}, {'status_code': 403, 'url': URL('https://api.netatmo.com/api/getthermostatsdata'), 'body': b'{"error":{"code":2,"message":"Invalid access token"}}', 'duration': datetime.timedelta(microseconds=77999)})

@bigtarget
Copy link
Author

bigtarget commented Feb 8, 2024

Ten błąd pochodzi z niestandardowej integracji.

Logger: custom_components.vaillant_vsmart.config_flow
Source: custom_components/vaillant_vsmart/config_flow.py:65
Integration: Vaillant vSMART (documentation, issues)
First occurred: 09:46:16 (1 occurrences)
Last logged: 09:46:16

("Server processed the request and returned a 4xx response. Don't retry the request without changing the arguments as the new request will fail again with the same error.", {'method': 'POST', 'url': URL('https://api.netatmo.com/oauth2/token'), 'body': b'username=&password=&app_version=1.0.4.0&grant_type=password&client_id=na_client_android_vaillant&client_secret=&scope=read_thermostat+write_thermostat'}, {'status_code': 400, 'url': URL('https://api.netatmo.com/oauth2/token'), 'body': b'{"error":"invalid_request","error_description":"Missing parameters, \"username\" and \"password\" are required"}', 'duration': datetime.timedelta(microseconds=59633)})
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/vaillant_netatmo_api/errors.py", line 79, in client_error_handler
yield
File "/usr/local/lib/python3.12/site-packages/vaillant_netatmo_api/base.py", line 55, in _post
resp.raise_for_status()
File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 759, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '400 ' for url 'https://api.netatmo.com/oauth2/token'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/vaillant_vsmart/config_flow.py", line 65, in _async_step_all
data = await self._get_config_storage_data(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/vaillant_vsmart/config_flow.py", line 155, in _get_config_storage_data
await client.async_token(
File "/usr/local/lib/python3.12/site-packages/vaillant_netatmo_api/auth.py", line 74, in async_token
body = await self._post(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/init.py", line 314, in iter
return fut.result()
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/vaillant_netatmo_api/base.py", line 47, in _post
with client_error_handler():
File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/usr/local/lib/python3.12/site-packages/vaillant_netatmo_api/errors.py", line 90, in client_error_handler
raise RequestClientException("Server processed the request and returned a 4xx response. Don't retry the request without changing the arguments as the new request will fail again with the same error.", e.request, e.response) from e
vaillant_netatmo_api.errors.RequestClientException: ("Server processed the request and returned a 4xx response. Don't retry the request without changing the arguments as the new request will fail again with the same error.", {'method': 'POST', 'url': URL('https://api.netatmo.com/oauth2/token'), 'body': b'username=&password=&app_version=1.0.4.0&grant_type=password&client_id=na_client_android_vaillant&client_secret=&scope=read_thermostat+write_thermostat'}, {'status_code': 400, 'url': URL('https://api.netatmo.com/oauth2/token'), 'body': b'{"error":"invalid_request","error_description":"Missing parameters, \"username\" and \"password\" are required"}', 'duration': datetime.timedelta(microseconds=59633)})

@bigtarget
Copy link
Author

bigtarget commented Feb 8, 2024

I am using all latest: v.0.9.0 and
HA
Core 2024.2.0
Supervisor 2024.01.1
Operating System 11.5
UI 20240207.0

@liberatofiasca
Copy link

Same problem here, starting from february 2024 versions and above.

@mgolec
Copy link

mgolec commented Apr 25, 2024

Same problem here too. I'm not sure from which version but the problem has been present for at least a couple of months.

@MislavMandaric
Copy link
Owner

I'm sorry to hear that you have issues with the integration. I tried reproducing this, but I can't. I don't have any disconnects and I get reauth request almost exclusively after I work on this locally, thus generating a lot of tokens, making them invalid. Other than that, I don't get any issues.

@toniaisense
Copy link

toniaisense commented Nov 27, 2024

Dear @MislavMandaric,

I am experiencing the same problem; the Vaillant system disconnects approximately every half hour.

Here is the error I receive:

prtscr

These are my settings:

image

When I re-add the data, everything works fine for a short time, but then the issue recurs, even without restarting.

Could you kindly advise on how to resolve this?

Thank you for your excellent work and assistance!

Best regards,
Toni

@GDefina
Copy link

GDefina commented Dec 11, 2024

I'm sorry to hear that you have issues with the integration. I tried reproducing this, but I can't. I don't have any disconnects and I get reauth request almost exclusively after I work on this locally, thus generating a lot of tokens, making them invalid. Other than that, I don't get any issues.

Hi Mislav,
I have the same problem too.
I tried uninstalling and reinstalling, but it didn't work.
It seems that I can't save the credentials and that at each session I need to re-authenticate... so this integration is not usable... can we provide you with some more information to debug?

My version of Home Assistant:

Core
2024.12.2
Supervisor
2024.11.4
Operating System
14.0
Frontend
20241127.7
image

Thanks for your support.

@GDefina
Copy link

GDefina commented Dec 17, 2024

Update... i find this in my log:

2024-12-17 17:58:54.589 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'vaillant_vsmart' creates a new entry in a 'reauth' flow, when it is expected to update an existing entry and abort at custom_components/vaillant_vsmart/config_flow.py, line 85: return self.async_create_entry(title=user_input[CONF_USERNAME], data=data). This will stop working in Home Assistant 2025.11, please create a bug report at https://github.com/MislavMandaric/home-assistant-vaillant-vsmart/issues

@GDefina
Copy link

GDefina commented Dec 25, 2024

This solution not working for me:

image

source: https://githubhelp.com/MislavMandaric/home-assistant-vaillant-vsmart

@GitStijn
Copy link

Still faling thuis issue in latent version of HA and the integration.
Also found something about new terms that needed to be approved on the vaillant site, so i did the change country and back but didn’t make anything change.

Anyone having and luck on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants