Closed digitalbanana closed 9 months ago
Hey there @angellusmortis, @bdraco, mind taking a look at this issue as it has been labeled with an integration (unifiprotect
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
unifiprotect documentation unifiprotect source (message by IssueLinks)
@home-assistant add-label needs-more-information
Your logs say that it is still working fine.
hi @AngellusMortis - okay im not sure exactly which events the logs relate to but the HA installation shows nothing for the (previously working) doorbell pressed event... i set up some text saying doorbell broken and i thought thats what these logs relate to...
either way i managed to get around the problem - i changed my automation to trigger on "G4 Doorbell Pro Last Doorbell Ring" changes and its working ok - very strange though - my hunch is that the doorbell is behaving slightly differently after the protect update
okay im not sure exactly which events the logs relate to but the HA installation shows nothing for the (previously working) doorbell pressed event
Exactly. You do not. That is why the issue template tells you how to generate logs and diagnostics. When you do not follow those instructions, you end up being wrong about what is important because you do not know how the code works. If you still want to disagree there is something wrong, then you need to follow the instructions correctly this time.
okay i tried to follow the guidelines for log submission as best i could but sincere apologies if i have done this incorrectly. My initial post was that something has changed somewhere (either in HA core or Unifi) but to be honest I dont know which. Am happy to close this as i found a workaround but i would suspect there might be future similar reports if anyone is relying on the Doorbell pressed event. Thanks for your input
I believe i have the same problem. Anything i can do to help? I do have a g4 doorbell (not pro) and do not see any events when pressing the button but also have no last pressed attribute.
I faced the same problem today and found a simple solution: The doorbell sensor was somehow missing in the integration (I updated to homeassistant 2023.12.4 yesterday), although it was present in the past and visible (without errors) in the log and history as well as in my automation. But it was not changed/triggered anymore when the doorbell button was pressed.
After I RELOADED the unifi protect integration, the sensor became visible again:
And my automation is working again:
I am using the G4 Doorbell not Pro
I readopted the doorbell, reloaded the integration and restarted the HA container as well but no dice.
Version | core-2023.12.4
Installation Type | Home Assistant Container
Development | false
Supervisor | false
Docker | true
User | root
Virtual Environment | false
Python Version | 3.11.6
Operating System Family | Linux
Operating System Version | 6.1.0-16-amd64
CPU Architecture | x86_64
Timezone | Europe/Amsterdam
Configuration Directory | /config
Here are my diagnostics with debug logging enabled (turned on debug logging, pressed doorbell, exported logs): home-assistant_unifiprotect_2023-12-31T15-36-32.602Z.log
Some things that stand out to me in the log:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/websocket.py", line 82, in _process_message
sub(msg)
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 694, in _process_ws_message
processed_message = self.bootstrap.process_ws_packet(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/bootstrap.py", line 578, in process_ws_packet
return self._process_device_update(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/bootstrap.py", line 489, in _process_device_update
obj = obj.update_from_dict(deepcopy(data))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/devices.py", line 1041, in update_from_dict
return super().update_from_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 546, in update_from_dict
setattr(self, key, convert_unifi_data(data[key], self.__fields__[key]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/utils.py", line 238, in convert_unifi_data
return type_(value)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/uuid.py", line 175, in __init__
hex = hex.replace('urn:', '').replace('uuid:', '')
^^^^^^^^^^^
AttributeError: 'UUID' object has no attribute 'replace'
2023-12-31 16:34:40.620 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/diagnostics/__init__.py", line 249, in get
data = await info.config_entry_diagnostics(hass, config_entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/diagnostics.py", line 21, in async_get_config_entry_diagnostics
bootstrap = cast(dict[str, Any], anonymize_data(data.api.bootstrap.unifi_dict()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/bootstrap.py", line 232, in unifi_dict
data = super().unifi_dict(data=data, exclude=exclude)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 476, in unifi_dict
data[key] = self._unifi_dict_protect_obj_dict(data, key, use_obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 432, in _unifi_dict_protect_obj_dict
obj = obj.unifi_dict() # noqa: PLW2901
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/devices.py", line 985, in unifi_dict
data = super().unifi_dict(data=data, exclude=exclude)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 1105, in unifi_dict
data = super().unifi_dict(data=data, exclude=exclude)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 976, in unifi_dict
data = super().unifi_dict(data=data, exclude=exclude)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 586, in unifi_dict
data = super().unifi_dict(data=data, exclude=exclude)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 468, in unifi_dict
data[key] = self._unifi_dict_protect_obj(data, key, use_obj, klass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 386, in _unifi_dict_protect_obj
value = getattr(self, key)
^^^^^^^^^^^^^^^^^^
AttributeError: 'Camera' object has no attribute 'event_stats'
Here are the access control settings for the local account I'm using for HA and Scrypted:
Timeline view:
Before 16:23 I was factory resetting and readopting the doorbell hence the blank space.
OP never provided requested diagnostics data or additional data about how it was failing. If you are having this issue, make your own issue and provide the requested logs and diagnostics data.
@home-assistant close
The problem
have had HA running in docker with G4 doorbell pro integration working for about 6 months, an automation plays a sound on a sonos device on doorbell pressed.
since update to protect 2.10.11, HA is no longer seeing doorbell pressed events
weirdly last ring time is updated so am trying to make that work but wondering if anyone else has seen this or has any idea. my guess is that the unifi firmware update broke it
What version of Home Assistant Core has the issue?
2023.12.0
What was the last working version of Home Assistant Core?
2023.12.0
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Unifi Protect
Link to integration documentation on our website
https://www.home-assistant.io/integrations/unifiprotect/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?