Hello everyone,
I鈥檓 using home assistant 0.114.4 and i successfully configure netatmo via configuration.yml but i can not see my thermostat.
I checked the log and i have this:
Home Assistant 0.114.4
configuration.yamlnetatmo:
client_id:
client_secret:
Logger: homeassistant.config_entries
Source: deps/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py:129
First occurred: 2:54:10 (1 occurrences)
Last logged: 2:54:10
Error setting up entry Configuration.yaml for netatmo
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/homeassistant/config_entries.py", line 223, in async_setup
hass, self
File "/usr/local/lib/python3.7/dist-packages/homeassistant/components/netatmo/__init__.py", line 95, in async_setup_entry
AUTH: api.ConfigEntryNetatmoAuth(hass, entry, implementation)
File "/usr/local/lib/python3.7/dist-packages/homeassistant/components/netatmo/api.py", line 27, in __init__
super().__init__(token=self.session.token)
File "/opt/homeassistant/deps/lib/python3.7/site-packages/pyatmo/auth.py", line 91, in __init__
scope=self.scope,
File "/opt/homeassistant/deps/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 79, in __init__
self.token = token or {}
File "/opt/homeassistant/deps/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 129, in token
self._client.populate_token_attributes(value)
AttributeError: 'WebApplicationClient' object has no attribute 'populate_token_attributes'
Have you tried upgrading to 0.115 to see if it fixes your issue?
Hey there @cgtobi, mind taking a look at this issue as its been labeled with an integration (netatmo) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)
I updated to 0.115 and I'm getting an error for lights, but all the rest is working.
The error I get is:
400 - Bad request - Invalid device_id, xxxxxxxxxx (21) when accessing 'https://api.netatmo.com/api/setstate'
Regards
Are your cameras working fine?
Yes!
EDIT: the xxxxxxx was the mac address of the device. Same error (with two different mac addresses) for the two Netatmo Presence I have.
Hello everyone,
thanks to reply. I updated home assistant to 0.115.2, i deleted netatmo from my configuration.yaml and also from the integration section then i added it again but i have the same error.
Following your example I removed my configuration adding the integration again from scratch. Cameras are working fine again but I have no more light entities now.
EDIT: Last update, after unregister... Unban on netatmo website and register again the webhook now I also have lights working fine! Great!!!
@piars777 can you please give some details about your system? The template is pretty empty?
What does pip show requests-oauthlib give you?
I think there is still something strange on the integration. Now my lights are working from the toggles on the frontend but I'm still seeing a lot of errors in the logs.
I paste them below if it helps:
```Logger: homeassistant
Source: helpers/config_entry_oauth2_flow.py:178
First occurred: 21 settembre 2020, 23:02:51 (735 occurrences)
Last logged: 11:40:52
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyatmo/auth.py", line 141, in query
rsp = self._oauth.post(url=url, data=params, timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 578, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 477, in request
url, headers, data = self._client.add_token(
File "/usr/local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 93, in async_update
await self.async_fetch_data(
File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 117, in async_fetch_data
self.data[data_class_entry] = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(self.args, *self.kwargs)
File "/usr/local/lib/python3.8/site-packages/pyatmo/camera.py", line 40, in __init__
resp = self.auth.post_request(url=_GETHOMEDATA_REQ, params=post_params)
File "/usr/local/lib/python3.8/site-packages/pyatmo/auth.py", line 156, in post_request
resp = query(url, params, timeout, 3)
File "/usr/local/lib/python3.8/site-packages/pyatmo/auth.py", line 150, in query
self._oauth.token = self.refresh_tokens()
File "/usr/src/homeassistant/homeassistant/components/netatmo/api.py", line 33, in refresh_tokens
run_coroutine_threadsafe(
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
raise self._exception
File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 444, in async_ensure_token_valid
new_token = await self.implementation.async_refresh_token(self.token)
File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 81, in async_refresh_token
new_token = await self._async_refresh_token(token)
File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 159, in _async_refresh_token
new_token = await self._token_request(
File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 178, in _token_request
resp.raise_for_status()
File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 941, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='', url=URL('https://api.netatmo.com/oauth2/token')```
@teocannata those are different errors. Please create a separate issue for this. Please do also provide further information about your setup.
Here some information about the system:
`
arch | x86_64
-- | --
dev | false
docker | false
hassio | false
installation_type | Unknown
os_name | Linux
os_version | 4.15.0-101-generic
python_version | 3.7.5
timezone | Europe/Paris
version | 0.115.2
virtualenv | false
`
here the result of pip show requests-oauthlib
Name: requests-oauthlib
Version: 1.3.0
Summary: OAuthlib authentication support for Requests.
Home-page: https://github.com/requests/requests-oauthlib
Author: Kenneth Reitz
Author-email: [email protected]
License: ISC
Location: /usr/local/lib/python3.7/dist-packages
Requires: oauthlib, requests
If possible, I'd kindly as you to set up a fresh instance elsewhere (preferably in a venv) to isolate the issue. Since you're running this right in the system environment there may be other dependencies playing games here.
@teocannata those are different errors. Please create a separate issue for this. Please do also provide further information about your setup.
okay i ll reinstall home assistant and let you know. thanks.
Thanks guys,
i reinstalled home assistant and set up in a venv and the problem was resolved.
i also defined the external_url and internal_url in the configuration.yaml because i had this error: NoURLAvailableError
But everything is good now.
Awesome. Can we close this issue?