Skip to content

Fix devices request in Tado X for 0.18.x #183

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

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

karlbeecken
Copy link

Description

in Tado X, the serial number is in the serialNumber field, shortSerialNo was the field in Tado V3. This breaks API interaction with Tado X setups, because the serialNo field doesn't exist


Related Issues

none


Type of Changes

Mark the type of changes included in this pull request:

  • Bugfix
  • New Feature
  • Documentation Update
  • Refactor
  • Other (please specify):

Checklist

  • I have tested the changes locally and they work as expected.
  • I have added/updated necessary documentation (if applicable).
  • I have followed the code style and guidelines of the project.
  • I have searched for and linked any related issues.

Additional Notes

Would be awesome if this could be merged soon, it is a requirement to make the temporary fix for the Tado X HA integration work again with the new OAuth flow.


Thank you for your contribution to PyTado! 🎉

in Tado X, the serial number is in the "serialNumber" field, "shortSerialNo" was the field in Tado V3
@karlbeecken
Copy link
Author

Could we release a 0.18.10 when this is merged?

@karlbeecken karlbeecken changed the title Fix devices request in Tado X Fix devices request in Tado X for 0.18.x Mar 24, 2025
@karlbeecken
Copy link
Author

@wmalgadey @erwindouna could you maybe take a look at this? This is essentially only a backport from master (https://github.com/wmalgadey/PyTado/tree/master/PyTado/interface/api/hops_tado.py#L76), no big changes. Unfortunately, without this fix the get_devices() call for Tado X is completely broken for 0.18.x (which is the base for the HA integration right now):

In [13]: tado.get_devices()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[13], line 1
----> 1 tado.get_devices()

File ~/mine/code/python-tado/PyTado/interface/api/hops_tado.py:65, in TadoX.get_devices(self)
     63     request = TadoXRequest()
     64     request.domain = Domain.DEVICES
---> 65     request.device = device["serialNo"]
     66     device.update(self._http.request(request))
     68 if "otherDevices" in rooms_and_devices:

KeyError: 'serialNo'

@erwindouna
Copy link
Collaborator

Looks good to me. Would this also be Home Assistant compatible?

@karlbeecken
Copy link
Author

@erwindouna Yes, I tested the changes both with tado V3 and tado X (latter of which of course still doesn't work in HA without any further changes). It is also compatible with the patches from last year for rudimentary tado X support in the HA core integration, which I updated based on your OAuth changes: https://github.com/karlbeecken/ha-core/tree/tado-oauth-deviceflow/homeassistant/components/tado

@polamoros
Copy link

Hey,
what is missing to be able to merge this PR?

thanks for working on this karlbeecken!

@wmalgadey wmalgadey merged commit e20f4d8 into wmalgadey:support/0.18 Mar 26, 2025
4 of 6 checks passed
@arwindersingh82
Copy link

@erwindouna Yes, I tested the changes both with tado V3 and tado X (latter of which of course still doesn't work in HA without any further changes). It is also compatible with the patches from last year for rudimentary tado X support in the HA core integration, which I updated based on your OAuth changes: https://github.com/karlbeecken/ha-core/tree/tado-oauth-deviceflow/homeassistant/components/tado

Has this been merged down now with the new release or do we still need the custom component?

@jgpazos70
Copy link

@erwindouna Yes, I tested the changes both with tado V3 and tado X (latter of which of course still doesn't work in HA without any further changes). It is also compatible with the patches from last year for rudimentary tado X support in the HA core integration, which I updated based on your OAuth changes: https://github.com/karlbeecken/ha-core/tree/tado-oauth-deviceflow/homeassistant/components/tado

Has this been merged down now with the new release or do we still need the custom component?

I have the same question, made upgrade 2025.4 and not working integration. Error:

Logger: homeassistant.components.tado.coordinator
Source: helpers/update_coordinator.py:380
integration: Tado (documentation, issues)
First occurred: 8:54:30 PM (2 occurrences)
Last logged: 9:05:30 PM

Unexpected error fetching tado data
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 380, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tado/coordinator.py", line 91, in _async_update_data
self.devices = await self.hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._tado.get_devices
^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.13/site-packages/PyTado/interface/api/hops_tado.py", line 65, in get_devices
request.device = device["serialNo"]
~~~~~~^^^^^^^^^^^^
KeyError: 'serialNo'

I have only Tado X.

@erwindouna
Copy link
Collaborator

@wmalgadey can we bring this in, along with: #189?

@jgpazos70
Copy link

@erwindouna Yes, I tested the changes both with tado V3 and tado X (latter of which of course still doesn't work in HA without any further changes). It is also compatible with the patches from last year for rudimentary tado X support in the HA core integration, which I updated based on your OAuth changes: https://github.com/karlbeecken/ha-core/tree/tado-oauth-deviceflow/homeassistant/components/tado

Has this been merged down now with the new release or do we still need the custom component?

I have the same question, made upgrade 2025.4 and not working integration. Error:

Logger: homeassistant.components.tado.coordinator Source: helpers/update_coordinator.py:380 integration: Tado (documentation, issues) First occurred: 8:54:30 PM (2 occurrences) Last logged: 9:05:30 PM

Unexpected error fetching tado data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 380, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tado/coordinator.py", line 91, in _async_update_data self.devices = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ self._tado.get_devices ^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.13/site-packages/PyTado/interface/api/hops_tado.py", line 65, in get_devices request.device = device["serialNo"] ~~~~~~^^^^^^^^^^^^ KeyError: 'serialNo'

I have only Tado X.

Downloading https://github.com/karlbeecken/ha-core/tree/tado-oauth-deviceflow/homeassistant/components/tado as custom_component and reinstalling Tado integration did not work also.

@jgpazos70
Copy link

@erwindouna Yes, I tested the changes both with tado V3 and tado X (latter of which of course still doesn't work in HA without any further changes). It is also compatible with the patches from last year for rudimentary tado X support in the HA core integration, which I updated based on your OAuth changes: https://github.com/karlbeecken/ha-core/tree/tado-oauth-deviceflow/homeassistant/components/tado

Has this been merged down now with the new release or do we still need the custom component?

I have the same question, made upgrade 2025.4 and not working integration. Error:
Logger: homeassistant.components.tado.coordinator Source: helpers/update_coordinator.py:380 integration: Tado (documentation, issues) First occurred: 8:54:30 PM (2 occurrences) Last logged: 9:05:30 PM
Unexpected error fetching tado data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 380, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tado/coordinator.py", line 91, in _async_update_data self.devices = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ self._tado.get_devices ^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.13/site-packages/PyTado/interface/api/hops_tado.py", line 65, in get_devices request.device = device["serialNo"] ~~~~~~^^^^^^^^^^^^ KeyError: 'serialNo'
I have only Tado X.

Downloading https://github.com/karlbeecken/ha-core/tree/tado-oauth-deviceflow/homeassistant/components/tado as custom_component and reinstalling Tado integration did not work also.

Solved copying contents of
https://github.com/karlbeecken/ha-core/tree/tado-oauth-deviceflow/homeassistant/components/tado

inside
/usr/src/homeassistant/homeassistant/components/tado

(followed this instructions: https://community.home-assistant.io/t/guide-transfer-files-to-components-folder/413272)

@wmalgadey
Copy link
Owner

@wmalgadey can we bring this in, along with: #189?

it should have been merged already to support/0.18. I will check, why this is not working anymore.

wmalgadey added a commit that referenced this pull request Apr 3, 2025
@wmalgadey
Copy link
Owner

@erwindouna and @jgpazos70 the change got somehow reverted in 0.18.x

I just made the change again an will create a 0.18.12 to be used in HA again

@wmalgadey
Copy link
Owner

@karlbeecken
Copy link
Author

@wmalgadey I am not sure, but it seems you reverted the fix again? 😅
https://github.com/wmalgadey/PyTado/blob/support/0.18/PyTado/interface/api/hops_tado.py#L65
Should be serialNumber, you reverted it to serialNo (wrong!) in c9070ea

@wmalgadey
Copy link
Owner

I am confused! where did the error from jgpazos70 commented 2 days ago did come from? which version was used there?

I will implement the solution from current master branch, it should be compatible in either way.

wmalgadey added a commit that referenced this pull request Apr 4, 2025
@wmalgadey
Copy link
Owner

@karlbeecken I just pushed the current implementation of tadox from master to support/0.18, bevor I create another useless release, would somebody mind taking a test here with this version?

@karlbeecken
Copy link
Author

I am confused! where did the error from jgpazos70 commented 2 days ago did come from? which version was used there?

I will implement the solution from current master branch, it should be compatible in either way.

I think that might be because HA didn't bump to the latest release yet? If I recall correctly, they are still on 0.18.9 for HA 2025.4.

I can test with the current 0.18 branch in the evening.

@erwindouna
Copy link
Collaborator

A RP to merge in version 0.18.11 has been approved and will be added shortly.

@karlbeecken
Copy link
Author

@wmalgadey I just tested latest from the 0.18 branch, works with Tado X and V3.

@wmalgadey
Copy link
Owner

Ok, will release it as 0.18.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants