Closed zuobianfy closed 9 months ago
点击开机会提示。调用服务失败,Failed to register advertisement
https://github.com/manymuch/Xgimi-4-Home-Assistant#about-ble-token-for-power-on
Make sure you Home Assistant is running on a device with bluetooth
Hello, I am getting same error, Bluetooth is working for sure as I can push the advertised with a token using bluetoothctl on same device and wake up projector.
48.747 WARNING (SyncWorker_4) [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 2024-02-05 19:11:48.753 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration xgimi 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 2024-02-05 19:11:54.281 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly 2024-02-05 19:11:54.407 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=8 from 2024-02-05 18:06:58.168958) 2024-02-05 19:14:04.726 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547550311104] Failed to register advertisement Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/xgimi/remote.py", line 87, in async_turn_on await self.xgimi_api.async_send_command("poweron") File "/config/custom_components/xgimi/pyxgimi.py", line 109, in async_send_command await self.async_robust_ble_power_on(self.manufacturer_data) File "/config/custom_components/xgimi/pyxgimi.py", line 92, in async_robust_ble_power_on await self.async_ble_power_on(manufacturer_data, company_id, service_uuid) File "/config/custom_components/xgimi/pyxgimi.py", line 88, in async_ble_power_on await advert.register(bus) File "/usr/local/lib/python3.11/site-packages/bluez_peripheral/advert.py", line 119, in register await interface.call_register_advertisement(path, {}) File "/usr/local/lib/python3.11/site-packages/dbus_next/aio/proxy_object.py", line 92, in method_fn BaseProxyInterface._check_method_return(msg, intr_method.out_signature) File "/usr/local/lib/python3.11/site-packages/dbus_next/proxy_object.py", line 62, in _check_method_return raise DBusError._from_message(msg) dbus_next.errors.DBusError: Failed to register advertisement 2024-02-05 19:14:47.176 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547550311104] Failed to register advertisement Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/xgimi/remote.py", line 87, in async_turn_on await self.xgimi_api.async_send_command("poweron") File "/config/custom_components/xgimi/pyxgimi.py", line 109, in async_send_command await self.async_robust_ble_power_on(self.manufacturer_data) File "/config/custom_components/xgimi/pyxgimi.py", line 92, in async_robust_ble_power_on await self.async_ble_power_on(manufacturer_data, company_id, service_uuid) File "/config/custom_components/xgimi/pyxgimi.py", line 88, in async_ble_power_on await advert.register(bus) File "/usr/local/lib/python3.11/site-packages/bluez_peripheral/advert.py", line 119, in register await interface.call_register_advertisement(path, {}) File "/usr/local/lib/python3.11/site-packages/dbus_next/aio/proxy_object.py", line 92, in method_fn BaseProxyInterface._check_method_return(msg, intr_method.out_signature) File "/usr/local/lib/python3.11/site-packages/dbus_next/proxy_object.py", line 62, in _check_method_return raise DBusError._from_message(msg) dbus_next.errors.DBusError: Failed to register advertisement 2024-02-05 19:14:48.920 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547550311104] Failed to register advertisement Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/xgimi/remote.py", line 87, in async_turn_on await self.xgimi_api.async_send_command("poweron") File "/config/custom_components/xgimi/pyxgimi.py", line 109, in async_send_command await self.async_robust_ble_power_on(self.manufacturer_data) File "/config/custom_components/xgimi/pyxgimi.py", line 92, in async_robust_ble_power_on await self.async_ble_power_on(manufacturer_data, company_id, service_uuid) File "/config/custom_components/xgimi/pyxgimi.py", line 88, in async_ble_power_on await advert.register(bus) File "/usr/local/lib/python3.11/site-packages/bluez_peripheral/advert.py", line 119, in register await interface.call_register_advertisement(path, {}) File "/usr/local/lib/python3.11/site-packages/dbus_next/aio/proxy_object.py", line 92, in method_fn BaseProxyInterface._check_method_return(msg, intr_method.out_signature) File "/usr/local/lib/python3.11/site-packages/dbus_next/proxy_object.py", line 62, in _check_method_return raise DBusError._from_message(msg) dbus_next.errors.DBusError: Failed to register advertisement 2024-02-05 19:14:50.444 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547550311104] Failed to register advertisement Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/xgimi/remote.py", line 87, in async_turn_on await self.xgimi_api.async_send_command("poweron") File "/config/custom_components/xgimi/pyxgimi.py", line 109, in async_send_command await self.async_robust_ble_power_on(self.manufacturer_data) File "/config/custom_components/xgimi/pyxgimi.py", line 92, in async_robust_ble_power_on await self.async_ble_power_on(manufacturer_data, company_id, service_uuid) File "/config/custom_components/xgimi/pyxgimi.py", line 88, in async_ble_power_on await advert.register(bus) File "/usr/local/lib/python3.11/site-packages/bluez_peripheral/advert.py", line 119, in register await interface.call_register_advertisement(path, {}) File "/usr/local/lib/python3.11/site-packages/dbus_next/aio/proxy_object.py", line 92, in method_fn BaseProxyInterface._check_method_return(msg, intr_method.out_signature) File "/usr/local/lib/python3.11/site-packages/dbus_next/proxy_object.py", line 62, in _check_method_return raise DBusError._from_message(msg) dbus_next.errors.DBusError: Failed to register advertisement 2024-02-05 19:15:04.133 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547550311104] Failed to register advertisement Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/xgimi/remote.py", line 87, in async_turn_on await self.xgimi_api.async_send_command("poweron") File "/config/custom_components/xgimi/pyxgimi.py", line 109, in async_send_command await self.async_robust_ble_power_on(self.manufacturer_data) File "/config/custom_components/xgimi/pyxgimi.py", line 92, in async_robust_ble_power_on await self.async_ble_power_on(manufacturer_data, company_id, service_uuid) File "/config/custom_components/xgimi/pyxgimi.py", line 88, in async_ble_power_on await advert.register(bus) File "/usr/local/lib/python3.11/site-packages/bluez_peripheral/advert.py", line 119, in register await interface.call_register_advertisement(path, {}) File "/usr/local/lib/python3.11/site-packages/dbus_next/aio/proxy_object.py", line 92, in method_fn BaseProxyInterface._check_method_return(msg, intr_method.out_signature) File "/usr/local/lib/python3.11/site-packages/dbus_next/proxy_object.py", line 62, in _check_method_return raise DBusError._from_message(msg) dbus_next.errors.DBusError: Failed to register advertisement 2024-02-05 19:15:12.792 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547550311104] Failed to register advertisement Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/xgimi/remote.py", line 87, in async_turn_on await self.xgimi_api.async_send_command("poweron") File "/config/custom_components/xgimi/pyxgimi.py", line 109, in async_send_command await self.async_robust_ble_power_on(self.manufacturer_data) File "/config/custom_components/xgimi/pyxgimi.py", line 92, in async_robust_ble_power_on await self.async_ble_power_on(manufacturer_data, company_id, service_uuid) File "/config/custom_components/xgimi/pyxgimi.py", line 88, in async_ble_power_on await advert.register(bus) File "/usr/local/lib/python3.11/site-packages/bluez_peripheral/advert.py", line 119, in register await interface.call_register_advertisement(path, {}) File "/usr/local/lib/python3.11/site-packages/dbus_next/aio/proxy_object.py", line 92, in method_fn BaseProxyInterface._check_method_return(msg, intr_method.out_signature) File "/usr/local/lib/python3.11/site-packages/dbus_next/proxy_object.py", line 62, in _check_method_return raise DBusError._from_message(msg) dbus_next.errors.DBusError: Failed to register advertisement
Ok I have found the issue, if your Token code is to long that will be the behavior, for me it was the issue where I have included manufacturer hex. configuration just need a token...
这个是什么原因引起的? 关机可以关机,遥控器的那些按钮也可以设置。就是开机的时候,会报错。
Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/xgimi/pyxgimi.py:76 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 21:56:04 (13 occurrences) Last logged: 22:03:34
[281473322082320] Failed to register advertisement [281472808418000] Failed to register advertisement [281472798105104] Failed to register advertisement [281472798483792] Failed to register advertisement Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 811, in entity_service_call future.result() # pop exception if have ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1034, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 851, in _handle_entity_call await result File "/config/custom_components/xgimi/remote.py", line 87, in async_turn_on await self.xgimi_api.async_send_command("poweron") File "/config/custom_components/xgimi/pyxgimi.py", line 97, in async_send_command await self.async_robust_ble_power_on(self.manufacturer_data) File "/config/custom_components/xgimi/pyxgimi.py", line 80, in async_robust_ble_power_on await self.async_ble_power_on(manufacturer_data, company_id, service_uuid) File "/config/custom_components/xgimi/pyxgimi.py", line 76, in async_ble_power_on await advert.register(bus) File "/usr/local/lib/python3.11/site-packages/bluez_peripheral/advert.py", line 119, in register await interface.call_register_advertisement(path, {}) File "/usr/local/lib/python3.11/site-packages/dbus_next/aio/proxy_object.py", line 92, in method_fn BaseProxyInterface._check_method_return(msg, intr_method.out_signature) File "/usr/local/lib/python3.11/site-packages/dbus_next/proxy_object.py", line 62, in _check_method_return raise DBusError._from_message(msg) dbus_next.errors.DBusError: Failed to register advertisement