Open Tazmanian79 opened 1 month ago
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (websocket_api
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
websocket_api documentation websocket_api source (message by IssueLinks)
Hey there @chiefdragon, @erwindouna, mind taking a look at this issue as it has been labeled with an integration (tado
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
tado documentation tado source (message by IssueLinks)
By any chance that one of the following devices are no longer available or specifically called as mentioned in your list?
The code referenced in your logging is wrapped in a try-catch, so I would expect to see the error being triggered properly in your trace. Are you sure you're on the latest version of HA? :)
def update_zones(self):
"""Update the zone data from Tado."""
try:
zone_states = self.tado.get_zone_states()["zoneStates"]
except RuntimeError:
_LOGGER.error("Unable to connect to Tado while updating zones")
return
for zone in zone_states:
self.update_zone(int(zone))
Yes I'm using the latest version. (just before october release). Now on latest release again.
When I first noticed this error I hve reloaded the integration. And deleted all entities from the script and added them again, just to be sure. So yes all devices are available.
EDIT: just ran the script again and didn't log any error anymore. Strange. Maybe update to 10.0 solved the issue ;-)
Feel free to test it a few times. When its structurally resolved, please close this issue. :)
I tried to run the scrip again but now same error:
`Logger: homeassistant.components.script.verwarming_afwezig Bron: helpers/script.py:525 integratie: Script (documentatie, problemen) Eerst voorgekomen: 18:28:41 (1 gebeurtenissen) Laatst gelogd: 18:28:41
Verwarming afwezig: Error executing script. Unexpected error for call_service at pos 2: 'zoneStates' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1021, in entity_service_call raise result from None File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1610, in async_request_call return await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 800, in async_handle_set_preset_mode_service await self.async_set_preset_mode(preset_mode) File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 808, in async_set_preset_mode await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tado/climate.py", line 435, in set_preset_mode self._tado.set_presence(preset_mode) File "/usr/src/homeassistant/homeassistant/components/tado/tado_connector.py", line 248, in set_presence self.update_zones() File "/usr/src/homeassistant/homeassistant/components/tado/tado_connector.py", line 177, in update_zones zone_states = self.tado.get_zone_states()["zoneStates"]
KeyError: 'zoneStates'`
`Logger: homeassistant.components.websocket_api.http.connection
Bron: components/websocket_api/commands.py:245
integratie: Home Assistant WebSocket API ([documentatie](https://www.home-assistant.io/integrations/websocket_api), [problemen](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
Eerst voorgekomen: 18:28:41 (1 gebeurtenissen)
Laatst gelogd: 18:28:41
[139902849427360] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 718, in _service_handler
response = await self._async_start_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 674, in _async_start_run
script_result = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 707, in _async_run
return await self.script.async_run(script_vars, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1795, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1021, in entity_service_call
raise result from None
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1610, in async_request_call
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 800, in async_handle_set_preset_mode_service
await self.async_set_preset_mode(preset_mode)
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 808, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tado/climate.py", line 435, in set_preset_mode
self._tado.set_presence(preset_mode)
File "/usr/src/homeassistant/homeassistant/components/tado/tado_connector.py", line 248, in set_presence
self.update_zones()
File "/usr/src/homeassistant/homeassistant/components/tado/tado_connector.py", line 177, in update_zones
zone_states = self.tado.get_zone_states()["zoneStates"]
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'zoneStates'`
![Schermafbeelding 2024-10-04 183630](https://github.com/user-attachments/assets/103e4649-3215-4ad6-9567-53caeecc36e1)
EDIT.
But then when I run it again some time later it runs without any errors
![2de](https://github.com/user-attachments/assets/fae643f9-cb63-494f-a2f8-10b688f8702c)
Any update on this issue?
Can you check if all these zones actually exists? The only thing I can think of, is that there's no zone found. Hence, this is what could trigger the try except.
Yes all zones exists .... I even removed the integration and re-added to be sure. But still gives me this error.
Does it turn off the integration or put it in a disabled state somewhere?
no it does not. It very basic script that runs when leaving the house. But the error is not always there. I'm testing it right now ran it 3 times no error at all.
On which version are you currently running? I run on the latest and when I ran it a few times I had no issues.
The only thing I can think of, is that the devices are put in a disabled state and therefore their backend call results in a false results from the API.
I ran it a few times (only the script) and now it doesn't give any error. Will check it next time while the whole automation runs.
Keep you posted.
The problem
I have a script running to change the heating when I'm home or leave. It used to work last winter. Actually it's still working but every time I run the script that I'm away I get an error:
THE ERRORS:
AND
It's only when I have the script running when I'm leaving. When I get back home there is no issue.
This is the script
What version of Home Assistant Core has the issue?
10.09.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Tado
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tado
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response