gurumitts / pylutron-caseta

Apache License 2.0
153 stars 97 forks source link

Sporadic Async Issues #160

Open RobX82 opened 9 months ago

RobX82 commented 9 months ago

Originally made an issue over in home assistant which can be viewed here.

Appear to get these issues where pylutron-caseta states it was not expecting a message. This causes the automation to then fail and not finish. The above link has log files and further information but can provide further information if necessary.

Logger: pylutron_caseta.leap Source: runner.py:188 First occurred: December 21, 2023 at 8:51:41 PM (3 occurrences) Last logged: 8:28:14 PM

Was not expecting message with tag b6e6e61e-a3f9-41a7-a37a-6692ee43808d: {'CommuniqueType': 'CreateResponse', 'Header': {'MessageBodyType': 'OneZoneStatus', 'StatusCode': '201 Created', 'Url': '/zone/6/commandprocessor'}, 'Body': {'ZoneStatus': {'href': '/zone/6/status', 'Level': 100, 'SwitchedLevel': 'On', 'Zone': {'href': '/zone/6'}, 'StatusAccuracy': 'Good', 'Availability': 'Available'}}} Was not expecting message with tag 8ae2398a-6a4f-423b-852e-f2078cf0ee46: {'CommuniqueType': 'CreateResponse', 'Header': {'MessageBodyType': 'OneZoneStatus', 'StatusCode': '201 Created', 'Url': '/zone/6/commandprocessor'}, 'Body': {'ZoneStatus': {'href': '/zone/6/status', 'Level': 100, 'SwitchedLevel': 'On', 'Zone': {'href': '/zone/6'}, 'StatusAccuracy': 'Good', 'Availability': 'Available'}}} Was not expecting message with tag fc8ff5c6-0b18-4b46-8371-a50dd99b534d: {'CommuniqueType': 'CreateResponse', 'Header': {'MessageBodyType': 'OneZoneStatus', 'StatusCode': '201 Created', 'Url': '/zone/6/commandprocessor'}, 'Body': {'ZoneStatus': {'href': '/zone/6/status', 'Level': 100, 'SwitchedLevel': 'On', 'Zone': {'href': '/zone/6'}, 'StatusAccuracy': 'Good', 'Availability': 'Available'}}}

RobX82 commented 8 months ago

Updated to Home Assistant 2024.2.2 which appears to Update pylutron to 0.2.12.

Unfortunately still getting the same messages on occasion. Below is the specific message concerning pylutron_caseta. Following is the error from the automation log for the error.

Logger: pylutron_caseta.leap Source: runner.py:188 First occurred: 8:18:11 PM (3 occurrences) Last logged: 8:18:11 PM

Was not expecting message with tag 8bdeb7d6-2552-48d8-b463-b3b099d01a4c: {'CommuniqueType': 'CreateResponse', 'Header': {'MessageBodyType': 'OneZoneStatus', 'StatusCode': '201 Created', 'Url': '/zone/3/commandprocessor'}, 'Body': {'ZoneStatus': {'href': '/zone/3/status', 'Level': 100, 'Zone': {'href': '/zone/3'}, 'StatusAccuracy': 'Good', 'Availability': 'Available'}}} Was not expecting message with tag 9daf1226-3e05-4cd6-a61b-4d75f1c5b59d: {'CommuniqueType': 'CreateResponse', 'Header': {'MessageBodyType': 'OneZoneStatus', 'StatusCode': '201 Created', 'Url': '/zone/5/commandprocessor'}, 'Body': {'ZoneStatus': {'href': '/zone/5/status', 'Level': 100, 'SwitchedLevel': 'On', 'Zone': {'href': '/zone/5'}, 'StatusAccuracy': 'Good', 'Availability': 'Available'}}} Was not expecting message with tag 1b056b1b-ccb6-4ec1-b313-f35ceb1c2768: {'CommuniqueType': 'CreateResponse', 'Header': {'MessageBodyType': 'OneZoneStatus', 'StatusCode': '201 Created', 'Url': '/zone/6/commandprocessor'}, 'Body': {'ZoneStatus': {'href': '/zone/6/status', 'Level': 100, 'SwitchedLevel': 'On', 'Zone': {'href': '/zone/6'}, 'StatusAccuracy': 'Good', 'Availability': 'Available'}}}

Logger: homeassistant.components.automation.automation_31 Source: helpers/script.py:485 Integration: Automation (documentation, issues) First occurred: 8:18:11 PM (1 occurrences) Last logged: 8:18:11 PM

Arrive Home After Dark: Error executing script. Unexpected error for call_service at pos 3: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action return long_task.result() ^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 917, in entity_service_call raise result from None File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1540, in async_request_call return await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 628, in async_handle_light_on_service await light.async_turn_on(filter_turn_on_params(light, params)) File "/usr/src/homeassistant/homeassistant/components/switch_as_x/entity.py", line 155, in async_turn_on await self.hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/lutron_caseta/switch.py", line 56, in async_turn_on await self._smartbridge.turn_on(self.device_id) File "/usr/local/lib/python3.12/site-packages/pylutron_caseta/smartbridge.py", line 510, in turn_on await self.set_value(device_id, 100, kwargs) File "/usr/local/lib/python3.12/site-packages/pylutron_caseta/smartbridge.py", line 418, in set_value await self._request( File "/usr/local/lib/python3.12/site-packages/pylutron_caseta/smartbridge.py", line 254, in _request async with asyncio_timeout(REQUEST_TIMEOUT): File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit raise TimeoutError from exc_val TimeoutError