Closed caribo closed 7 months ago
@mariusmotea I think I am seeing this issue due to aiohue component of Homeassistant implementing a hack to keep the eventstream alive. Basically they are creating a geofence_client and updating the name very minute to flush the event through the event stream and determine that the connection is still alive.. and I don't think diyhue handles the creation / update of the geofence_client..
async def __keepalive_workaround(self) -> NoReturn:
"""Send keepalive command to bridge, abusing geofence client."""
# Oh yeah, this is a major hack and hopefully it will only be temporary ;-)
# Signify forgot to implement some sort of periodic keep alive message on the EventBus
# so we have no way to determine if the connection is still alive.
# To workaround this, we create a geofence client (with status not at home)
# on the bridge for aiohue which will have its name updated every minute
# this will result in an event on the eventstream and thus a way to figure out
# if its still alive. It's not very pretty but at least it works.
# Now let's contact Signify if this can be solved.
# Update 2022-12-12: Still no solution and apparently no real need for signify to fix this
# https://developers.meethue.com/forum/t/several-issues-and-questions-about-the-v2-api/6586/35
prefix = "aiohue_"
Their approach leads to the eventstream connecting / disconnecting continually as the "keepalive" does not work with Diyhue (works with physical bridge though).
GitHub
Python3 asyncio package to talk to Philips Hue. Contribute to home-assistant-libs/aiohue development by creating an account on GitHub.
I have a slightly different error but certainly related too
2023-08-11 16:29:47,407 - flaskUI.v2restapi - DEBUG - {'is_at_home': False, 'name': 'aiohue_', 'type': 'geofence_client'}
[2023-08-11 16:29:47,409] ERROR in app: Exception on /clip/v2/resource/geofence_client [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask_restful/__init__.py", line 467, in wrapper
resp = resource(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/views.py", line 84, in view
return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask_restful/__init__.py", line 582, in dispatch_request
resp = meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/hue-emulator/flaskUI/v2restapi.py", line 465, in post
"rid": newObject.id_v2,
^^^^^^^^^^^^^^^
Describe the bug
I have diyHue (06/03/2023) added to HomeAssistant 2023.3.1
The diyHue log file shows error due to missing id_v2 attribute associated with the geofence_client object
Steps to Reproduce
Connect HomeAssistant to diyhue Observe diyhue logs
Expected behavior
No errors expected
Logs
Docker Info (please complete the following information):
Checklist
Additional context