-
Notifications
You must be signed in to change notification settings - Fork 41
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
Can I read Homekit values for all accessories paired? #166
Comments
Hey |
Thank you Joachim, is there an example script available somewhere? |
Hi @sderuiter,
Downside: this might be slow since all the crypto for a session is redone every time. And the you will not be able to have a pairing with an iOS devices. |
We use homekit_python in home-assistant for the As @jlusiardi said you can only pair with a single controller at once. And you can't read the values without pairing. If you do want to continue to use these devices with an iPhone etc at the same time then home-assistant has a If you decide to go down the route of writing a custom script to poll the accessories note that homebridge support is currently problematic. When reusing an existing crypto session homebridge sends unsolicited events about once a minute to try and keep the connection alive. There is no mechanism to stop it short of hacking the homebridge code. The synchronous client cannot handle mixing request/reply semantics of polling and unsolicited event notifications on the same TCP connection. In the homebridge case this manifests as one poll returning a blank value (from the keep alive event) and the next poll returning the value of the previous poll. I started trying to fix this in #152, but ultimately for my use case i need a native asyncio client (we are working on this in #154). I think we reached the consensus that you shouldn't mix events and request/reply on the sync client, but we could make the situation slightly better and ignore event messages when handling a request/reply. Right now if you did go down the home-assistant route then you would currently get database logging once a minute. Depending on how quickly we can get #154 stabilised this would then be enhanced with event support. In my testing this works great with Hue - Home Assistant reacts to me changing the light state in <1s - so your database would be updated almost immediately. |
Hi,
Possibly a dumb question, but I can't get from the readme whether this implementation would fit my needs.
I have Philip Hue lights and sensors and Tradfri power plugs and a Raspberry Pi with a sensor, running Homebridge.
My goal was to build a Python script to read all values from all sensors (and light/power states), for storage into a db. My assumption was that homekit_python gives me that possibilty.
However, I just can't seem to grasp how this works?
I can do homekit.discover, which gives me my three 'bridges' (Hue, Tradfri, Raspberry Pi), but I can't seem to get the accessories from these bridges?
To confirm: is homekit_python able to get readings from Homekit accessories?
Thank you!
The text was updated successfully, but these errors were encountered: