home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.28k forks source link

Lutron event not working #116746

Closed maddeuce closed 1 week ago

maddeuce commented 2 weeks ago

The problem

Lutron pico remote stop working. I have them trigger different devices via monitoring lutron events. Now each time I press button it does nothing and the below log popup

What version of Home Assistant Core has the issue?

core-2024.5.1

What was the last working version of Home Assistant Core?

2024.5.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Lutron Pico Remote

Link to integration documentation on our website

No response

Diagnostics information

Logger: homeassistant.core
Source: core.py:1555
First occurred: 8:28:22 PM (1 occurrences)
Last logged: 8:28:22 PM

Error in event filter
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1555, in async_fire_internal
    if event_data is None or not event_filter(event_data):
                                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/report_state.py", line 77, in _async_entity_state_filter
    and google_config.should_expose(new_state)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/cloud/google_config.py", line 280, in should_expose
    return self._should_expose_entity_id(state.entity_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/cloud/google_config.py", line 322, in _should_expose_entity_id
    return async_should_expose(self.hass, CLOUD_GOOGLE, entity_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/exposed_entities.py", line 536, in async_should_expose
    return exposed_entities.async_should_expose(assistant, entity_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/exposed_entities.py", line 272, in async_should_expose
    entity_registry.async_update_entity_options(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1213, in async_update_entity_options
    return self._async_update_entity(entity_id, options=new_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1090, in _async_update_entity
    self.hass.verify_event_loop_thread("_async_update_entity")
  File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
    frame.report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that integration 'homeassistant' calls _async_update_entity from a thread at homeassistant/components/homeassistant/exposed_entities.py, line 272: entity_registry.async_update_entity_options(. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+homeassistant%22.

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

mib1185 commented 1 week ago

Hi @maddeuce the provided error log is not related to any Lutron integration - those next question, please provide a link to the documentation of the integration you're referring to, thx 👍

bdraco commented 1 week ago

It looks like something is managing to call deep enough in the stack to generate a state changed event from a thread and it catches it on the other side of the callback when _async_update_entity gets called

bdraco commented 1 week ago

Please enable debug mode and asyncio debug using the steps in https://community.home-assistant.io/t/2024-5-tracking-down-instability-issues-caused-by-integrations/724441

Check these sections:

Be sure to enable both so it can catch both classes of issues

home-assistant[bot] commented 1 week ago

Hey there @cdheiser, @wilburcforce, mind taking a look at this issue as it has been labeled with an integration (lutron) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `lutron` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign lutron` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


lutron documentation lutron source (message by IssueLinks)

maddeuce commented 1 week ago

Here you go thank for looking

Logger: pylutron Source: /usr/local/lib/python3.12/site-packages/pylutron/init.py:203 First occurred: 6:12:28 PM (1 occurrences) Last logged: 6:12:28 PM

Uncaught exception Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pylutron/init.py", line 201, in run self._main_loop() File "/usr/local/lib/python3.12/site-packages/pylutron/init.py", line 192, in _main_loop self._recv_cb(line.decode('ascii').rstrip()) File "/usr/local/lib/python3.12/site-packages/pylutron/init.py", line 499, in _recv handled = obj.handle_update(args) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pylutron/init.py", line 1071, in handle_update return self._components[component].handle_update(action, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pylutron/init.py", line 918, in handle_update self._dispatch_event(ev_map[action], {}) File "/usr/local/lib/python3.12/site-packages/pylutron/init.py", line 633, in _dispatch_event handler(self, context, event, params) File "/usr/src/homeassistant/homeassistant/components/lutron/event.py", line 109, in handle_event self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state self.hass.verify_event_loop_thread("async_write_ha_state") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that integration 'lutron' calls async_write_ha_state from a thread at homeassistant/components/lutron/event.py, line 109: self.async_write_ha_state(). Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+lutron%22.

bdraco commented 1 week ago

Perfect. Thank you