Code Monkey home page Code Monkey logo

Comments (6)

ebaauw avatar ebaauw commented on August 24, 2024

Hi @deanlyoung,

Yeah, this is extremely annoying, especially when you have many lamps and sensors connected to your hue bridge. The current implementation of homebridge-hue loads all accessories at startup. When it cannot find or fails to communicate with the hue bridge, it starts nonetheless, but exposes no accessories to homekit. Homekit then thinks these accessories are no longer present and deletes them from it's database. Consequently, when you restart homebridge (and homebridge-hue), homekit thinks the accessories are brand new.

The structural solution to this is to change homebridge-hue to support homebridge 2.0's dynamic accessory model, see issue #4. Homebridge would then persist the accessories in the .homebridge directory, so homebridge-hue could still expose the "old" accessories, even when the connection to the bridge is (temporarily) lost. It will take me some time to make this change, though.

I would appreciate your ideas on some other more or less related thoughts, neither of which is implemented quickly, unfortunataly:

  • Homebridge-hue could propagate name changes in homekit back to the hue bridge, so at least the names would be remembered. Edit: this can only work for service names (Siri names), which are stored in a characteristic. Accessory names are maintained in the homekit database, not in a characteristic. The homekit database can only be accessed by iOS apps, not by accessories like homebridge.
  • Homebridge-hue could support the Room groups on the hue bridge to assign lights to a room (as does the bridge v2 homekit implementation). Again, homebridge-hue could propagate homekit changes of room assignments back to the bridge. Edit: would need an iOS app for this.
  • Homebridge-hue could use resourcelinks on the hue bridge to remember room assignments of sensors. Edit: would need an iOS app for this.

from homebridge-hue.

deanlyoung avatar deanlyoung commented on August 24, 2024

Hey @ebaauw, those suggestions sound right. I'm afraid I don't know too much about the inner workings of the Hue bridge, but all the more reason to read up on it. I wonder though if something could be learned (or brought over) from @nfarina's philipshue repository? I was using that one before switching, in order to gain access to sensors, and it at least had the perception of being a little more stable.

from homebridge-hue.

ebaauw avatar ebaauw commented on August 24, 2024

Hi Dean, @deanlyoung

I looked at that plug-in, before deciding to create on my own. Like you, I wanted homekit support for the hue sensors. For that, I needed a different design of the plug-in. Last I looked, homebridge-philipshue only queries the hue bridge and updates homekit when a homekit app actually requests the homekit characteristic values. Homebridge-hue instead polls the bridge every heartbeat seconds to detect changes without any homekit app being active. This is needed to trigger homekit rules when hue sensor values change. Also, I like the homekit apps to mirror the bridge state without having to refresh the app manually.
Another difference: homebridge-philipshue collects all homekit characteristic changes for a light in a single hue bridge request. [Edit: no it doesn't, see issue #15]. The way I setup homebridge-hue, each individual characteristic change is pushed to the bridge immediately and independently. I want to change that eventually, but I'm currently focussing on the dynamic accessories.
Consequently, homebridge-hue is more resource intensive on the system it runs on, on the network and on the hue bridge.

from homebridge-hue.

deanlyoung avatar deanlyoung commented on August 24, 2024

Gotcha! Makes sense. It explains a little more for the other issue (#15) I opened as well.

I wonder if there would be any benefit from separating the sensor component and the light control component and expose them separately to the Home app as two platforms? Although, maybe it would still be pinging the Hue bridge just as frequently...

from homebridge-hue.

ebaauw avatar ebaauw commented on August 24, 2024

No, it wouldn't, the problem lies with the hue bridge (gen 1). See my response to issue #15.

from homebridge-hue.

ebaauw avatar ebaauw commented on August 24, 2024

I'll close this issue. The timeouts are tracked through issue #15, and the solution of the wiping of the homekit settings is with issue #4, the homebridge v2.0 dynamic accessory model.

from homebridge-hue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.