-
Notifications
You must be signed in to change notification settings - Fork 18
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
Not able to connect to device after successfully pairing #54
Comments
Use outside of home-assistant isn't really tested. There is a CLI tool, but I do most of my testing through a dev copy of home-assistant TBH. Apparently you can do For testing in HA you need to turn on debug logs in home assistant to see any useful logs. For homekit_controller you need logging for (There is some work going on upstream to let you enable these logs per integration from within the UI, might make it into Feb but i think Mar now unfortunately. Obviously doesn't help right now, but worth knowing going forwards). When a pairing is successful it should create a pairing file on your machine with the encryption keys. It looks like that is The state you describe is probably that the device thinks its paired, and you can only have 1 pairing at a time, so it doesn't show up in homekit aware discovery tools and/or the device is crashing when we try to talk to it. Some of them have really crap JSON parsers and don't actually "parse" HTTP they just rely on the iOS format not changing. So it's possible we aren't matching byte for byte some obscure part of HAP. Last time it was the presence of spaces in the JSON between keys and values. Scandalous i know. What device are we dealing with out of interest? |
@Jc2k The path you mentioned for the pairing.json set me in the right direction at least regarding the initial problem I faced. Figured out I had the file at wrong location, so the CLI commands like It now provides a state/value response, but the weird thing is that the response seems to always be data gathered at the point of the pairing phase. Running the My ultimate goal is to somehow control the device and not only read sensor data. Here's information about the device
|
So in Home Assistant there is currently a known bug where at start up the cached data from pairing time is inadvertently loaded into the state machine. It then proceeds to poll (and watch) and it does eventually update. I have close to 100 entities shared between 5 or so pairings and I don't see this stale data other than blips on graphs. If polling is failing for you, and events aren't working for you, this would explain why you see stale data in Home Assistant. The same is not true for aiohomekit itself. The output you pasted is generated directly from a It's going to be hard to comment further without debug logs - so good luck getting them! |
@jorgnyg Any luck getting the debug logs? |
@Jc2k I'm able to retrieve logs, but it's really hard to get anything valuable out of it. It never says the device is "unavailable", but stale data is often reported in. So based on logs everything is seemingly looking fine, except the values itself. However, when adding the device in HA with HomeKit pin, it now says "Invalid flow specified". Closing the popup results in the device being added anyway. It also has a button entity called "Identify", which I've never seen before. This behaviour is very similar to this one https://community.home-assistant.io/t/hunter-simpleconnect-issue/391201 This is clearly a device with HomeKit poorly integrated.. Logs
|
The identify button is a new feature. It's so you can tell which one is which when you have a lot of them. The device should flash a status light, beep or make itself known somehow. It's also useful to debug the connectivity. Oh my phone but I'll look at the logs as soon as I can. |
@Jc2k Ah understand. No worries.
|
So to me those logs look absolutely fine. That is the raw JSON body your device is sending us (after stripping the encryption), before i process them. Thats why they are reported as a So if you are saying "1" and "1.00000" are wrong, then unfortunately its the device at fault and there is nothing I can do... |
@Jc2k Okay, thank you for your time and clarifying this! Will close this now:) |
Was able to connect to device from CLI with the result
Pairing for "air" was established
.I've might misunderstood, but shouldn't I be able to interact with the device after pairing was established? Or do I need to handle some kind of session/permanent connection?
Since
python3 -m aiohomekit list-pairings -a "air"
results inTimeout while waiting for connection to device
, the wifi icon started blinking again (waiting for connection) and the device won't show in Apple HomeKit, it looks like it entered some kind of zombie state.Had some problems keeping this smart device connected to HomeAssistant permanently, so I wanted to try it "manually" from the source. Any tips on how to get additional logs from the post pairing process?
The text was updated successfully, but these errors were encountered: