Setup failed for tado

An issue has been opened:

Hi,

since then update to 0.96 I have an issue as described above - but the solution described above does not solve the problem.
I am running Hass.io on a Rpi3+ and since the update I am having problems connecting to Tado - log file error message as follows:

2019-08-02 06:57:35 ERROR (MainThread) [homeassistant.setup] Error during setup of component tado
Traceback (most recent call last):
File “/usr/local/lib/python3.7/urllib/request.py”, line 1317, in do_open
encode_chunked=req.has_header(‘Transfer-encoding’))
File “/usr/local/lib/python3.7/http/client.py”, line 1244, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/local/lib/python3.7/http/client.py”, line 1290, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “/usr/local/lib/python3.7/http/client.py”, line 1239, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “/usr/local/lib/python3.7/http/client.py”, line 1026, in _send_output
self.send(msg)
File “/usr/local/lib/python3.7/http/client.py”, line 966, in send
self.connect()
File “/usr/local/lib/python3.7/http/client.py”, line 1406, in connect
super().connect()
File “/usr/local/lib/python3.7/http/client.py”, line 938, in connect
(self.host,self.port), self.timeout, self.source_address)
File “/usr/local/lib/python3.7/socket.py”, line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File “/usr/local/lib/python3.7/socket.py”, line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 156, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
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/init.py”, line 40, in setup
tado = Tado(username, password)
File “/usr/local/lib/python3.7/site-packages/PyTado/interface.py”, line 301, in init
self._loginV2(username, password)
File “/usr/local/lib/python3.7/site-packages/PyTado/interface.py”, line 154, in _loginV2
response = self.opener.open(req)
File “/usr/local/lib/python3.7/urllib/request.py”, line 525, in open
response = self._open(req, data)
File “/usr/local/lib/python3.7/urllib/request.py”, line 543, in _open
‘_open’, req)
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 1360, in https_open
context=self._context, check_hostname=self._check_hostname)
File “/usr/local/lib/python3.7/urllib/request.py”, line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Try again>

I seem to have in general problems with 0.96 - cannot seem to connect to outside … problems arise with darksky, waze, …

Any idea what I might be doing wrong here?

Thanks!

I’m on 0.96.x and I don’t have any outside issues. Are all of your external connection attempts failing? I think I read somewhere about this version using a new version of Python that was more strict about certificate validation. It’s possible something’s gone awry there.

Can you SSH onto your PI and perform some checks there?

Ah, Certificate validation … something to look into, thanks! I have not set up any certificate for the PI yet … and it all worked before.

With regards to ssh, that is also interesting :wink:
I can ssh onto the PI with the terminal and access hassio there.
The Samba Share add-on, however, does not work since the update anymore … for some odd reason it tells me. that ipv6 (which I never used so far nor configured) is denying access. Where this comes from, I got no idea.

Interesting also: the error log for Tado refers to a photon 3.7. installation and its files - however, I cannot find any of these, when I go onto the PI via terminal and search for them.
I am not expert by far - but I was hoping until now to understand the basics, apparently I do not. I am sure it is my mistake(s!), but I don’t know where to search …

Thanks for helping!

My problem was Pi-hole - there seems to be a problem with having pi-hole on the same PI as HA, which I do. I turned Pi-hole off, and now I have outside access again … also the Samba Share works again … need to dig deeper into Pi-hole, I guess.

Good find on the Pi Hole! That could have taken a while. Are you disabling Pi Hole completely, or just pressing the disable button in the UI? It might have pulled down a bad white/black list and is being a bit over zealous on blocking.

I have two Pi Holes running on my network but on totally different VMs. Whilst I have had issues with things being blocked that shouldn’t, I certainly haven’t ever had any issues with it getting in the way of HA.

I am moving Pi-Hole with the Unifi Controller to a different Pi and perhaps move HA to a NUC - about the NUC I am not sure yet, but I will move the Pi-hole as well as the controller to a different Pi.

I guess the Pi-Hole residing on the same Pi as HA caused some IP referring issues. Interesting enough: I have before defined a static IP on the Pi and an external DNS address to HA but it did not help for some odd reason.

My HA started on a Pi, with Pi-hole running on another Pi. I have since moved both to VMs without any issue.

It sounds like you’re well on the way to getting it fixed.

Guys I have recently bought tado and I am trying to integrate it into Home Assistant but it does not work.

I cannot turn it off and I cannot switch to cool mode. When off and try to change temprature I am getting http 422
System Health

arch armv7l
dev false
docker false
hassio false
os_name Linux
python_version 3.6.5
timezone Europe/Nicosia
version 0.97.0
virtualenv true

Lovelace

mode auto-gen

HTTP Error 422:
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/websocket_api/commands.py”, line 128, in handle_call_service
connection.context(msg),
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py”, line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py”, line 1260, in _execute_service
await handler.func(service_call)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 210, in handle_service
self._platforms.values(), func, call, service_name, required_features
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 334, in entity_service_call
future.result() # pop exception if have
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 356, in _handle_service_platform_call
await getattr(entity, func)(**data)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/climate/ init .py”, line 416, in async_set_hvac_mode
await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/tado/climate.py”, line 269, in set_hvac_mode
self._control_heating()
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/tado/climate.py”, line 388, in _control_heating
self._store.set_zone_off(self.zone_id, CONST_OVERLAY_MANUAL)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/tado/ init .py”, line 135, in set_zone_off
self.tado.setZoneOverlay(zone_id, mode, None, None, “HEATING”, “OFF”)
File “/srv/homeassistant/lib/python3.6/site-packages/PyTado/interface.py”, line 287, in setZoneOverlay
data = self._apiCall(cmd, “PUT”, post_data)
File “/srv/homeassistant/lib/python3.6/site-packages/PyTado/interface.py”, line 81, in _apiCall
response = self.opener.open(req)
File “/usr/local/lib/python3.6/urllib/request.py”, line 532, in open
response = meth(req, response)
File “/usr/local/lib/python3.6/urllib/request.py”, line 642, in http_response
‘http’, request, response, code, msg, hdrs)
File “/usr/local/lib/python3.6/urllib/request.py”, line 570, in error
return self._call_chain(*args)
File “/usr/local/lib/python3.6/urllib/request.py”, line 504, in _call_chain
result = func(*args)
File “/usr/local/lib/python3.6/urllib/request.py”, line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 422:

Hi dgaust,

can you share with us the tado component for climate control?

Many thanks.

Regards,

Anyone using the smart thermostat with the new climate component (0.96+)?

It seems HA lost the ability to set the operation mode to ‘smart schedule’, which is the default schedule mode of the tado thermostat:

https://github.com/home-assistant/home-assistant/issues/25714

That would be a major loss of functionality. I’m holding off upgrades past 0.95 for this reason. The github poster might be wrong though. Any confirmation appreciated.

Yes @jeroenjoosse, the climate.set_operation_mode seems to be gone, also from the Climate component page. As a test I changed some automations to use the climate.set_hvac_mode as it seemed that Tado manages to automatically move back to Smart Schedule when hvac mode was put to Auto again. However I did not test it thoroughly though.

UnfortunatelyI have to correct myself in the post above. When using set_temperature, Tado doesn’t override it when the Smart Schedule kicks in. So is stay for ever in the set_temperature state. So @jeroenjoosse is right, this is a major functionality loss.

I can confirm that if you use climate.set_hvac_mode and set it to auto, you will get into Tado Smart Schedule. And if you use climate.set_temperature it will creat an overlay for manual mode with desired temperature. This works fine.

However, the Tado Integration doesn’t support to set hot water devices, even they are very silimar to thermostats. Viewing hot water devices works.
The reason is, that the created JSON uses for every climate.set*-service “type”:“HEATING” (except “type”:“AIR_CONDITIONING” for a/c devices) and to set an hot water device the type has to be “HOT_WATER”. So the created command results in an http error: 422, cause it uses a wrong TYPE for how water devices and the tado server refuses the command. It should be easy to fix this, however i’m not a programmer and i can’t code this fix.

I recently noticed this change for the tado component.

I have a schedule on the tado to set the temperature lower at night, and in the evening, when it’s a bit cold, I increase the temperature manually.
Previously, when the schedule change kicked in, the temperature was set to the night-temperature, but now, it stays on my chosen temperature, therefore, I heat my home during the night.

Is something working on this? Is this the intended behavior? I’m willing to spend a bit of time to look into this, but I haven’t followed the climate-rewrite of 0.96, so maybe this is intended.

Hi @michaelarnauts, I encountered the same ‘issue’, but concluded that this might be the intended behaviour. Difficulty here is that the manual override from HA is different than the manual override inside the Tado (app or device) as it expires when the Smart Schedule kicks in.
I now fixed this with the following automation that checks whether HA is controlling Tado and if the mode is set by HA (heat).

- id: climate turn off manual 
    alias: thermostat put in auto mode
    initial_state: 'on'
    trigger:
      platform: time
      at: "23:00:00"
    condition:
      condition: and
      conditions:
        - condition: state
          entity_id: input_boolean.away_mode
          state: 'off'
        - condition: state
          entity_id: climate.woonkamer
          state: 'heat'
    action:
      - service: climate.set_hvac_mode
        data:
          entity_id: climate.woonkamer
          hvac_mode: auto

This sets the mode to auto at 23h, what would probably also work, but the 23h will be defined twice, once in your automation and once in the schedule.

I was thinking of an configuration option in the tado component to set it to auto mode like in the app (where it falls back to the schedule on the next change), instead of manual mode.

@jeroenjoosse @vlamofiel @DSchumacher2104

I’ve made a merge request to change the override behaviour back to “Tado Mode” so the schedule can still change the temperature. Feel free to comment.

See https://github.com/home-assistant/home-assistant/pull/29014

1 Like

So, now after this PR, if I wanted to set a fixed temperature, like for when i’m on vacation. How do I go about and do that? All the services which I can call, seem to set tado into “until next schedule change”. There seems to be no way to set it to “just 19, until I tell you otherwise”. I apparently relied on this behaviour, and it now breaks my vacation mode.

Alternatively, I have an away mode temperature set in Tado. If there is a way to force tado into Away and Home, that’s ofcourse also a solution.

I have floor heating, so i’m not using any of the smart away/home/locationtracking features of tado, as it takes several hours to just up my house 1 degree, but I do have Home Assistant automatically putting my house in Vacation mode after i’m gone for a day or two.

Found it. An fallback, which defaults to true, was added in https://github.com/home-assistant/home-assistant/pull/29246. This says it should by default fallback to a schedule, but this can be set to false, which is available from 0.104.

1 Like