Skip to content
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

нет устройств #7

Closed
leex6 opened this issue Apr 22, 2024 · 5 comments
Closed

нет устройств #7

leex6 opened this issue Apr 22, 2024 · 5 comments

Comments

@leex6
Copy link

leex6 commented Apr 22, 2024

HA 2024.4.3
12 или 13 апреля нормально добавил устройство и до 20 оно нормально работало. 20 связь пропала, устройство неактивно.
удалил и пробовал добавить заново, нет устройств.

Регистратор: homeassistant.components.light
Источник: helpers/entity_platform.py:356
интеграция: Освещение (документация, проблемы)
Первое сообщение: 21:00:09 (1 сообщений)
Последнее сообщение: 21:00:09

Error while setting up sberdevices platform for light
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 373, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
raise exc from None
File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request
raise exc
File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py", line 122, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py", line 30, in connect_tcp
return await self._backend.connect_tcp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 112, in connect_tcp
with map_exceptions(exc_map):
File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectTimeout

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

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/sberdevices/light.py", line 41, in async_setup_entry
await home.update_devices_cache()
File "/config/custom_components/sberdevices/api.py", line 93, in update_devices_cache
self._devices = extract_devices(await self.get_device_tree())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/sberdevices/api.py", line 89, in get_device_tree
return (await self.request("GET", "/device_groups/tree"))["result"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/sberdevices/api.py", line 73, in request
await self.update_token()
File "/config/custom_components/sberdevices/api.py", line 66, in update_token
token = await self._sber.fetch_home_token()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/sberdevices/api.py", line 49, in fetch_home_token
await self._oauth_client.get("https://mp.aihome.dev/v11/smarthome/token")
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1801, in get
return await self.request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/authlib/integrations/httpx_client/oauth2_client.py", line 90, in request
return await super(AsyncOAuth2Client, self).request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1574, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1661, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1689, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1726, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1763, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 372, in handle_async_request
with map_httpcore_exceptions():
File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectTimeout

@digitizer77
Copy link

То же самое. После какого-то обновления HA (последнего или предпоследнего, точно не знаю). Пропали все устройства. Заново скачивал в HACS, переустанавливал, настраивал - не помогло. В манифесте прописано "requirements": ["Authlib==1.2.1"],

@leex6
Copy link
Author

leex6 commented Apr 23, 2024

Если судить по бэкапам. то обновление было 13 апреля
image
image

@leex6
Copy link
Author

leex6 commented Apr 25, 2024

То же самое. После какого-то обновления HA (последнего или предпоследнего, точно не знаю). Пропали все устройства. Заново скачивал в HACS, переустанавливал, настраивал - не помогло. В манифесте прописано "requirements": ["Authlib==1.2.1"],
Обновление HA непричем, восстановился из резервной копии несколько раз. дошел до 2024.4.0, одна и та же ошибка:

Регистратор: homeassistant.components.light
Источник: helpers/entity_platform.py:356
интеграция: Освещение (документация, проблемы)
Первое сообщение: 13:19:33 (1 сообщений)
Последнее сообщение: 13:19:33

Error while setting up sberdevices platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/sberdevices/light.py", line 41, in async_setup_entry
await home.update_devices_cache()
File "/config/custom_components/sberdevices/api.py", line 93, in update_devices_cache
self._devices = extract_devices(await self.get_device_tree())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/sberdevices/api.py", line 89, in get_device_tree
return (await self.request("GET", "/device_groups/tree"))["result"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/sberdevices/api.py", line 73, in request
await self.update_token()
File "/config/custom_components/sberdevices/api.py", line 66, in update_token
token = await self._sber.fetch_home_token()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/sberdevices/api.py", line 50, in fetch_home_token
).json()["token"]
^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 764, in json
return jsonlib.loads(self.content, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@leex6
Copy link
Author

leex6 commented Apr 25, 2024

На резервной копии где лампа добавлена и неактивна, та же самая ошибка

@altfoxie
Copy link
Owner

Исправлено. Ненадолго, наверное.

Выглядит будто Сбер затягивает гайки: https://companion.devices.sberbank.ru/v13/smarthome/token недоступен без User-Agent приложения, подсунул Salute+prod%2F24.04.1.15123+%28Android+33%3B+Google+sdk_gphone64_arm64%29

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

3 participants