Skip to content
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

HomeKit Controller Climate can't pair with ecobee #15336

Closed
raccettura opened this issue Jul 7, 2018 · 142 comments
Closed

HomeKit Controller Climate can't pair with ecobee #15336

raccettura opened this issue Jul 7, 2018 · 142 comments

Comments

@raccettura
Copy link
Contributor

raccettura commented Jul 7, 2018

Home Assistant release with the issue:

0.73.0

Last working Home Assistant release (if known):
New component

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

Ubuntu 16.04
Component/platform:

HomeKit Climate

Description of problem:
Two thermostats show up to configure, opening them prompts for code, however thermostat isn't being triggered to show code.

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

discovery:
  enable:
    - homekit

Traceback (if applicable):


Additional information:
No errors or anything interesting in logs.

@raccettura
Copy link
Contributor Author

I tried debugging again with:

logger:
  default: warning
  logs:
    homeassistant.components.homekit: debug
    pyhap: debug

I also tried powering down one thermostat, in case that part of my setup was causing this not to work. Even with 1 thermostat, the configure button never caused the ecobee to display a pairing code.

@ghost
Copy link

ghost commented Jul 20, 2018

I'm having this issue as well on Home Assistant 0.74 on Raspberry Pi 3, but I also do not see the prompts to enter a code.

@raccettura
Copy link
Contributor Author

I noticed 0.74 updated HomeKit in #15502 so I gave it another try, but no change.

@idfxken
Copy link

idfxken commented Aug 10, 2018

to better debug use:
homeassistant.components.homekit_controller: debug
homeassistant.components.climate: debug

the one you're using is for the homekit component, not homekit_controller ;)

@raccettura
Copy link
Contributor Author

You are correct. Tried updating... nothing shows up in the logs that's relevant to homekit. As far as I can tell it never sends anything to the device to trigger it to show the pairing code.

@idfxken
Copy link

idfxken commented Aug 12, 2018

With those debug flags you should be seeing something like:
Discovered device xx:xx:xx:xx:xx:xx

Is it paired with a iPhone/ tablet? Try resetting homekit on the ecobee, it can only pair with 1 device.

@raccettura
Copy link
Contributor Author

raccettura commented Aug 12, 2018

Neither thermostat is paired with anything (ever).

I see it showing it discovered two thermostats on startup. When I click configure it shows no additional debug.

@idfxken
Copy link

idfxken commented Aug 12, 2018

Have you tried entering a random/ wrong code? It can happen that After entering wrong code . it Will show the right code on the ecobee... This is the way on a lyric thermostat

@raccettura
Copy link
Contributor Author

I have. Neither thermostat ever shows a code.

If I try and pair with my phone or tablet, it prompts with a code. Then I cancel and try pairing with Home Assistant, and nothing.

@raccettura
Copy link
Contributor Author

I thought it might just be getting confused with two ecobee thermostats, so I tried disconnecting one... but no change, so I don't think that's the culprit.

@ghost
Copy link

ghost commented Aug 13, 2018

After looking a bit, I believe Home Assistant uses HomeKit Python here: https://github.com/jlusiardi/homekit_python

I tested using it directly from the CLI with python3 -m homekit.discover, but it could not even detect my Ecobee device at all. It discovers other HomeKit devices just fine though; just not Ecobee.

With that, I'm believing that the issue probably lies with the HomeKit Python implementation rather than necessarily Home Assistant itself.

@raccettura
Copy link
Contributor Author

So something is up... it does detect my thermostats:
screen shot 2018-08-13 at 11 00 58 pm

So that parts working. It's when I try to configure them, I never get the prompt on the thermostats with the code.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@wes-warner
Copy link

wes-warner commented Nov 14, 2018

I appear to have the same problem. Only twice, out of many attempts did my ecobee3 display a PIN during discovery. Neither attempt to configure with the pin succeeded.
In the log I see this:

'018-11-14 15:40:33 INFO (MainThread) [homeassistant.components.discovery] Found new service: homekit {'properties': {'sh': 'rp34aA==', 'MFG': 'ecobee Inc.', 'sf': '1', 'md': 'ecobee3', 'pv': '1.1', 'id': '44:61:32:ED:31:C1', 's#': '1', 'serial_number': '316537030666', 'ci': '9', 'c#': '6', 'ff': '1'}, 'port': 1200, 'name': 'Home1', 'hostname': 'Home1.local.', 'host': '192.168.10.117'}'

Which makes sense to me.
When I attempt to configure with (I think) or without (mostly) the ecobee displaying a PIN the log shows:

Error executing service <ServiceCall configurator.configure (c:505b471f7433486ca9b1acfdd05d1bd4): fields=, configure_id=1716039024-1>
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
    await service_handler.func(service_call)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/configurator.py", line 221, in async_handle_service_call
    call.data.get(ATTR_FIELDS, {}))
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit_controller/__init__.py", line 187, in device_config_callback
    code = callback_data.get('code').strip()
AttributeError: 'NoneType' object has no attribute 'strip'

Help appreciated.

Wes

@wes-warner
Copy link

Re post above:
Pi2B, Hassbian, HA 0.82.0

@wes-warner
Copy link

Still unable to configure my ecobee3 via Homekit-controller. HA 0.85.1, on RP2B Hassbian, latest update.

Learned today that if wife clicks Submit on the Configure pop-up, after a 10 second or so delay, I get a PIN display on the ecobee3 for a brief flash, a second or so duration. I did a video with my phone and was able to read the 8 digit PIN. It still does not work, and nothing is logged.

@Dragonpark
Copy link

I am experiencing the same issue when attempting to use the HomeKit Controller component. I am using HassOS with HA 0.85.1.
I see the following lines logged:
2019-01-23 16:45:47 DEBUG (SyncWorker_1) [homeassistant.components.homekit_controller] Discovered unique device F9:D9:21:5C:XX:XX 2019-01-23 16:45:47 INFO (SyncWorker_1) [homeassistant.components.homekit_controller] Setting up Homekit device ecobee4

The discovered MAC address isn't even a device on my network, so I'm not sure where that is coming from. I am able to get the Ecobee to show a code, however those codes never work.

@Jc2k
Copy link
Member

Jc2k commented Feb 3, 2019

Hey guys - i've been done some work on homekit_controller recently and could try and look at this if there is someone on a UKish timezone willing to help (I don't have one of these devices to test so you'll have to be my eyes and ears).

@wes-warner
Copy link

wes-warner commented Feb 3, 2019 via email

@Jc2k
Copy link
Member

Jc2k commented Feb 4, 2019

Hi @wes-warner

So I've never had to look too much at the pairing code before, I think the underlying library has never had to deal with an accessory that displays its own codes. I think both I and the author only have devices that have static codes (like this). It sounds in the spec like on devices with displays these codes might change every time as well - can you confirm the code changes every time you see it?

I've noticed when testing changes with my iPhone that it sends its M1 request (section 4.7.1, page 39) at the point just before an iPhone is asking you to enter a code. Whereas the homekit library and thus HA send it right before using your setup code that you already entered. On an iPhone, no other requests are sent until you've entered a code. So I think the M1 request might trigger the display. Yep, the docs seem to confirm that in 4.7.2 SRP Start Response on page 40. Doesn't let you control how long that request is valid for or how long to show anything on the screen, though.

So I suspect what happens:

  • You enter a random (or old) setup code
  • HA sends a M1 Pair Setup request
  • Ecobee triggers the display as part of its M2 response
  • HA sends a M3 SRP Verify Request and that never matches the code that was briefly shown
  • The pairing attempt is over, so the screen returns to normal

Even if you do see the code, the code is now invalid and you are back to square one.

And we need to change that flow to:

  • HA sends a M1 Pair Setup request
  • Ecobee triggers the display as part of its M2 response
  • You enter the code on the screen
  • HA sends a M3 SRP Verify Request and now it matches
  • The pairing attempt is over, so the screen returns to normal

I want to see if this is right so step 1 will be to make a branch of homekit that asks for a password at the last possible moment. I'll be back when I have something...

@wes-warner
Copy link

wes-warner commented Feb 4, 2019 via email

@Jc2k
Copy link
Member

Jc2k commented Feb 4, 2019

OK - i've put together a proof of concept where it sends a pair setup command to the device and then prompts you to enter the pin code, rather than requiring it up front. This is a bit of a hack, just to see if its enough to get the ecobee working.

Here's a shell session showing it working from a Mac against a mock homekit device. Should work on Debian/Ubuntu/Raspbian without much problem. Can you follow allong and see how it works for you?

$ python3 -m venv venv
$ source venv/bin/activate

$ pip install https://github.com/Jc2k/homekit_python/archive/ecobee.zip
Collecting https://github.com/Jc2k/homekit_python/archive/ecobee.zip
  Downloading https://github.com/Jc2k/homekit_python/archive/ecobee.zip
     \ 1.4MB 800kB/s
Collecting zeroconf (from homekit==0.12.2)
  Using cached https://files.pythonhosted.org/packages/d2/4e/3e751bc1f33d0368bdba509a140cb9f2e54cd1cfb8ebcf4ebd8a5eef794b/zeroconf-0.21.3-py2.py3-none-any.whl
Collecting hkdf (from homekit==0.12.2)
Collecting ed25519 (from homekit==0.12.2)
Collecting cryptography (from homekit==0.12.2)
  Downloading https://files.pythonhosted.org/packages/d7/9e/12bb10fd009b0146935c169cc0e1e86221eacf8dc207990d54b783c47a7d/cryptography-2.5-cp34-abi3-macosx_10_6_intel.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 1.3MB/s 
Collecting ifaddr (from zeroconf->homekit==0.12.2)
Collecting asn1crypto>=0.21.0 (from cryptography->homekit==0.12.2)
  Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting six>=1.4.1 (from cryptography->homekit==0.12.2)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting cffi!=1.11.3,>=1.8 (from cryptography->homekit==0.12.2)
  Using cached https://files.pythonhosted.org/packages/0b/ba/32835c9965d8a0090723e1d0b47373365525c4bd08c807b5efdc9fecbc99/cffi-1.11.5-cp37-cp37m-macosx_10_9_x86_64.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography->homekit==0.12.2)
Installing collected packages: ifaddr, zeroconf, hkdf, ed25519, asn1crypto, six, pycparser, cffi, cryptography, homekit
  Running setup.py install for homekit ... done
Successfully installed asn1crypto-0.24.0 cffi-1.11.5 cryptography-2.5 ed25519-1.4 hkdf-0.0.3 homekit-0.12.2 ifaddr-0.1.6 pycparser-2.19 six-1.12.0 zeroconf-0.21.3
You are using pip version 10.0.1, however version 19.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

$ python -m homekit.discover
Name: DemoAccessory._hap._tcp.local.
Url: http_impl://10.0.1.11:8082
Configuration number (c#): 39
Feature Flags (ff): Paired (Flag: 0)
Device ID (id): 10:30:10:00:00:00
Model Name (md): DemoAccessory
Protocol Version (pv): 1.0
State Number (s#): 1
Status Flags (sf): 1
Category Identifier (ci): Lightbulb (Id: 5)

$ echo '{}' > pairing.json

$ python -m homekit.pair -d 10:30:10:00:00:00 -f pairing.json -a ecobee
Enter your setup code: 031-45-154
Pairing for ecobee was established.

$ python -m homekit.get_accessories -f pairing.json -a "ecobee"
1.2: >accessory-information<
  1.3:  (Identify) >identify< [pw]
  1.4: lusiardi.de (Manufacturer) >manufacturer< [pr]
  1.5: Demoserver (Model) >model< [pr]
  1.6: Testlicht (Name) >name< [pr]
  1.7: 0001 (Serial Number) >serial-number< [pr]
  1.8: 0.1 (Firmware Revision) >firmware.revision< [pr]
1.9: >lightbulb<
  1.10: False (Switch state (on/off)) >on< [pw,pr,ev]

$ python -m homekit.unpair -f pairing.json -a ecobee
Pairing for ecobee was removed.

@wes-warner
Copy link

wes-warner commented Feb 4, 2019 via email

@wes-warner
Copy link

This time without word wrapping

$ pip install https://github.com/Jc2k/homekit_python/archive/ecobee.zip
Collecting https://github.com/Jc2k/homekit_python/archive/ecobee.zip
Downloading https://github.com/Jc2k/homekit_python/archive/ecobee.zip
| 1.5MB 8.9MB/s
Collecting cryptography (from homekit==0.12.2)
Downloading https://www.piwheels.org/simple/cryptography/cryptography-2.5-cp35-cp35m-linux_armv7l.whl (865kB)
100% |????????????????????????????????| 870kB 189kB/s
Collecting ed25519 (from homekit==0.12.2)
Downloading https://www.piwheels.org/simple/ed25519/ed25519-1.4-cp35-cp35m-linux_armv7l.whl (142kB)
100% |????????????????????????????????| 143kB 442kB/s
Collecting hkdf (from homekit==0.12.2)
Downloading https://www.piwheels.org/simple/hkdf/hkdf-0.0.3-py3-none-any.whl
Collecting zeroconf (from homekit==0.12.2)
Downloading https://files.pythonhosted.org/packages/d2/4e/3e751bc1f33d0368bdba509a140cb9f2e54cd1cfb8ebcf4ebd8a5eef794b/zeroconf-0.21.3-py2.py3-none-any.whl
Collecting six>=1.4.1 (from cryptography->homekit==0.12.2)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting cffi!=1.11.3,>=1.8 (from cryptography->homekit==0.12.2)
Downloading https://www.piwheels.org/simple/cffi/cffi-1.11.5-cp35-cp35m-linux_armv7l.whl (304kB)
100% |????????????????????????????????| 307kB 381kB/s
Collecting asn1crypto>=0.21.0 (from cryptography->homekit==0.12.2)
Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
100% |????????????????????????????????| 102kB 963kB/s
Collecting ifaddr (from zeroconf->homekit==0.12.2)
Downloading https://www.piwheels.org/simple/ifaddr/ifaddr-0.1.6-py3-none-any.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography->homekit==0.12.2)
Downloading https://www.piwheels.org/simple/pycparser/pycparser-2.19-py2.py3-none-any.whl (111kB)
100% |????????????????????????????????| 112kB 340kB/s
Installing collected packages: six, pycparser, cffi, asn1crypto, cryptography, ed25519, hkdf, ifaddr, zeroconf, homekit
Running setup.py install for homekit ... done
Successfully installed asn1crypto-0.24.0 cffi-1.11.5 cryptography-2.5 ed25519-1.4 hkdf-0.0.3 homekit-0.12.2 ifaddr-0.1.6 pycparser-2.19 six-1.12.0 zeroconf-0.21.3
(venv) pi@hassbian:~ $

(venv) pi@hassbian:~ $ python -m homekit.discover
Name: HomeW._hap._tcp.local.
Url: http_impl://192.168.10.118:1200
Configuration number (c#): 9
Feature Flags (ff): Supports Pairing (Flag: 1)
Device ID (id): C3:0F:19:BF:2C:39
Model Name (md): ecobee3
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): 1
Category Identifier (ci): Thermostat (Id: 9)

(venv) pi@hassbian:~ $ echo '{}' > pairing.json
(venv) pi@hassbian:~ $ python -m homekit.pair -d C3:0F:19:BF:2C:39 -f pairing.json -a ecobee3
Enter your setup code: 242-43-120
/home/pi/venv/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/x25519.py:35: CryptographyDeprecationWarning: public_bytes now requires encoding and format arguments. Support for calling without arguments will be removed in cryptography 2.7
utils.DeprecatedIn25,
Pairing for ecobee3 was established.
(venv) pi@hassbian:~ $

(venv) pi@hassbian:~ $ python -m homekit.get_accessories -f pairing.json -a "ecobee3"
/home/pi/venv/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/x25519.py:35: CryptographyDeprecationWarning: public_bytes now requires encoding and format arguments. Support for calling without arguments will be removed in cryptography 2.7
utils.DeprecatedIn25,
1.1: >accessory-information<
1.2: HomeW () >name< [pr]
1.3: ecobee Inc. () >manufacturer< [pr]
1.4: 316537030666 () >serial-number< [pr]
1.5: ecobee3 () >model< [pr]
1.6: () >identify< [pw]
1.8: 4.2.394 () >firmware.revision< [pr]
1.9: 0 () >accessory-properties< [pr,ev]
1.30: >Unknown Service: A2<
1.31: 1.1.0 () >version< [pr]
1.16: >thermostat<
1.17: 0 () >heating-cooling.current< [pr,ev]
1.18: 1 () >heating-cooling.target< [pr,pw,ev]
1.19: 22.2 () >temperature.current< [pr,ev]
1.20: 22.2 () >temperature.target< [pr,pw,ev]
1.21: 1 () >temperature.units< [pr,pw,ev]
1.22: 24.4 () >temperature.cooling-threshold< [pr,pw,ev]
1.23: 22.2 () >temperature.heating-threshold< [pr,pw,ev]
1.24: 31.0 () >relative-humidity.current< [pr,ev]
1.25: 36.0 () >relative-humidity.target< [pr,pw,ev]
1.27: HomeW () >name< [pr]
1.33: 0 () >Unknown Characteristic B7DDB9A3-54BB-4572-91D2-F1F5B0510F8C< [pr,ev]
1.34: 22.2 () >Unknown Characteristic E4489BBC-5227-4569-93E5-B345E3E5508F< [pr,pw,ev]
1.35: 24.4 () >Unknown Characteristic 7D381BAA-20F9-40E5-9BE9-AEB92D4BECEF< [pr,pw,ev]
1.36: 17.8 () >Unknown Characteristic 73AAB542-892A-4439-879A-D2A883724B69< [pr,pw,ev]
1.37: 27.8 () >Unknown Characteristic 5DA985F0-898A-4850-B987-B76C6C78D670< [pr,pw,ev]
1.38: 18.9 () >Unknown Characteristic 05B97374-6DC0-439B-A0FA-CA33F612D425< [pr,pw,ev]
1.39: 26.7 () >Unknown Characteristic A251F6E7-AC46-4190-9C5D-3D06277BDF9F< [pr,pw,ev]
1.40: () >Unknown Characteristic 1B300BC2-CFFC-47FF-89F9-BD6CCF5F2853< [pw]
1.41: 2014-01-03T00:00:00-05:00 () >Unknown Characteristic 1621F556-1367-443C-AF19-82AF018E99DE< [pr,pw,ev]
1.48: () >Unknown Characteristic FA128DE6-9D7D-49A4-B6D8-4E4E234DEE38< [pw]
1.49: 1 () >Unknown Characteristic 4A6AE4F6-036C-495D-87CC-B3702B437741< [pr,ev]
1.50: 0 () >Unknown Characteristic DB7BF261-7042-4194-8BD1-3AA22830AEDD< [pr,ev]
1.51: False () >Unknown Characteristic 41935E3E-B54D-42E9-B8B9-D33C6319F0AF< [pr,ev]
1.52: 0 () >Unknown Characteristic C35DA3C0-E004-40E3-B153-46655CDD9214< [pr,pw,ev]
1.53: 0 () >Unknown Characteristic 48F62AEC-4171-4B4A-8F0E-1EEB6708B3FB< [pr,ev]
1.54: Your ecobee3 thermostat is now paired with HomeKit. () >Unknown Characteristic 1B1515F2-CC45-409F-991F-C480987F92C3< [pr,ev]
1.56: >motion<
1.28: HomeW () >name< [pr]
1.66: True () >motion-detected< [pr,ev]
1.67: 190 () >Unknown Characteristic BFE61C70-4A40-11E6-BDF4-0800200C9A66< [pr,ev]
1.57: >occupancy<
1.29: HomeW () >name< [pr]
1.65: 1 () >occupancy-detected< [pr,ev]
1.68: 190 () >Unknown Characteristic A8f798E0-4A40-11E6-BDF4-0800200C9A66< [pr,ev]
2.1: >accessory-information<
2.2049: Kitchen () >name< [pr]
2.2050: ecobee Inc. () >manufacturer< [pr]
2.2051: GY6X () >serial-number< [pr]
2.2052: REMOTE SENSOR () >model< [pr]
2.8: 1.0.0 () >firmware.revision< [pr]
2.2053: () >identify< [pw]
2.55: >temperature<
2.2064: 21.4 () >temperature.current< [pr,ev]
2.2067: Kitchen () >name< [pr]
2.2066: True () >status-active< [pr,ev]
2.2065: 0 () >status-lo-batt< [pr,ev]
2.56: >motion<
2.2060: True () >motion-detected< [pr,ev]
2.2063: Kitchen () >name< [pr]
2.2062: True () >status-active< [pr,ev]
2.2061: 0 () >status-lo-batt< [pr,ev]
2.2059: 955 () >Unknown Characteristic BFE61C70-4A40-11E6-BDF4-0800200C9A66< [pr,ev]
3.1: >accessory-information<
3.3073: Pourch () >name< [pr]
3.3074: ecobee Inc. () >manufacturer< [pr]
3.3075: D36S () >serial-number< [pr]
3.3076: REMOTE SENSOR () >model< [pr]
3.8: 1.0.0 () >firmware.revision< [pr]
3.3077: () >identify< [pw]
3.55: >temperature<
3.3088: 6.1 () >temperature.current< [pr,ev]
3.3091: Pourch () >name< [pr]
3.3090: True () >status-active< [pr,ev]
3.3089: 0 () >status-lo-batt< [pr,ev]
3.56: >motion<
3.3084: True () >motion-detected< [pr,ev]
3.3087: Pourch () >name< [pr]
3.3086: True () >status-active< [pr,ev]
3.3085: 0 () >status-lo-batt< [pr,ev]
3.3083: 878 () >Unknown Characteristic BFE61C70-4A40-11E6-BDF4-0800200C9A66< [pr,ev]
4.1: >accessory-information<
4.4097: Basement () >name< [pr]
4.4098: ecobee Inc. () >manufacturer< [pr]
4.4099: D3TP () >serial-number< [pr]
4.4100: REMOTE SENSOR () >model< [pr]
4.8: 1.0.0 () >firmware.revision< [pr]
4.4101: () >identify< [pw]
4.55: >temperature<
4.4112: 20.9 () >temperature.current< [pr,ev]
4.4115: Basement () >name< [pr]
4.4114: True () >status-active< [pr,ev]
4.4113: 0 () >status-lo-batt< [pr,ev]
4.56: >motion<
4.4108: False () >motion-detected< [pr,ev]
4.4111: Basement () >name< [pr]
4.4110: True () >status-active< [pr,ev]
4.4109: 0 () >status-lo-batt< [pr,ev]
4.4107: 15808 () >Unknown Characteristic BFE61C70-4A40-11E6-BDF4-0800200C9A66< [pr,ev]
(venv) pi@hassbian:~ $

(venv) pi@hassbian:~ $ python -m homekit.unpair -f pairing.json -a "ecobee3"
/home/pi/venv/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/x25519.py:35: CryptographyDeprecationWarning: public_bytes now requires encoding and format arguments. Support for calling without arguments will be removed in cryptography 2.7
utils.DeprecatedIn25,
Pairing for ecobee3 was removed.
(venv) pi@hassbian:~ $

@Jc2k
Copy link
Member

Jc2k commented Feb 4, 2019

Looking good!

On GitHub If you do ``` on the line before and the line after your console output it will use a monospace font and be easier to read :-)

The unknown characteristics can be probably be ignored. They look to be temperature related, but they are not Apple standard ones as far as I can tell. The important thing is we can see a thermostat service and multiple accessories with a motion and temperature service.

So if you do this again, but don't do the last bit to unpair you will be left with a pairing.json with all the crypto keys needed to make it work with HA. You should just be able to drop it into your HA config directory, off the top of my head $CONFIG_DIR/.homekit/pairing.json, then restart HA. If you do that now we should be able to get an idea of whether the HA side of the code works. What i'm expecting is:

  • With HA 0.86 this should work, more or less, but you might get timeouts that require a HA restart. This can happen pretty quickly depending on the device. There is also a potential gotcha - you might see a KeyError about a field called valid-values. If that happens we are stuck again. If it does work, only the thermostat component will be understood.

  • With HA 0.87 (in beta), the timeouts are fixed, the KeyError should be worked around and the motion sensors will be detected and work, but at the moment only in polling mode (once a minute). I'm working on event supported but its a little way off.

I'm hoping that if you drop the pairing.json in the right place and restart your HA you will be able to control the target temperature etc from HA. If that's the case I'll get to work on getting this change properly upstream.

@wes-warner
Copy link

Will do as you suggest above, but first a note as to where I was headed in starting this.

As of now I don't plan to change Ecobee settings via HA. All I need with the Homekit link is (preferably quick) access to sensor data.

I use the Ecobee android app when away from home, such as to set the temp so it is comfy when we get there. Our home is very well insulated and the boiler/air handler/air conditioner are sized small for max efficiency. As a consequence the home responds slowly to a request for a temp change. The ecobee does a good job of anticipating this for scheduled changes. I suppose geofencing could track us driving home from Florida and turn heat up 3 hours or so before we get there, but life is short....

As you may see from the info above I have 3 Ecobee remote sensors that track temperature and occupancy/motion in three rooms: Kitchen, Basement (family room) and Porch (3 season room with
overhead radiant electric heat for occasional cold weather use). I want to use the Porch sensor via HA/Homekit to control the Porch temperature using the radiant heaters when I ask for it (via Alexa) or first occupy the porch and so long as the porch remains occupied. If the Homekit connection is quick enough ( a second or so) I could control porch lights as well.
Wes

@Jc2k
Copy link
Member

Jc2k commented Jun 7, 2019

Is anyone on the final 0.94 tag able to see if this is all working for them now? All the pairing related fixes should now be merged.

@Tediore Are you able to give any more details about this? Maybe screenshots or links or something? HomeKit scenes are local to the controller(s) (i.e. your iPhone), so theres no way to manage them or activate them through the API the devices use. I've only seen one model of ecobee, its possible newer models might expose Home/Away modes as switches or something. I'd need to see the homekit_controller-entity-map file of a device that had working Home/Away to see what the deal was (without redacting the type field).

@Enzo-Matrix

The "type" values you redacted are UUID's that describe what the field is. E.g. 0000000F-0000-1000-8000-0026BB765291 is whether the thermostat is currently on. The model is 00000021-0000-1000-8000-0026BB765291. I mostly just wanted to check the file had been populated correctly, and it seems to have.

Does the port match what you get if you run the discover command manually?

@raccettura
Copy link
Contributor Author

Original ticket creator here... I was able to pair 2 ecobee thermostats the other night and so far everything seems to work well.

@Jc2k
Copy link
Member

Jc2k commented Jun 7, 2019

Excellent news!

@Tediore
Copy link

Tediore commented Jun 7, 2019

@Jc2k I don't have an iPhone, but here's the documentation on it from ecobee's website: https://support.ecobee.com/hc/en-us/articles/115004905767-How-do-I-connect-my-ecobee-thermostat-to-Apple-HomeKit-
"What are HomeKit scenes and automations?" section

@Jc2k
Copy link
Member

Jc2k commented Jun 7, 2019

Interesting! Can you send me your entity map file from your config .storage folder and I’ll see if I can see anything

@Tediore
Copy link

Tediore commented Jun 7, 2019

Can do! Might not be until Sunday, is that ok?

@Tediore
Copy link

Tediore commented Jun 9, 2019

@Jc2k I have what you need--how would you like me to share it with you?

@Jc2k
Copy link
Member

Jc2k commented Jun 9, 2019

You can attach it here if you like, the only personal information is maybe the names of things (which you can see easily enough in the JSON) and it might have a serial number which you can edit out if you like.

Or i'm on the HA discord, i think you can send private messages there.

Or you can send it to me via Keybase.

@Tediore
Copy link

Tediore commented Jun 9, 2019

Perfect, see attached (not sure how valuable it will be). I omitted any personal info.
homekit_controller-entity-map.txt

@Jc2k
Copy link
Member

Jc2k commented Jun 9, 2019

OK so if you look for 0000000F-0000-1000-8000-0026BB765291 in that file. Thats the start of the Current Heating Cooling State characteristic in the thermostat service. From there down to 00000023-0000-1000-8000-0026BB765291 (the name characteristic) are normal standard thermostat characteristics. You can google those UUIDs and find out what they mean, and there is a spec from Apple that says what they should do and stuff.

After then there are 16 completely non standard and undocumented ecobee specific characteristics. If you google them you just find this ticket.

It's likely the features you found in the ecobee docs are using these, and that they don't work without an ecobee app. I'd need to see a screenshot from the Apple Home app of thes scenes they are talking about to confirm things.

We can infer what some of the non standard ones might do (they declare they are "celsius" or a number in the range 1 to 100 so probably a percentage. But there is no obvious "set home mode" toggle.

Right now even if we reverse engineered the meanings of all of these, unlike the official characteristics they are private interfaces so theres no guarantee Ecobee won't change them.

They are also specific to this device, but homekit_controller is trying to be device agnostic. It will be hard to have support for these as part of the core homekit_controller without adding really low quality spaghetti code to support quirks for different thermostats. We don't have a mechanism to have a seperate version of homekit_controller that understands the ecobee specific secret characteristics (and with this many custom characteristics it probably would warrant a full integration of its own).

So I don't think i can help with that right now.

@Tediore
Copy link

Tediore commented Jun 9, 2019

Makes sense, thanks. I bet I can probably emulate my current Ecobee setup solely in home assistant. Probably will require using Auto instead of heat/cool and changing temps instead of using home/away.

@Tediore
Copy link

Tediore commented Jun 13, 2019

@Jc2k Having some trouble with Auto mode... I can't seem to set target_temp_high and target_temp_low. There's also only one slider for Auto mode instead of two like expected. Here's the automation I'm trying to use:

- id: 'tstat_sleep_home'
  alias: Thermostat sleep at home
  initial_state: 'off'
  trigger:
    platform: time
    at: '22:30:00'
  condition:
    condition: and
    conditions:
    - condition: state
      entity_id: binary_sensor.tstat_mode
      state: 'auto'
    - condition: or
      conditions:
      - condition: state
        entity_id: alarm_control_panel.abode_alarm
        state: disarmed
      - condition: state
        entity_id: alarm_control_panel.abode_alarm
        state: armed_home
  action:
    service: climate.set_temperature
    data:
      entity_id: climate.thermostat
      target_temp_high: 65
      target_temp_low: 71

Using set_target_temp works but it seems to set the high and low temps around the temp you set based on the minimum heat/cool diff in Auto mode. For example, if the minimum diff is set to 5 and I change the target temp to 70, it will set the cool setpoint to 73 and the heat setpoint to 68. Any ideas?

Edit: If auto mode won't work it's no big deal, I'll just add another condition that sets the target temp based on the current operating mode (heat or cool) instead.

@arsaboo
Copy link
Contributor

arsaboo commented Jun 13, 2019

@Jc2k I am still having issues pairing my Ecobee thermostat. I have 3 Ecobee3 thermostats and only one is being detected in HA. The homekit_controller-entity-map is a huge file with 703 rows and I can pm you the file on discord if it helps.

@Jc2k
Copy link
Member

Jc2k commented Jun 13, 2019

@Tediore bad news! I think target_temp_high and target_temp_low might not be supported by native characteristics either.

A dev has reached out to me about their own custom characteristics requirements, so i'll see if that changes things about supporting the secret characteristics on your device. Can't promise anything though. In the mean time, you can only set a single target temperature, and thats why there is only a single slider.

@arsaboo If you have that file and it has that many rows then I would guess that you have managed to pair at least one of your thermostats (that file can only be created with a valid pairing). Have you tried restarting HA since pairing? Maybe its only showing one device at a time because they have the same name (or a similar one?). Have you tried using the "+" button to trigger a manual HomeKit pairing? You can also use the command python3 -m homekit.discover in your installation to scan on the command line (might be python -m homekit.discover depending on your OS / install method).

@Tediore
Copy link

Tediore commented Jun 13, 2019

No worries, thanks for the update. I'll just set up separate heat/cool mode automations.

Interesting to hear about the custom modes. I won't get my hopes up but I'll keep an eye out. I've also got a Chromebook now instead of a Windows machine so I can actually access a Linux terminal if testing is needed with that.

@arsaboo
Copy link
Contributor

arsaboo commented Jun 14, 2019

@Jc2k I did try the "+" in the integrations page and it still does not detect the other Ecobees. They also do not have same names.
image

Here's the output of python -m homekit.discover:

(homeassistant) homeassistant@aloknuc:/home/arsaboo$ python -m homekit.discover
Name: Philips hue - 403DB0._hap._tcp.local.
Url: http_impl://192.168.2.229:8080
Configuration number (c#): 19
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): 73:AC:88:89:xx:yy
Model Name (md): BSB002
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Bridge (Id: 2)

Name: Lifx3._hap._tcp.local.
Url: http_impl://192.168.2.234:80
Configuration number (c#): 5
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): 65:2C:7A:DB:xx:yy
Model Name (md): LIFX BR30
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Lightbulb (Id: 5)

Name: LifxnrGuest._hap._tcp.local.
Url: http_impl://192.168.2.49:80
Configuration number (c#): 5
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): 45:27:33:95:xx:yy
Model Name (md): LIFX BR30
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Lightbulb (Id: 5)

Name: Lifx5._hap._tcp.local.
Url: http_impl://192.168.2.176:80
Configuration number (c#): 2
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): 8C:5A:61:F9:xx:yy
Model Name (md): LIFX BR30
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Lightbulb (Id: 5)

Name: LifxnrKitchen._hap._tcp.local.
Url: http_impl://192.168.2.16:80
Configuration number (c#): 5
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): BD:0C:EE:96:xx:yy
Model Name (md): LIFX BR30
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Lightbulb (Id: 5)

Name: Bedroom._hap._tcp.local.
Url: http_impl://192.168.2.247:1200
Configuration number (c#): 6
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): 96:15:38:98:xx:yy
Model Name (md): ecobee3
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Thermostat (Id: 9)

Name: Upstairs._hap._tcp.local.
Url: http_impl://192.168.2.44:1200
Configuration number (c#): 3
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): 44:61:32:F4:xx:yy
Model Name (md): ecobee3
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Thermostat (Id: 9)

Name: Downstairs._hap._tcp.local.
Url: http_impl://192.168.2.184:1200
Configuration number (c#): 4
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): 44:61:32:E5:xx:yy
Model Name (md): ecobee3
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Thermostat (Id: 9)

Name: Homebridge-CAD8._hap._tcp.local.
Url: http_impl://172.17.0.1:51826
Configuration number (c#): 1848
Feature Flags (ff): No support for HAP Pairing (Flag: 0)
Device ID (id): CC:22:3D:E3:xx:yy
Model Name (md): Homebridge
Protocol Version (pv): 1.0
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Bridge (Id: 2)

@Jc2k
Copy link
Member

Jc2k commented Jun 16, 2019

@arsaboo from that output it looks like all 3 are paired. If there is only one showing in HA you will have to reset the HomeKit pairing on the device itself, that should make it show up in Discovery.

@Tediore are you on discord? If you want (and we can find a time that works) we could pair your device with the CLI and start trying to work out some of these custom characteristics.

@Tediore
Copy link

Tediore commented Jun 16, 2019

Yes I am! Sounds good. USA, Central time zone. What about you?

@Jc2k
Copy link
Member

Jc2k commented Jul 4, 2019

@Tediore UK timezone. Sorry for late reply! Are you on the HA Discord?

@arsaboo did my last note help? is your problem now resolved?

@Enzo-Matrix where were we up to - did things start working in the end or is it still broken?

@Tediore
Copy link

Tediore commented Jul 4, 2019

@Jc2k No worries. Yes I am.

@garyak
Copy link

garyak commented Sep 27, 2019

This morning I was able to integrate my S30 thermostats into HA 99.3. Quite a surprise! While multi-zone configuration isn't available, a big thank you to those of you who have worked on this.

@GaryOkie
Copy link
Contributor

GaryOkie commented Sep 27, 2019

@garyak - that is indeed great news your Lennox S30 is now connected! I've been following the updates but must have missed what change (if any) fixed the handshake.

A while back, HA detected my S30 via zeroconf, but that is no longer the case, and I'm not sure what enabled it. I've installed a bonjour browser and it sees hassio and other zeroconf-supported stuff, but not the S30. (They are on the same network, but the S30 is wifi and Hassio is ethernet.)

Are you able to confirm if the S30 only broadcasts bonjour just when the wifi and Homekit is being set up via an Apple IOS device? If so, I'll have to go borrow a iPhone/iPad like I did once before to get this set up.

@garyak
Copy link

garyak commented Sep 27, 2019

I can not verify that WAC mode is the only time the S30 broadcasts. The steps I followed:

  1. Enter WAC mode on the S30. This triggered discovery on my HA instance resulting in a notification and listing on the HA Integrations page.
  2. Select the S30 from the Wi-Fi networks screen on the iPhone/iPad.
  3. Wait for the S30 to discover the iPhone/iPad's SSID, then press Done on the iPhone/iPad Find a APP screen. This prompted the S30 to display the pairing code.
  4. Select Configure from the integrations page to call up the HomeKit code dialog and enter the code in this format xx-xxxx-xx. Failure to add the dashes causes an error.

I do have zeroconf: in my configuration.yaml file.

@GaryOkie
Copy link
Contributor

Thanks for the clear steps! Step 1 showing that entering WAC mode is what triggers HA discovery is key. My S30 is configured for wifi via the wifi menu, not via WAC - which apparently requires iOS. (WAC pairing via Android doesn't work).

So I'll need to borrow an iOS device and try this again.

@GaryOkie
Copy link
Contributor

Still no go for me. With an iOS device, Lennox S30 WAC mode works fine to connect to wifi and to initiate Homekit pairing. HA 93.3 zeroconf notification recognizes the S30 immediately for configuration. Entering the code (with dashes) results in the S30 claiming a successful Homekit pair, but the HA component fails with Pairing attempt failed with an unhandled exception

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 278, in async_step_pair
    start_pairing, self.hkid, self.hkid
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homekit/controller/controller.py", line 374, in start_pairing
    raise AlreadyPairedError('Alias "{a}" is already paired.'.format(a=alias))
homekit.exceptions.AlreadyPairedError: Alias "51:34:90:F8:50:D1" is already paired.

Tried again by doing a Homekit factory reset on the S30 and restarting HA. Exact same result. I guess @garyak just got lucky.

@Jc2k
Copy link
Member

Jc2k commented Sep 29, 2019

Glad to hear things are working for you @garyak. I'm still waiting for some feedback to my question on the Lennox E30 thread.

#20885 (comment)

We probably should continue the discussion there, but if someone can test out code changes I might be able to add some retrying to handle the raciness for this thermostat.

@stale
Copy link

stale bot commented Dec 28, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 28, 2019
@Jc2k
Copy link
Member

Jc2k commented Jan 2, 2020

I'm going to close this because pairing with ecobee thermostats now works.

If you are waiting for support the temperature ranges in heat/cool mode, you can track this ticket.

There is also a ticket about presets but I can't see how that will work without using vendor specific extensions.

Feel free to open a ticket and @ me if there are ecobee niggles. I am tied up with adding support for events and don't have much time but I will always try and prioritize regressions over new features.

@Jc2k Jc2k closed this as completed Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests