Description
Describe the bug
First I would like to say thank you for this work you have done, It's super cool that there are so many people who are dictated to make things work for the Home assistant.
As such I don't think it's a bug, but more that it is not finished for Unifi UA-Ultra?
but the Keep it unlocked/unlock & reset and custom set.Iis not working.
Home assistant gives this error message:
Failed to perform the action select/select_option. 'data'
Is there anything I can do to help make it work?
Which Hub are you using
Unifi UA-Ultra
Versions:
- Home Assistant version = 2024.9.2
- Unifi Access version = Access 2.2.11
- Unifi Access Integration version = 1.2.4
Home Assistant DEBUG logs (MANDATORY)
2024-09-22 21:50:55.651 INFO (SyncWorker_36) [custom_components.unifi_access.hub] Setting door lock rule for Door ID 07ddb690-0b0d-4796-9ba3-4c2aaaf84414 {'type': 'keep_lock'}
2024-09-22 21:50:55.651 DEBUG (SyncWorker_36) [custom_components.unifi_access.hub] Making HTTP PUT Request with URL https://192.168.1.1:12445/api/v1/developer/doors/07ddb690-0b0d-4796-9ba3-4c2aaaf84414/lock_rule and data {'type': 'keep_lock'}
2024-09-22 21:50:55.711 DEBUG (SyncWorker_36) [custom_components.unifi_access.hub] HTTP Response {'code': 'CODE_SYSTEM_ERROR', 'msg': "An error occurred on the server's end."}
2024-09-22 21:50:55.712 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140544372489760] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 188, in async_handle_select_option
await self.async_select_option(option)
File "/config/custom_components/unifi_access/select.py", line 89, in async_select_option
await self.hass.async_add_executor_job(self.door.set_lock_rule, option)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/unifi_access/door.py", line 93, in set_lock_rule
self._hub.set_door_lock_rule(self._id, new_door_lock_rule)
File "/config/custom_components/unifi_access/hub.py", line 210, in set_door_lock_rule
self._make_http_request(
File "/config/custom_components/unifi_access/hub.py", line 269, in _make_http_request
return response["data"]
~~~~~~~~^^^^^^^^
KeyError: 'data'
2024-09-22 21:50:58.774 INFO (SyncWorker_61) [custom_components.unifi_access.hub] Setting door lock rule for Door ID 07ddb690-0b0d-4796-9ba3-4c2aaaf84414 {'type': 'keep_unlock'}
2024-09-22 21:50:58.774 DEBUG (SyncWorker_61) [custom_components.unifi_access.hub] Making HTTP PUT Request with URL https://192.168.1.1:12445/api/v1/developer/doors/07ddb690-0b0d-4796-9ba3-4c2aaaf84414/lock_rule and data {'type': 'keep_unlock'}
2024-09-22 21:50:58.848 DEBUG (SyncWorker_61) [custom_components.unifi_access.hub] HTTP Response {'code': 'CODE_SYSTEM_ERROR', 'msg': "An error occurred on the server's end."}
2024-09-22 21:50:58.850 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140544372489760] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 188, in async_handle_select_option
await self.async_select_option(option)
File "/config/custom_components/unifi_access/select.py", line 89, in async_select_option
await self.hass.async_add_executor_job(self.door.set_lock_rule, option)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/unifi_access/door.py", line 93, in set_lock_rule
self._hub.set_door_lock_rule(self._id, new_door_lock_rule)
File "/config/custom_components/unifi_access/hub.py", line 210, in set_door_lock_rule
self._make_http_request(
File "/config/custom_components/unifi_access/hub.py", line 269, in _make_http_request
return response["data"]
~~~~~~~~^^^^^^^^
KeyError: 'data'
2024-09-22 21:51:02.003 INFO (SyncWorker_14) [custom_components.unifi_access.hub] Setting door lock rule for Door ID 07ddb690-0b0d-4796-9ba3-4c2aaaf84414 {'type': 'reset'}
2024-09-22 21:51:02.003 DEBUG (SyncWorker_14) [custom_components.unifi_access.hub] Making HTTP PUT Request with URL https://192.168.1.1:12445/api/v1/developer/doors/07ddb690-0b0d-4796-9ba3-4c2aaaf84414/lock_rule and data {'type': 'reset'}
2024-09-22 21:51:02.067 DEBUG (SyncWorker_14) [custom_components.unifi_access.hub] HTTP Response {'code': 'CODE_SYSTEM_ERROR', 'msg': "An error occurred on the server's end."}
2024-09-22 21:51:02.069 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140544372489760] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 188, in async_handle_select_option
await self.async_select_option(option)
File "/config/custom_components/unifi_access/select.py", line 89, in async_select_option
await self.hass.async_add_executor_job(self.door.set_lock_rule, option)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/unifi_access/door.py", line 93, in set_lock_rule
self._hub.set_door_lock_rule(self._id, new_door_lock_rule)
File "/config/custom_components/unifi_access/hub.py", line 210, in set_door_lock_rule
self._make_http_request(
File "/config/custom_components/unifi_access/hub.py", line 269, in _make_http_request
return response["data"]
~~~~~~~~^^^^^^^^
KeyError: 'data'