Closed chrisdrackett closed 2 years ago
homekit_controller documentation homekit_controller source (message by IssueLinks)
Hey there @jc2k, @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit_controller
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
attempting to work on this a bit more. I was hoping after successfully pairing with the home app directly and turning devices on via the Lutron UI I might have more luck, but I'm getting the same as above. I'll see if I can get a dev env running as mentioned in the linked issue.
Your hunch about the linked issue is right; based on your logs your device is indeed rejecting your setup code with kTLVError_Authentication
. This normally means your pairing code is wrong. When the pairing code is right the only alternative explanation is that the device relies on a pairing flow that is not publicly documented (for example, some devices require the iOS app to be party to the pairing process and those are just not supported). Or it could be that the Lutron implements extra restrictions that aren't part of the spec but we still need to satisfy (it could be sensitive to TLV order or something weird like that).
Modifying the code to force PairSetup and/or PairSetupAuth as in the linked issue is still worth trying. The only other way forward for this issue is to capture pcaps with WireShark of an iOS device pairing with this device.
@Jc2k ok, I think I captured the process via Wireshark. This is my first time using it so hopefully this is what you need: https://www.dropbox.com/s/ldxnq8sg3h9l9sm/lutron.pcapng?dl=0
@Jc2k the above is probably not fully filtered, my phone IP is 192.168.1.170. This should be showing only traffic for the controller (192.168.1.78)
Fwiw, I am having a similar issue. I recently added a radio RA 3 controller to my radiora2 setup (new blinds that only work with Ra3). The ra2 devices work with both HomeKit and the Lutron integration. When I try and add the Ra3 controller to HomeKit, I get an invalid code message.
I successfully paired the bridge with HomeKit on my apple devices using the same code. I the unpaired and tried to pair with HA, but same message.
Crossing my fingers there is someway to get RA3 into HASS one way or another soon!
Crossing my fingers there is someway to get RA3 into HASS one way or another soon!
There is also a secondary effort going on here: https://github.com/gurumitts/pylutron-caseta/pull/90
@chrisdrackett - did you make any progress on this at all?
Nope, just crossing my fingers one of these drops someday ;)
Right on, looks like theres some good activity with those pylutron-caseta forks, I'll probably give one of those a go here.
I just got a RA3 installation at my new home as well and am receiving the exact same error. Hopefully the issue is resolvable soon. I'm willing to help test whatever I can and am a developer myself.
Has anyone tried again with 2022.8?
Has anyone tried again with 2022.8?
Yes and it behaves the same as before unfortunately. From reading the linked issues it appears to be an issue with a chain of certificates. I have no idea how/if this will be fixed.
HomeKit doesn't use certificate chains?
2: (16 bytes/) 0x000000000000000050f45fb250f45fb2
The salt has leading zeros here https://github.com/home-assistant/core/pull/76738 should fix that and allow it to pair
2022.8.5 has the changes that hopefully will fix pairing. Please let us know.
I can confirm that I can now pair my RadioRA3 processor. Thank you for the work. That said, I'm not sure what the next step would be since the processor only seems to expose a single device and entity. I expected it to show the light switches in the house.
HomeKit doesn't use certificate chains?
Yeah, that was for direct API access, not through HomeKit.
Missing devices can be caused by them re-using serial numbers for different devices. But i'd expect the correct devices to be created, just the entities to be wrong.
Can you attach the diagnostic information for it?
This worked well for me. I have a few devices on Ra3, and they all showed up (Most of my system is RA2, but the new shades only work with Ra3…). Thank you!!
— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/68723#issuecomment-1216575209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYQTHWIIYJDQDQPTFAL42ODVZODD5ANCNFSM5RX7MHGQ . You are receiving this because you commented.Message ID: @.***>
Missing devices can be caused by them re-using serial numbers for different devices. But i'd expect the correct devices to be created, just the entities to be wrong.
Can you attach the diagnostic information for it?
I appreciate you taking a look. Here's the diagnostic info:
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2022.8.5",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.10.5",
"docker": true,
"arch": "aarch64",
"timezone": "America/New_York",
"os_name": "Linux",
"os_version": "5.15.55",
"supervisor": "2022.08.3",
"host_os": "Home Assistant OS 8.4",
"docker_version": "20.10.14",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"ble_monitor": {
"version": "9.1.1",
"requirements": [
"pycryptodomex>=3.14.1",
"janus>=1.0.0",
"aioblescan>=0.2.13",
"btsocket>=0.2.0",
"pyric>=0.1.6.3"
]
},
"hacs": {
"version": "1.26.2",
"requirements": [
"aiogithubapi>=22.2.4"
]
},
"rinnai": {
"version": "1.0.45",
"requirements": [
"aiorinnai==0.2.9"
]
}
},
"integration_manifest": {
"domain": "homekit_controller",
"name": "HomeKit Controller",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/homekit_controller",
"requirements": [
"aiohomekit==1.2.11"
],
"zeroconf": [
"_hap._tcp.local.",
"_hap._udp.local."
],
"bluetooth": [
{
"manufacturer_id": 76,
"manufacturer_data_start": [
6
]
}
],
"dependencies": [
"bluetooth",
"zeroconf"
],
"codeowners": [
"@Jc2k",
"@bdraco"
],
"iot_class": "local_push",
"loggers": [
"aiohomekit",
"commentjson"
],
"is_built_in": true
},
"data": {
"config-entry": {
"title": "Lutron Processor",
"version": 1,
"data": {
"AccessoryPairingID": "9a:fb:d2:07:3f:24",
"AccessoryLTPK": "d27370cd0adac6a9424254af776a4534b50ad209c846dc86f109818e6e87142f",
"iOSPairingId": "6973a5ca-84ce-4e00-8f59-fee1c8aacaed",
"iOSDeviceLTSK": "**REDACTED**",
"iOSDeviceLTPK": "43c6ef240e83f2453e4cfe62b194497aa3bf399b9bb06e61059994c394ea4e16",
"AccessoryIP": "**REDACTED**",
"AccessoryPort": 4548,
"Connection": "IP"
}
},
"entity-map": [
{
"aid": 1,
"services": [
{
"iid": 1,
"type": "0000003E-0000-1000-8000-0026BB765291",
"characteristics": [
{
"type": "00000014-0000-1000-8000-0026BB765291",
"iid": 85899345921,
"perms": [
"pw"
],
"format": "bool",
"description": "Identify"
},
{
"type": "00000020-0000-1000-8000-0026BB765291",
"iid": 137438953473,
"perms": [
"pr"
],
"format": "string",
"value": "Lutron Electronics Co., Inc",
"description": "Manufacturer",
"maxLen": 64
},
{
"type": "00000021-0000-1000-8000-0026BB765291",
"iid": 141733920769,
"perms": [
"pr"
],
"format": "string",
"value": "JanusProcRA3",
"description": "Model",
"maxLen": 64
},
{
"type": "00000023-0000-1000-8000-0026BB765291",
"iid": 150323855361,
"perms": [
"pr"
],
"format": "string",
"value": "Lutron Processor",
"description": "Name",
"maxLen": 64
},
{
"type": "00000030-0000-1000-8000-0026BB765291",
"iid": 206158430209,
"perms": [
"pr"
],
"format": "string",
"value": "**REDACTED**",
"description": "Serial Number",
"maxLen": 64
},
{
"type": "00000052-0000-1000-8000-0026BB765291",
"iid": 352187318273,
"perms": [
"pr"
],
"format": "string",
"value": "22.02",
"description": "Firmware Revision",
"maxLen": 64
}
]
},
{
"iid": 2,
"type": "000000A2-0000-1000-8000-0026BB765291",
"characteristics": [
{
"type": "00000037-0000-1000-8000-0026BB765291",
"iid": 236223201282,
"perms": [
"pr"
],
"format": "string",
"value": "1.1.0",
"description": "Version",
"maxLen": 64
}
]
}
]
}
],
"config-num": 1,
"devices": [
{
"name": "Lutron Processor",
"model": "JanusProcRA3",
"manfacturer": "Lutron Electronics Co., Inc",
"sw_version": "22.02",
"hw_version": "",
"entities": [
{
"original_name": "Lutron Processor Identify",
"original_device_class": null,
"entity_category": "diagnostic",
"original_icon": null,
"icon": null,
"unit_of_measurement": null,
"device_class": null,
"disabled": false,
"disabled_by": null,
"state": {
"entity_id": "button.lutron_processor_identify",
"state": "unknown",
"attributes": {
"friendly_name": "Lutron Processor Identify"
},
"last_changed": "2022-08-16T14:11:08.870282+00:00",
"last_updated": "2022-08-16T14:11:08.870282+00:00"
}
}
]
}
]
}
}
For what it's worth, I'm having the same issue as @BrianVallelunga - it only creates a single entity.
When you unpair and pair with an iPhone so you see more devices?
I've never had it paired to an iPhone. I use Android, but do have an iPad I can use if that helps. I just checked and there is no connected HomeKit integration listed in the Lutron app on my iPad.
So in the data you posted the bit that says "entity-map" - thats basically raw homekit metadata from your Lutron. It's probably the most bare HomeKit metadata i've ever seen. It's almost like a its a HomeKit bridge with no HomeKit compatible accessories paired to it. So we need to make sure that an iOS device actually sees some devices to work out where the problem is.
I was able to connect the processor to HomeKit via the Lutron app on the iPad. The Lutron app then has me select which devices to expose to HomeKit. When selected, those devices did show up in the Home app on the iPad.
And if you now unpair it from the iPad and add it back to Home Assistant?
And if you now unpair it from the iPad and add it back to Home Assistant?
Sadly, no change.
What if you pair with the iPad but you don't use the Lutron app, just the Apple Home app. In fact, ideally remove the Lutron app to be sure.
My theory is that the Lutron app is doing some extra configuration behind the scenes using its native protocol that we are unable to replicate. If that gets cleared when you unpair i'm not really sure if we'll be able to help.
If pairing with the Apple Home app works, then we'll have to enable debug logging and verify its refreshing the entity-map
wihen you pair with Home Assistant.
This morning I paired the processor directly from the iPad's Home app without using the Lutron app at all. None of my switches or shades showed in the home app after pairing with that method either. It seems the Lutron app is needed to choose which devices get exposed to HomeKit. Ideally I'd be able to pair with the Lutron app, expose the devices, and then switch to HA, but that doesn't seem to work. I am curious as to how this worked for @Bcukier
I may just have to wait for the native Lutron Caseta integration that uses the LEAP API if this can't be resolved.
It might depend on how you remove the device from HomeKit on the iPad. How did you do that?
Sorry, I was out of town this past week. I'll try a few more combinations and write back in the next day or two.
I'm having the same issue. There is a difference between connecting to real homekit and HASS. With real homekit you get a "Apple HomeKit" item listed in integrations:
when you click in you can select devices. For some reason this item does not show up when connecting to HASS.
I suspect the app knows about the HomeKit pairing, but it also knows it's not a pairing that's known to your iOS devices. We only support what you can setup with the native iOS app, if you need to do this setup in a vendor app you are probably out of luck unfortunately.
Sometimes there is a way to set devices up and unpair homekit but leave the settings in place. I do this with an Eve extend. Maybe if you remove the vendor app from your phone and then remove the pairing using the native apple app?
But it just might actually be a device we can't support.
FWIW: I also just ran into the same issue pairing RA3 with the homekit controller. Just get one device/entity after successfully connecting in HASS. Didn't really do anything with iOS (mostly because even when I tried, the Lutron app wouldn't even integrate with Homekit properly)
The problem
I'm trying to pair a RadioRa3 processor with HomeKit Controller, but it keeps failing at the "enter code" stage with "Incorrect HomeKit code. Please check it and try again.".
I'm guessing this is similar to this issue: https://github.com/home-assistant/core/issues/56802#
What version of Home Assistant Core has the issue?
2022.3.7
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Homekit Controller
Link to integration documentation on our website
https://www.home-assistant.io/integrations/homekit_controller
Diagnostics information