Closed Sperryfreak01 closed 1 year ago
Hey there @swails, @bdraco, @danaues, mind taking a look at this issue as it has been labeled with an integration (lutron_caseta
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
lutron_caseta documentation lutron_caseta source (message by IssueLinks)
Please upload debug logs
https://www.home-assistant.io/docs/configuration/troubleshooting/#enabling-debug-logging
Tried doing that a few times and never saw anything extra get logged, I'll try again with the instructions linked
Yeah, So I am dumb didnt realize you had to turn it off to get the logs...
too long to post here, see gist https://gist.github.com/Sperryfreak01/de7a6f930d65c1ee69e4b2544e8d97a4
It looks like a race in the underlying library
2023-09-26 08:10:57.188 CRITICAL (MainThread) [pylutron_caseta.smartbridge] monitor loop has exited
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 484, in _monitor
await self._monitor_once()
File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 536, in _monitor_once
self._leap.close()
File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/leap.py", line 169, in close
request.set_exception(BridgeDisconnectedError())
asyncio.exceptions.InvalidStateError: invalid state
Its likely setting the exception twice or too late
Holy hell, did you already submit a PR to address? I'm still trying to read through the code and figure out what you saw.
thanks for addressing. Maybe you can also tag this issue on your PR? https://github.com/gurumitts/pylutron-caseta/issues/148
I see similar error messages, for example:
2023-09-02 17:34:10.743 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 709, in _login
await self._subscribe_to_button_status()
File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 1244, in _subscribe_to_button_status
response, _ = await self._subscribe(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 270, in _subscribe
raise BridgeDisconnectedError()
pylutron_caseta.BridgeDisconnectedError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 724, in _login
self._login_completed.set_exception(ex)
asyncio.exceptions.InvalidStateError: invalid state
Updating pylutron-caseta may fix this error, but it seems like this installation has significant networking issues and will likely continue to have problems in general.
The problem
Several times a day HA looses the ability to control Lutron Casetta devices, Lutron Pico devices also stop triggering automations when the issue occurs. When the issue occurs the only thing that fixes the issue is to restart home assistant. As a sorta workaround right now I am having HA restart every 8 hours but this is not perfect as the issue sometimes happens more frequently than every 8 hours.
Everything has worked for for the last year, using Lutron that entire time. The last time I added a new Lutron device was a month or two before this issue started occurring.
When the issue occurs I am able to operate my Lutron devices via Alexa (through Lutron integration, not using HA at all) and via the Lutron App. Everything else works fine in HA when the issue occurs.
What version of Home Assistant Core has the issue?
System Information version | core-2023.9.2 -- | -- installation_type | Home Assistant OS dev | false hassio | true docker | true user | root virtualenv | false python_version | 3.11.5 os_name | Linux os_version | 6.1.45 arch | x86_64 timezone | America/Los_Angeles config_dir | /config
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.32.1 Stage | running Available Repositories | 1296 Downloaded Repositories | 16Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okHome Assistant Supervisor
host_os | Home Assistant OS 10.5 -- | -- update_channel | stable supervisor_version | supervisor-2023.09.2 agent_version | 1.5.1 docker_version | 23.0.6 disk_total | 30.8 GB disk_used | 20.2 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Mosquitto broker (6.3.1), Ring-MQTT with Video Streaming (5.6.3), Terminal & SSH (9.7.1), File editor (5.6.0), ESPHome (2023.8.3), Frigate Proxy (1.3), ESPresense Companion (0.3.40), Double Take Proxy (1.0.0), Node-RED (14.5.0), Matter Server (4.9.0)Dashboards
dashboards | 4 -- | -- resources | 4 views | 11 mode | storageRecorder
oldest_recorder_run | September 16, 2023 at 5:08 PM -- | -- current_recorder_run | September 26, 2023 at 8:00 AM estimated_db_size | 1827.16 MiB database_engine | sqlite database_version | 3.41.2What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Lutron Casetta
Link to integration documentation on our website
https://www.home-assistant.io/integrations/lutron_caseta/
Diagnostics information
GitHub complained about the length of the file so posted in Gist, https://gist.github.com/Sperryfreak01/c720ba5f0dee9ebc42f9b37fc4bf257c
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response