Giter Club home page Giter Club logo

Comments (14)

pponce avatar pponce commented on September 11, 2024

Oh and I have the latest version 0.2.3 of the plugin installed. Installed it yesterday as per the instructions in the read me. I have a chamberlain whisper drive plus if that matters at all.
Thanks for working on this plugin.

from homebridge-liftmaster2.

pponce avatar pponce commented on September 11, 2024

In looking at index.js i figured it has something to do with this block of code.

// Determine the current door state
var newState;
if (thisDoorState === "2") {
cache.initialState = Characteristic.CurrentDoorState.CLOSED;
newState = Characteristic.CurrentDoorState.CLOSED;
} else if (thisDoorState === "3") {
newState = Characteristic.CurrentDoorState.STOPPED;
} else if (thisDoorState === "5" || (thisDoorState === "8" && cache.initialState === Characteristic.CurrentDoorState.OPEN)) {
newState = Characteristic.CurrentDoorState.CLOSING;
} else if (thisDoorState === "4" || (thisDoorState === "8" && cache.initialState === Characteristic.CurrentDoorState.CLOSED)) {
newState = Characteristic.CurrentDoorState.OPENING;
} else if (thisDoorState === "1" || thisDoorState === "9") {
cache.initialState = Characteristic.CurrentDoorState.OPEN;
newState = Characteristic.CurrentDoorState.OPEN;
}

I'm not sure what a doorstate of 8 means. Is it as simple as reversing check for doorstate of 5 and 4?

from homebridge-liftmaster2.

luisiam avatar luisiam commented on September 11, 2024

door state 8 is for some other model. I think the Home app has it's own mechanism of determining opening/closing state. I had that problem, too. Try other HomeKit app such as Hesperus. I had no problem on state reporting with Hesperus. You can remove the doorstate 4 and 5 condition and see if that fixes the problem, too.

from homebridge-liftmaster2.

pponce avatar pponce commented on September 11, 2024

I checked Hesperus and also the Home app (non apple one by selfcoded.com). Both of those don't show the active opening and closing states. They just show open or closed states. The apple home app shows the extra states of opening and closing. I'll try and switch the 4 and 5 values around and see if the final states work in all apps and it fixes my apple home app issue.

from homebridge-liftmaster2.

luisiam avatar luisiam commented on September 11, 2024

Try to remove the condition instead. I believe apple Home app takes care of the transition state.

var newState;
if (thisDoorState === "2") {
cache.initialState = Characteristic.CurrentDoorState.CLOSED;
newState = Characteristic.CurrentDoorState.CLOSED;
} else if (thisDoorState === "3") {
newState = Characteristic.CurrentDoorState.STOPPED;
} else if (thisDoorState === "1" || thisDoorState === "9") {
cache.initialState = Characteristic.CurrentDoorState.OPEN;
newState = Characteristic.CurrentDoorState.OPEN;
}

from homebridge-liftmaster2.

pponce avatar pponce commented on September 11, 2024

Gave that a try.
Does the trick.
As a side note I checked my particular setup using instructions on how to do so on http://docs.unofficialliftmastermyq.apiary.io/.
It seems my system does receive the doorstate value of 8 while opening and closing. And my "open" state is a value of 9.

from homebridge-liftmaster2.

pponce avatar pponce commented on September 11, 2024

Since removing the conditions changed the behavior of the home app status the conditions did have an impact.
Do you have any idea why having the opening and closing conditions present would not override whatever the home app logic is correctly?
Just a curiosity now. Since the status works now.

Only time it shows incorrect status now is if i initiate the close or open action and then close the app and open it while it's in the act of opening or closing. If i do that the app will show open or closed instead of telling me it's in the act of opening or closing still.
But that's not a common real world situation so i can live with it.

from homebridge-liftmaster2.

luisiam avatar luisiam commented on September 11, 2024

The other states which are not listed are for the MyQ Garage add on for normal garage opener. I am currently using that one. That's why it is implemented in the plugin.

Regarding the the state reporting, I am not entirely sure how the Home app handles state reporting. Looks like it will determine intermediate state, closing or opening, by the app itself instead of querying from HomeKit accessory. For example, if the door is closed and you press the accessory icon, the Home app will report closing by default, without querying the actual state from the accessory, and vice versa. I don't know how the app will handle conflicts.

from homebridge-liftmaster2.

luisiam avatar luisiam commented on September 11, 2024

I have pushed an update to improve this issue. Please try 0.3.0

from homebridge-liftmaster2.

pponce avatar pponce commented on September 11, 2024

I'll give it a try later today.
Also note i am also using the myq garage 0201 add on for a normal garage door opener.
When i used the api call instructions from http://docs.unofficialliftmastermyq.apiary.io/. while door was opening and closing i saw values of 8 and 9 come through. never saw 4 or 5.
Unless i was doing something wrong when i was running the query.

from homebridge-liftmaster2.

luisiam avatar luisiam commented on September 11, 2024

For MyQ Garage, 8 means moving (either opening or closing), 9 means opened, and 2 means closed. It cannot differentiate between opening and closing.

from homebridge-liftmaster2.

pponce avatar pponce commented on September 11, 2024

Update works. Similar to how it worked with the manual edit to remove the extra conditions.
If i open the home app while it's opening or closing i still get inconsistent status of open (while it's actually closing) or status of closing (even though it's opening). But the final state if open or closed is always correct and the initial status of opening or closing when first pressing the accessory button in the IOS home app is correct.

Do you set polling to true in your setup? Any risk of getting my IP banned if i enable it to true and keep default settings? Right now polling is set to default (false) for me.
thanks again for this plugin. Homebridge and developers like you make the connected home actually usable.

from homebridge-liftmaster2.

luisiam avatar luisiam commented on September 11, 2024

The current algorithm is that it will only show closed if the door is closed. Therefore, opening, closing, and opened will yield to an open state. It will be too hard to take care of all the scenario providing that I don't know how the Home app actually determine the state. I believe the current implementation is the best for real world situation. Please let me know if you can come up with something else.

I set polling to false. I have heard that people get banned because of constant polling. I just don't want to take the risk. I have also noticed that the MyQ server is becoming more unstable. Not sure if that's because more people are using the plugin with polling. Therefore, I also disabled polling by default.

from homebridge-liftmaster2.

pponce avatar pponce commented on September 11, 2024

Thanks. I'm good as is. Works great now on all HomeKit apps I've tried including the iOS 10 home app.

from homebridge-liftmaster2.

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.