TionAPI / HA-tion

Home assistant integration for Tion breezers
Apache License 2.0
72 stars 6 forks source link

Response is {} [HA 2022.8.6, интеграция v4.0.1] #111

Closed tms320 closed 2 years ago

tms320 commented 2 years ago

Общая информация

Несколько дней всё работало нормально, круглосуточно. Но вот случилось это: при попытке изменить скорость бризера появилась надпись, что "не удаётся вызвать службу set_fan_speed" (точное название не помню, ибо пишу по памяти). На команду выключения - тоже никакой реакции. В логах HA это:

2022-08-22 21:08:57.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:08:57.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:08:57.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:09:02.010 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:09:02.010 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:09:02.010 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:09:02.013 ERROR (MainThread) [custom_components.ha_tion_btle] Timeout fetching Tion Breezer data
2022-08-22 21:09:02.014 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.013 seconds (success: False)
2022-08-22 21:10:02.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:10:02.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:10:02.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:10:07.014 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:10:07.014 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:10:07.014 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:10:07.015 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.015 seconds (success: False)
2022-08-22 21:11:07.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:11:07.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:11:07.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:11:12.016 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:11:12.016 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:11:12.017 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:11:12.020 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.020 seconds (success: False)
2022-08-22 21:12:12.000 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:12:12.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:12:12.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:12:17.014 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:12:17.014 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:12:17.014 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:12:17.016 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.016 seconds (success: False)
2022-08-22 21:13:17.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:13:17.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:13:17.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:13:22.013 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:13:22.013 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:13:22.013 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:13:22.015 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.014 seconds (success: False)
2022-08-22 21:14:22.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:14:22.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:14:22.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:14:27.010 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:14:27.011 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:14:27.011 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:14:27.012 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.011 seconds (success: False)
2022-08-22 21:15:27.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:15:27.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:15:27.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:15:32.013 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:15:32.013 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:15:32.013 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:15:32.014 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.014 seconds (success: False)
2022-08-22 21:16:32.000 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:16:32.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:16:32.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:16:37.013 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:16:37.013 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:16:37.013 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:16:37.014 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.014 seconds (success: False)
2022-08-22 21:16:58.523 INFO (MainThread) [custom_components.ha_tion_btle] Need to set: fan_speed=3, state='on'
2022-08-22 21:16:58.523 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:16:58.523 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:17:03.532 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:17:03.532 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:17:03.533 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139993155287504] 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call
    await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
    await result
  File "/config/custom_components/ha_tion_btle/fan.py", line 137, in async_set_percentage
    await self.coordinator.set(fan_speed=self.percent2mode(percentage), is_on=percentage > 0)
  File "/config/custom_components/ha_tion_btle/__init__.py", line 152, in set
    await self.__tion.set(kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 247, in set
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
    await self._connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
    await self._try_connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
    return await self._btle.connect(timeout=5.0)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 156, in connect
    reply = await asyncio.wait_for(
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
2022-08-22 21:17:37.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:17:37.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:17:37.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:17:42.012 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:17:42.012 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:17:42.012 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:17:42.015 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.014 seconds (success: False)
2022-08-22 21:18:42.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:18:42.002 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:18:42.002 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:18:47.012 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:18:47.013 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:18:47.013 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:18:47.015 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.014 seconds (success: False)
2022-08-22 21:19:36.008 INFO (MainThread) [custom_components.ha_tion_btle] Need to set: fan_speed=3, state='on'
2022-08-22 21:19:36.008 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:19:36.008 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:19:41.017 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:19:41.017 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:19:41.018 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139993232185168] 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call
    await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
    await result
  File "/config/custom_components/ha_tion_btle/fan.py", line 137, in async_set_percentage
    await self.coordinator.set(fan_speed=self.percent2mode(percentage), is_on=percentage > 0)
  File "/config/custom_components/ha_tion_btle/__init__.py", line 152, in set
    await self.__tion.set(kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 247, in set
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
    await self._connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
    await self._try_connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
    return await self._btle.connect(timeout=5.0)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 156, in connect
    reply = await asyncio.wait_for(
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
2022-08-22 21:19:47.002 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:19:47.002 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:19:47.002 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:19:52.011 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:19:52.011 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:19:52.011 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:19:52.014 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.013 seconds (success: False)
2022-08-22 21:20:06.935 INFO (MainThread) [custom_components.ha_tion_btle] Need to set: state='off'
2022-08-22 21:20:06.936 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:20:06.936 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:20:11.947 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:20:11.948 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:20:11.948 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139993232185168] 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call
    await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
    await result
  File "/config/custom_components/ha_tion_btle/fan.py", line 169, in async_turn_off
    await self.coordinator.set(is_on=False)
  File "/config/custom_components/ha_tion_btle/__init__.py", line 152, in set
    await self.__tion.set(kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 247, in set
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
    await self._connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
    await self._try_connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
    return await self._btle.connect(timeout=5.0)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 156, in connect
    reply = await asyncio.wait_for(
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
2022-08-22 21:20:15.705 INFO (MainThread) [custom_components.ha_tion_btle.climate] Need to set mode to fan_only, current mode is fan_only
2022-08-22 21:20:15.705 DEBUG (MainThread) [custom_components.ha_tion_btle.climate] Tion Breezer is asked for mode fan_only, but it is already in fan_only. Do nothing.
2022-08-22 21:20:52.000 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:20:52.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:20:52.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:20:57.008 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:20:57.009 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:20:57.009 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:20:57.010 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.010 seconds (success: False)
2022-08-22 21:21:57.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:21:57.002 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:21:57.002 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:22:02.013 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:22:02.014 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:22:02.014 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:22:02.016 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.015 seconds (success: False)
2022-08-22 21:23:02.001 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:23:02.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:23:02.001 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f52e4080310>,),kwargs={})
2022-08-22 21:23:07.010 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:23:07.010 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:23:07.010 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:23:07.013 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 5.012 seconds (success: False)

Сброс блютус на хосте - не помог. Перезапустил HA - интеграция висит в такой ошибке: image В логах HA это:

2022-08-22 21:32:30.513 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs 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
2022-08-22 21:32:30.514 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ha_tion_btle 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
2022-08-22 21:32:41.776 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5
2022-08-22 21:32:41.776 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Tion Breezer' for ha_tion_btle integration not ready yet: None; Retrying in background
2022-08-22 21:33:05.666 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5
2022-08-22 21:33:15.668 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5
2022-08-22 21:33:35.672 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5
2022-08-22 21:34:15.673 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5
2022-08-22 21:35:35.675 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5

Перезапуск хоста - не помог. Через меню "Настройки" --> "Устройства и службы" --> "Интеграции" удалил интеграцию. Перезапустил HA. Заново добавил интеграцию (галочку "Need pairing" не ставил): image Но потом опять висит та же ошибка: image

tms320 commented 2 years ago

Откатился на бэкап четырёхдневной давности (он был сделан при обновлении HA с версии 2022.8.5 на 2022.8.6), версия интеграции там - v4.0.0. Интеграция висит в ошибке: image В логах HA это:

2022-08-22 21:54:18.473 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs 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
2022-08-22 21:54:18.473 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ha_tion_btle 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
2022-08-22 21:54:19.259 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
2022-08-22 21:54:19.358 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=76 from 2022-08-18 04:38:52.264613)
2022-08-22 21:54:39.731 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5 
2022-08-22 21:54:39.732 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:54:39.732 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:54:39.732 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7ff52e656200>,),kwargs={})
2022-08-22 21:54:39.764 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:54:39.764 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:54:39.764 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:54:39.767 ERROR (MainThread) [custom_components.ha_tion_btle] Unexpected error fetching Tion Breezer data: 'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/ha_tion_btle/__init__.py", line 109, in async_update_state
    raise e
  File "/config/custom_components/ha_tion_btle/__init__.py", line 99, in async_update_state
    response = await self.__tion.get()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 208, in get
    await self.get_state_from_breezer()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 188, in get_state_from_breezer
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
    await self._connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
    await self._try_connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
    return await self._btle.connect(timeout=5.0)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 107, in connect
    device = await BleakScannerBlueZDBus.find_device_by_address(
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/scanner.py", line 220, in find_device_by_address
    device_identifier = device_identifier.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
2022-08-22 21:54:39.770 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 0.038 seconds (success: False)
2022-08-22 21:54:39.770 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Tion Breezer' for ha_tion_btle integration not ready yet: 'NoneType' object has no attribute 'lower'; Retrying in background
2022-08-22 21:54:53.331 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5 
2022-08-22 21:54:53.332 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:54:53.332 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:54:53.332 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7ff52709f640>,),kwargs={})
2022-08-22 21:54:53.332 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:54:53.332 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:54:53.332 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:54:53.337 ERROR (MainThread) [custom_components.ha_tion_btle] Unexpected error fetching Tion Breezer data: 'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/ha_tion_btle/__init__.py", line 109, in async_update_state
    raise e
  File "/config/custom_components/ha_tion_btle/__init__.py", line 99, in async_update_state
    response = await self.__tion.get()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 208, in get
    await self.get_state_from_breezer()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 188, in get_state_from_breezer
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
    await self._connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
    await self._try_connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
    return await self._btle.connect(timeout=5.0)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 107, in connect
    device = await BleakScannerBlueZDBus.find_device_by_address(
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/scanner.py", line 220, in find_device_by_address
    device_identifier = device_identifier.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
2022-08-22 21:54:53.349 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 0.017 seconds (success: False)
2022-08-22 21:55:03.350 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5 
2022-08-22 21:55:03.352 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:55:03.352 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:55:03.352 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7ff536fd60b0>,),kwargs={})
2022-08-22 21:55:03.352 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:55:03.353 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:55:03.353 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:55:03.357 ERROR (MainThread) [custom_components.ha_tion_btle] Unexpected error fetching Tion Breezer data: 'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/ha_tion_btle/__init__.py", line 109, in async_update_state
    raise e
  File "/config/custom_components/ha_tion_btle/__init__.py", line 99, in async_update_state
    response = await self.__tion.get()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 208, in get
    await self.get_state_from_breezer()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 188, in get_state_from_breezer
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
    await self._connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
    await self._try_connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
    return await self._btle.connect(timeout=5.0)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 107, in connect
    device = await BleakScannerBlueZDBus.find_device_by_address(
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/scanner.py", line 220, in find_device_by_address
    device_identifier = device_identifier.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
2022-08-22 21:55:03.359 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 0.007 seconds (success: False)
2022-08-22 21:55:23.361 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5 
2022-08-22 21:55:23.362 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:55:23.362 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:55:23.362 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7ff509b4fb50>,),kwargs={})
2022-08-22 21:55:23.363 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:55:23.363 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:55:23.363 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:55:23.367 ERROR (MainThread) [custom_components.ha_tion_btle] Unexpected error fetching Tion Breezer data: 'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/ha_tion_btle/__init__.py", line 109, in async_update_state
    raise e
  File "/config/custom_components/ha_tion_btle/__init__.py", line 99, in async_update_state
    response = await self.__tion.get()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 208, in get
    await self.get_state_from_breezer()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 188, in get_state_from_breezer
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
    await self._connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
    await self._try_connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
    return await self._btle.connect(timeout=5.0)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 107, in connect
    device = await BleakScannerBlueZDBus.find_device_by_address(
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/scanner.py", line 220, in find_device_by_address
    device_identifier = device_identifier.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
2022-08-22 21:55:23.372 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 0.010 seconds (success: False)
2022-08-22 21:56:03.373 INFO (MainThread) [custom_components.ha_tion_btle] Setting up DE:A7:3B:CF:5F:A5 
2022-08-22 21:56:03.374 INFO (MainThread) [custom_components.ha_tion_btle] Tion instance update started
2022-08-22 21:56:03.374 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
2022-08-22 21:56:03.374 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7ff536ff0520>,),kwargs={})
2022-08-22 21:56:03.375 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
2022-08-22 21:56:03.375 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
2022-08-22 21:56:03.375 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-22 21:56:03.378 ERROR (MainThread) [custom_components.ha_tion_btle] Unexpected error fetching Tion Breezer data: 'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/ha_tion_btle/__init__.py", line 109, in async_update_state
    raise e
  File "/config/custom_components/ha_tion_btle/__init__.py", line 99, in async_update_state
    response = await self.__tion.get()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 208, in get
    await self.get_state_from_breezer()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 188, in get_state_from_breezer
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
    await self._connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
    await self._try_connect()
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
    return await self._btle.connect(timeout=5.0)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 107, in connect
    device = await BleakScannerBlueZDBus.find_device_by_address(
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/scanner.py", line 220, in find_device_by_address
    device_identifier = device_identifier.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
2022-08-22 21:56:03.386 DEBUG (MainThread) [custom_components.ha_tion_btle] Finished fetching Tion Breezer data in 0.012 seconds (success: False)

Обновил интеграцию до v4.0.1. Перезапустил HA. Интеграция висит в ошибке, аналогичной описанной в моём предыдущем посте: image

tms320 commented 2 years ago

Помогло выключение/включение бризера кнопкой на корпусе...

IATkachenko commented 2 years ago

По логам выше, видно что попытка подключения занимает примерно 5 секунд -- это, тот timeout, который был добавлен в v3.0.5. HA рекомендует этот timeout использовать в 10 секунд, но мой опыт общения с бризерами показывает что если не получилось сразу, то и не получится. Поэтому в то что увеличение timeout'a поможет я не верю.

Приведите, пожалуйста, 121-122 строку custom_components/ha_tion_btle/__init__.py к виду

        except Exception as e:
            _LOGGER.critical(f"{response=}, {e=}")

(новую версию в репозиторий уже залил и в будущих релизах эта правка уже будет, но конкретно сейчас катить релиз -- не правильно) Посмотрим что за exception там вылетает.

То что v4.0.0 вызывает проблемы из второго комментария -- известно, см #110. Это было исправлено в v4.0.1.

По наблюдаемому поведению (и решению) очень похоже что к бризеру все же кто-то подключился (пульт/приложение/HA не сбросил соединение). Кнопка с BT частью (по крайней мере на моем 3S) никак не связана.

tms320 commented 2 years ago

Правку внёс, HA перезапустил. Я к бризеру не подключался ни пультом, ни приложением (оно у меня даже не установлено). Может, сосед какой случайно? Но как кто-то мог к нему подключиться, если бризер не был в режиме спаривания?

IATkachenko commented 2 years ago

Сосед -- маловероятно. Идей, пока, ноль. Что-то где-то явно зависло. У меня иногда прилетает пустой ответ от бризера, но достаточно редко и следующая попытка уже успешна.

Подождем повотрения... Но, скорее всего, увидим ничего не говорящее timeout.

Кстати, BT модуль далеко от бризера? Есть радионепроницаемые препятствия по дороге? Эфир (2.4gHz) очень грязный? Если проблема локализуется в вечерене время, то в это время растет нагрузка на эфир, поэтому BTLE может испытывать пробелмы. Но это на уровне безумных идей, которые сложно проверить/подтвердить.

tms320 commented 2 years ago

BT-модуль в пяти метрах от бризера, в прямой видимости. По поводу загрязнённости эфира сказать ничего не могу, ибо не умею её оценивать. Другое BTLE-устройство (сенсор Сяоми) находится дальше и за перегородкой. По нему проблем нет (он работает через штатную интеграцию Bluetooth). Если бы что-то "зависло" в HA, то, наверное, помог бы перезапуск HA/хоста? Но оно не помогло. Видимо, что-то зависло в самом бризере, раз помогло его перевключение... Ладно, будем наблюдать дальше )

IATkachenko commented 2 years ago

Если 5м в прямой видимости, то на эфир, думаю, плевать.

Подождем повотрения... Но, скорее всего, увидим ничего не говорящее timeout.

А может и не timeout: exceptions.TimeoutError() вылетает, но гораздо меньшее количество раз, чем получается пустой ответ. Может, действительно, что-то полезное будет.

plesetsk commented 2 years ago

Добрый день!

У меня проявляется проблема что бризер не отрабатывает отправляемые команды. После перезагрузки ХА висит уведомление необходимой повторной настройки интеграции Tion (всё как описано в этом кейсе). Помогает только systemctl restart bluetooth но почему то на время. Потом происходит что-то что опять препятствует нормальной работе бризера. при этом в логах это:

сен 04 12:12:19 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:12:19.001 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
сен 04 12:12:19 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:12:19.002 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f51305f40a0>,),kwargs={})
сен 04 12:12:25 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:12:25.138 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
сен 04 12:12:25 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:12:25.138 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
сен 04 12:12:25 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:12:25.138 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}

Если попытаться в этот момент, попытаться включить бризер, или изменить режим его работы то в логах будет это.

сен 04 12:20:00 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:00.264 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
сен 04 12:20:00 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:00.264 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f51305f40a0>,),kwargs={})
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:07.299 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='disc'.
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:07.299 DEBUG (MainThread) [tion_btle.tion] _disconnect done. self.connection_status='disc'
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:07.299 DEBUG (MainThread) [tion_btle.tion] Connecting. self.connection_status='disc'.
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:07.299 DEBUG (MainThread) [tion_btle.tion] Trying 0/1: _try_connect(args=(<tion_btle.s4.TionS4 object at 0x7f51305f40a0>,),kwargs={})
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:07.302 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139986773606064]
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: Traceback (most recent call last):
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await future
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: asyncio.exceptions.CancelledError
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: During handling of the above exception, another exception occurred:
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: Traceback (most recent call last):
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     return fut.result()
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: asyncio.exceptions.CancelledError
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: The above exception was the direct cause of the following exception:
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: Traceback (most recent call last):
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await hass.services.async_call(
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     task.result()
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await service.entity_service_call(
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     future.result()  # pop exception if have
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await coro
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await result
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/config/custom_components/ha_tion_btle/climate.py", line 129, in async_set_hvac_mode
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await self._async_set_state(heater=False, is_on=True)
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/config/custom_components/ha_tion_btle/climate.py", line 239, in _async_set_state
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await self.coordinator.set(**kwargs)
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/config/custom_components/ha_tion_btle/__init__.py", line 152, in set
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await self.__tion.set(kwargs)
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 247, in set
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await self.connect()
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 505, in connect
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await self._connect()
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 302, in _connect
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     await self._try_connect()
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 31, in wrapper
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     return await f(*args, **kwargs)
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 295, in _try_connect
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     return await self._btle.connect(timeout=5.0)
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 156, in connect
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     reply = await asyncio.wait_for(
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:   File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]:     raise exceptions.TimeoutError() from exc
сен 04 12:20:07 homeassistant 8af16d70b4eb[1284]: asyncio.exceptions.TimeoutError
сен 04 12:20:09 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:09.943 DEBUG (MainThread) [tion_btle.tion] Enabling notification. self.connection_status='connected'
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.290 DEBUG (MainThread) [tion_btle.tion] _enable_notifications done
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.291 DEBUG (MainThread) [tion_btle.tion] _connect done. self.connection_status='connected'.
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.291 DEBUG (MainThread) [tion_btle.tion] Trying 0/3: _try_write(args=(<tion_btle.s4.TionS4 object at 0x7f51305f40a0>,),kwargs={'request': bytearray(b'\x80\x10\x00:\xa122\x1d\xca\x90\xa7\x81\x9a\xdd\xd4\xbb\xaa')})
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.291 DEBUG (MainThread) [tion_btle.tion] Writing 8010003aa132321dca90a7819addd4bbaa to 98f00002-3788-83ea-453e-f52244709ddb, self.connection_status='connected'
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.293 DEBUG (MainThread) [tion_btle.tion] Collecting data
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.445 DEBUG (MainThread) [tion_btle.tion] Got data in 17 response 002f003aee31321dca90a74584bae13c61001406
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.445 DEBUG (MainThread) [tion_btle.tion] self._data=[bytearray(b'\x00/\x00:\xee12\x1d\xca\x90\xa7E\x84\xba\xe1<a\x00\x14\x06')]
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.449 DEBUG (MainThread) [tion_btle.tion] Got data in 17 response 4013131520972ddc00d29a80001ff7da00fe7c45
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.449 DEBUG (MainThread) [tion_btle.tion] self._data=[bytearray(b'\x00/\x00:\xee12\x1d\xca\x90\xa7E\x84\xba\xe1<a\x00\x14\x06'), bytearray(b'@\x13\x13\x15 \x97-\xdc\x00\xd2\x9a\x80\x00\x1f\xf7\xda\x00\xfe|E')]
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.492 DEBUG (MainThread) [tion_btle.tion] Got data in 17 response c0000000000006007586
сен 04 12:20:11 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:11.492 DEBUG (MainThread) [tion_btle.tion] self._data=[bytearray(b'\x00/\x00:\xee12\x1d\xca\x90\xa7E\x84\xba\xe1<a\x00\x14\x06'), bytearray(b'@\x13\x13\x15 \x97-\xdc\x00\xd2\x9a\x80\x00\x1f\xf7\xda\x00\xfe|E'), bytearray(b'\xc0\x00\x00\x00\x00\x00\x06\x00u\x86')]
сен 04 12:20:12 homeassistant 8af16d70b4eb[1284]: 2022-09-04 12:20:12.293 DEBUG (MainThread) [tion_btle.tion] Disconnecting. self.connection_status='connected'.

При этом в интерфейсе ХА появится уведомление failed call service Climate\set_hvac_mode

Через какое то время бризер может ожить а может и не ожить и тогда надо перезапускать блютус снова.

Спасибо!