Coder Social home page Coder Social logo

Comments (1)

steilerDev avatar steilerDev commented on July 19, 2024

I actually experienced issues with the concept of TargetState and CurrentState of homebridge, therefore I implemented a threshold of 3 percent (can be found here).

A little bit more detailed explanation:
When issuing a new TargetState to HomeKit, homebridge will send the value as a command to openHAB. The HomeKit UI will show "opening" or "closing" (depending on the difference between the values of TargetState and CurrentState). My accessories and/or openHAB not always actually go to to the exact value as sent by the command and therefore the object never reached TargetState and always shows as "closing" or "opening". Therefore I added a window of 3%, in which the TargetState and CurrentState are reported as equal. You can change the linked line from above to 0 and this should fix your issue, but might bring the "opening/closing" bug back. Your decision, but I will keep it that way, since I don't think a window of 3% is unnoticeable by the user, while keeping a consistent and correct interface.

E.g.: You are currently at 0% and want to go to 50%. CurrentState == 0, TargetState == 50, therefore the UI shows "opening". Now the command is sent to openHAB and then to your item to go to 50%, for some reason however your item reports a final position of 49%. Therefor HomeKit still thinks it's "opening" (because CurrentState < TargetState).

I hope that makes sense.

Frank

from homebridge-openhab2-complete.

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.