-
-
Notifications
You must be signed in to change notification settings - Fork 28.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tado throwing HTTP Error 422 when changing operation mode or temperature #30020
Comments
Hey there @michaelarnauts, mind taking a look at this issue as its been labeled with a integration ( |
@arttwentyfourseven I have an open PR here #29246 that fixes quite some open tado issues. Could you try this code? You can simply download the files from https://github.com/michaelarnauts/home-assistant/tree/tado-rework/homeassistant/components/tado and put them in a |
Sorry mate, still the same issue and very similar error message.
|
I would love to get this fixed! Could you increase the debug level for tado? I might find more information there. Do you also have a temperature set when you turn it on? I don't have an AC-device, so I can't test... Just add this to your configuration:
|
Today the temperature had already been set with the Tado phone app. I then restarted hassio and attempted to control the temp setting from the Overview panel. Logs below. Note that I have 2 zones, one called "Zander" and the other called "Vienna". In the logs below the zone number has been added in brackets. I'm assuming this has been done in the Python code and could be (part of) the problem if it doesn't match what the Tado API has. Just a wild guess though. 2019-12-19 21:05:01 DEBUG (SyncWorker_19) [custom_components.tado] Updating zone 1 |
I've added a few debug statements to my branch. Could you try this again? Thanks! |
Thanks Michael, Please see the logs below. I have only played with zone 2 this time:
Let me know if I can provide any further info.
|
Can you also post the capabilities debug statement (a bit higher in the log, this is printed during startup)? You can also use three backticks before and after your log to prevent line wrapping, like this: ``` becomes:
|
Hope this is what you're after.
|
Okay, everything there seems to be okay as expected. I've pushed another commit that handles the 422 errors and prints out the real error. This will hopefully make troubleshooting easier. Could you retry with my latest code? |
Please see below in 2 hunks. Do I read correctly that it want to receive a setting for fanSpeed?
|
You are correct: The code currently isn't setting the fan speed, but the library behind it also doesn't seem to support that. You said it used to work before september, maybe this changed with a firmware update? Do you also need to set your fan speed when you change your temperature with my.tado.com? If you open the development console (F12), and go to the network tab, you will find the call that it makes when you change your temperature. |
Hey Michael, I don't have to actively select the fan speed, but it is an option on the control panel (see screenshot). It simply defaults to the current setting and, looking at the dev console, then pushes it back when changing one of the settings. I have also included a screenshot of the console data below, as the hierarchy gets lost in the copy/paste. I can assist more tomorrow if needs be. Hope this will help for now.
|
Apologies, the jpg's have ended up somewhere in the middle of the console log... |
No problem. I'm afraid this is something that should be adressed in the PyTado library here: https://github.com/wmalgadey/PyTado Maybe @wmalgadey could help? |
Thanks. That code appears to have "HEATING" hard coded in the mode variable, though, which is also on a different line in the code. I'm using Hassio; do you know of a way to get the exact underlying PyTado module (the files) that's embedded in Hassio? |
@michaelarnauts I would like to help, yes. What do we need to add to the pyTado lib? |
It seems that air-conditioning unit needs to have the fan speed in the request. I can't test this myself, but the reporter gave the error and an example json that the website sends to the API. It's a few comments up. |
Fixed in #32564 |
Good Evening,
The only thing I seem to be able to do with Tado climate is switching my A/C off, changing operation to Heat/Cool or changing the target temperature result in Error 422 as below.
Running Hassio 0.103.0 on a Pi4 with DHCP, Duck DNS and SSH add-ons installed.
Note that this has never worked for me from approx. September this year.
2019-12-17 21:37:03 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2912513744] HTTP Error 422:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 205, in handle_service
self._platforms.values(), func, call, service_name, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 336, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 360, in _handle_service_platform_call
await func(entity, data)
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 519, in async_service_temperature_set
await entity.async_set_temperature(**kwargs)
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 380, in async_set_temperature
ft.partial(self.set_temperature, **kwargs)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tado/climate.py", line 335, in set_temperature
self._control_heating()
File "/usr/src/homeassistant/homeassistant/components/tado/climate.py", line 533, in _control_heating
"COOL",
File "/usr/src/homeassistant/homeassistant/components/tado/init.py", line 138, in set_zone_overlay
zone_id, overlay_mode, temperature, duration, device_type, "ON", mode
File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 287, in setZoneOverlay
data = self._apiCall(cmd, "PUT", post_data)
File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 81, in _apiCall
response = self.opener.open(req)
File "/usr/local/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/local/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 422:
2019-12-17 21:37:25 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2912513744] HTTP Error 422:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 205, in handle_service
self._platforms.values(), func, call, service_name, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 336, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 358, in _handle_service_platform_call
await getattr(entity, func)(**data)
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 405, in async_set_hvac_mode
await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tado/climate.py", line 356, in set_hvac_mode
self._control_heating()
File "/usr/src/homeassistant/homeassistant/components/tado/climate.py", line 533, in _control_heating
"COOL",
File "/usr/src/homeassistant/homeassistant/components/tado/init.py", line 138, in set_zone_overlay
zone_id, overlay_mode, temperature, duration, device_type, "ON", mode
File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 287, in setZoneOverlay
data = self._apiCall(cmd, "PUT", post_data)
File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 81, in _apiCall
response = self.opener.open(req)
File "/usr/local/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/local/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 422:
2019-12-17 21:37:34 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2912513744] HTTP Error 422:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 205, in handle_service
self._platforms.values(), func, call, service_name, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 336, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 360, in _handle_service_platform_call
await func(entity, data)
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 519, in async_service_temperature_set
await entity.async_set_temperature(**kwargs)
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 380, in async_set_temperature
ft.partial(self.set_temperature, **kwargs)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tado/climate.py", line 335, in set_temperature
self._control_heating()
File "/usr/src/homeassistant/homeassistant/components/tado/climate.py", line 533, in _control_heating
"COOL",
File "/usr/src/homeassistant/homeassistant/components/tado/init.py", line 138, in set_zone_overlay
zone_id, overlay_mode, temperature, duration, device_type, "ON", mode
File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 287, in setZoneOverlay
data = self._apiCall(cmd, "PUT", post_data)
File "/usr/local/lib/python3.7/site-packages/PyTado/interface.py", line 81, in _apiCall
response = self.opener.open(req)
File "/usr/local/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/local/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 422:
The text was updated successfully, but these errors were encountered: