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

Connection Rejected Due To Security Reasons [HA 2022.8.5, интеграция v4.0.0] #109

Closed
tms320 opened this issue Aug 18, 2022 · 3 comments
Labels
Bluetooth BT related
Milestone

Comments

@tms320
Copy link

tms320 commented Aug 18, 2022

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

  • версия Home Assistant: 2022.8.5
  • способ установки Home Assistant:
    [ ] venv
    [x] Docker (HA supervised)
    [ ] Home Assistant OS
  • версия компонента: 4.0.0
  • модель бризера: 4S

[x] в момент проявления проблемы к бризеру никто не подключен
[x] bluetooth в системе работает корректно, действий из WiKi не требуется
[x] проблема не похожа ни на одну из FAQ

Краткое описание

Вчера вечером обновил интеграцию до v4.0.0. Всё заработало нормально, бризер управлялся из HA.
На ночь оставил бризер на минимальной скорости 1.
Утром попытался увеличить скорость до 50% - и никакой реакции. На команды включения/выключения тоже не реагирует.
Дебаг-логи для интеграции (в configuration.yaml) я, увы, вчера отключил. Поэтому в логах HA только это:

2022-08-17 23:48:15.785 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-17 23:48:15.787 ERROR (MainThread) [custom_components.ha_tion_btle] Unexpected error fetching Tion Breezer data: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Connection Rejected Due To Security Reasons)
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 308, in _connect
await self._enable_notifications()
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 337, in _enable_notifications
raise e
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 334, in _enable_notifications
await self._btle.start_notify(self.uuid_notify, self._delegation.handleNotification)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 825, in start_notify
assert_reply(reply)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Connection Rejected Due To Security Reasons)
2022-08-17 23:55:46.783 WARNING (MainThread) [tion_btle.tion] Got exception [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Connection Rejected Due To Security Reasons) while enabling notifications!
2022-08-17 23:55:46.786 CRITICAL (MainThread) [custom_components.ha_tion_btle] Response is {}
2022-08-17 23:55:46.788 ERROR (MainThread) [custom_components.ha_tion_btle] Unexpected error fetching Tion Breezer data: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Connection Rejected Due To Security Reasons)
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 308, in _connect
await self._enable_notifications()
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 337, in _enable_notifications
raise e
File "/usr/local/lib/python3.10/site-packages/tion_btle/tion.py", line 334, in _enable_notifications
await self._btle.start_notify(self.uuid_notify, self._delegation.handleNotification)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 825, in start_notify
assert_reply(reply)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Connection Rejected Due To Security Reasons)
2022-08-18 02:16:30.606 WARNING (MainThread) [tion_btle.tion] Got exception: [org.bluez.Error.Failed] le-connection-abort-by-local. Will try again

Утром перезапустил HA - всё заработало, бризер управляется, в логах ошибок нет. Буду наблюдать дальше...

@IATkachenko
Copy link
Contributor

Есть одна идея, связанная с тем что я сейчас не обновляю bleak-device каждый раз (что не совсем корректное поведение).
В логах сервера (dmesg/messages/journalctl) нет ничего про BT адаптер?

@IATkachenko IATkachenko added the Bluetooth BT related label Aug 18, 2022
@tms320
Copy link
Author

tms320 commented Aug 18, 2022

В логах сервера (dmesg/messages/journalctl) нет ничего про BT адаптер?

Попытался отфильтровать (по ключевым словам tion/bleak/bluetooth) логи сервера-хоста, где установлен HA, начиная со вчерашнего вечера и до утра.
См. вложение:
log.txt
PS: за прошедший день проблем не было.

@IATkachenko IATkachenko added this to the v4.0.1 milestone Aug 18, 2022
@IATkachenko
Copy link
Contributor

Скорее всего исправлено в v4.0.1.

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

No branches or pull requests

2 participants