home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.27k stars 29.86k forks source link

Unable to connect Tado bridge as HomeKit climate device #16971

Closed luukdobber closed 5 years ago

luukdobber commented 5 years ago

Home Assistant release with the issue: 0.79.0

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io

Component/platform: https://www.home-assistant.io/components/climate.homekit_controller/

Description of problem: I am trying to add my Tado bridge to Home Assistant using the homekit_controller component. This would allow me to have offline control for my heating instead of using the tado API. Home Assistant throws an error when I try to pair the bridge in the UI. This is what I did:

  1. Reset HomeKit on the tado bridge so it's not connected to my iPad anymore. The devices disappeared from the Home app, so this seems to have worked.
  2. Add HomeKit discovery to my configuration.yaml and restart HA.
  3. Click "configure" on the "tado Internet Bridge" item in the UI.
  4. Enter the HomeKit code from the sticker on the bridge and click submit.

After a while the dialog closes end the stacktrace mentioned below appeared in the logs.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

discovery:
  enable:
    - homekit

Traceback (if applicable):

Error executing service <ServiceCall configurator.configure (c:53514ee038d142deafe498967e874b70): configure_id=1825889744-2, fields=code=<<HomeKit code from sticker on device>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/configurator.py", line 224, in async_handle_service_call
    call.data.get(ATTR_FIELDS, {}))
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/homekit_controller/__init__.py", line 146, in device_config_callback
    pairing_id)
  File "/usr/local/lib/python3.6/site-packages/homekit/protocol.py", line 69, in perform_pair_setup
    connection.request('POST', '/pair-setup', request_tlv, headers)
  File "/usr/local/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1250, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/local/lib/python3.6/http/client.py", line 1108, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent

Additional information:

jimz011 commented 5 years ago

I have integrated everything in HA now, all is working perfectly fine. I also checked the .storage for that file. I have it as well. Thanks again for this great work.

robertwebbe commented 5 years ago

Guys, I just started using Home Assistant (0.91.4) yesterday on a Raspberry Pi. And bumped to the same issue with my tado. I'm not that technical with Linux that I do what you guys did. Can you tell me when it will be possible for standard users to have this new version?

jimz011 commented 5 years ago

It is on rc (beta) channel right now. Usually it should drop next week. But probably no longer than 2 weeks.

robertwebbe commented 5 years ago

Okay, thanks for the super quick reply. I'm not that patient so I'll have to learn myself how to update to the rc version than. :) I've found out the console access, logged in as root and typed hassio homeassistant update

But I guess that's updating to the latest production version. If it's simple as that to update to the rc version, can you please tell me how to do that?

jimz011 commented 5 years ago

I don’t use hassio, but I guess update process is similar if not the same but the normal way to do it is:

$ pip3 install --pre --upgrade homeassistant

You will also need the following as it is not yet in rc (as far as I know)

https://github.com/home-assistant/home-assistant/issues/16971#issuecomment-484426388

You said you are not very patient, but running an rc version might require a lot of it :P. As it is a beta version things might not work at all or not the way you might expect it to work. If you know your way around you can work around these issues most of the time however running the rc branch is not recommended if you do not know what you are doing.

Though it is easy to revert back to an older version of HA.

robertwebbe commented 5 years ago

Then I guess it's better to grow some patience and wait for the stable production version. I'm quit new to this and too much things not working properly gets very confusing. Maybe later when I'm more experience. Thanks a lot for your help @jimz011 !

jimz011 commented 5 years ago

Well I have learned that patience gets you a long way with Home Assistant. This piece of art gets updated a lot (almost every 2 weeks) and many things get fixed and/or changed which in turn might break existing configurations.

For me not a big deal as I have fun with it, but if you are looking for something more stable you might need to look at OpenHAB (though new features are lacking as it gets updated only twice a year).

If you are looking for ideas you can look at my repo screenshots can be found here:

https://community.home-assistant.io/t/lovelace-by-jimzz011-ha-0-91-x-compatible/

Jc2k commented 5 years ago

Just opened #23562. This should hopefully allow tado users to pair and use their climate devices. There are some other homekit_controller climate changes queued up, hopefully they can all squeeze into 0.93, but currently out of my hands.

Jc2k commented 5 years ago

If people following this ticket are compfortable running the rc branch of HA i'd be interested to know how 0.93.0b2 works with tado. It should have all the fixes discussed in this ticket.

cf00 commented 5 years ago

I upgraded to the latest dev version (shown as 0.94.0.dev0; there is no docker image for 0.93.0b2 available) and I am happy to report that everything seems to work now out of the box. The thermostats show up, I can control the devices, nothing unusual in the logs or console (I didn't test pairing).