nfarina / homebridge-liftmaster

LiftMaster support for Homebridge: https://github.com/nfarina/homebridge
23 stars 8 forks source link

Garage Door State Always "Closed" #11

Open lepolt opened 8 years ago

lepolt commented 8 years ago

I recently started playing with homebridge, and after successfully configuring things told Siri to open my garage door. She did, but the plugin always thinks that the door is closed (state===2)

GaryREM commented 8 years ago

Interesting that mine always shows the Current Door State as Open on the MyTouchHome display and Siri says garage doors are open. Messages in terminal show doorstate: undefined. I was able to open and close the door. However, did not see state change.

AppleTechy commented 8 years ago

Try using the eve app... If you have the issue I think you do it that at the moment that it is a problem with the app you are using. Eve actually calls for a state refresh were as some other apps don't one of which is the Insteon+ app. Let me know if when using the eve app if it pulls the right state.

JerGitHub commented 8 years ago

Same issue here - always "Open" even when closed. See #9 . The bummer for me is I had everything working before I updated everything. The Elgato Eve app and the Insteon+ app don't do anything to fix it as far as refreshing either. :(

GaryREM commented 8 years ago

Eve makes no difference. Status always shows open. As I mentioned in previous note, the status on the homebridge application in terminal shows doorstate: undefined so it is the plugin with a problem.

JerGitHub commented 8 years ago

@GaryREM same here.

AppleTechy commented 8 years ago

What model garage door do you have?

AppleTechy commented 8 years ago

@garyrem and @jergithub ^

GaryREM commented 8 years ago

HD920EV. It is a myQ device and, of course, the status is correct in the Chamberlain app.

lepolt commented 8 years ago

I have a newer model LiftMaster (unsure of model number), but the status is correct in the iOS app.

JerGitHub commented 8 years ago

Liftmaster MyQ 8360 with the Liftmaster Internet Gateway 828LM

jkoehl commented 8 years ago

Liftmaster 8557 with 828LM and status is not correct either. In the debug output on homebridge the state actually says "undefined".

Looking at the JSON coming back in the MyLIftmaster.com site I see this on the GetALlDevices endpoint. Not sure if this helps...

State: "2" StateName: "Closed" Statesince: 1453473562309 ToggleAttributeName: "desireddoorstate" ToggleAttributeValue: "1"

JerGitHub commented 8 years ago

Oh and obviously since I have all Liftmaster - I use the Liftmaster iOS app and not the Chamberlain one. Liftmaster iOS app has worked fine from day 1 - no issues with the Liftmaster iOS app as far as status, etc.

jkoehl commented 8 years ago

Yeah me too. The MyLiftMaster site and iOS app all report proper status.

AppleTechy commented 8 years ago

Ok so clearly the issue isn't with the specific unit... Hmm I have an idea but I won't be able to test my theory unit a little bit later.. I will let you know if it is successful or not

GaryREM commented 8 years ago

The logic in the get function looks incorrect. that.deviceState is only set when there is a single door and no DeviceId is specified. There is no attribute scan if you specify a deviceId. I've got 2 openers.

AppleTechy commented 8 years ago

Are you on the newest version? I have 2 garage doors but don't have any issues with it incorrectly pulling the state. @garyrem

jkoehl commented 8 years ago

@GaryREM I noticed the same issue in the logic and just ran it in the debugger. I have specified two accessories in my config.json (each with the device ID for the device). I noticed the logic bypasses all of the state logic if a deviceID is set.

[Edit] Ok now I see what the issue is. The code being pulled down from NPM as 0.1.1 is NOT the latest code in GitHub. I see a commit that has code that would actually fix this issue as the latest commit and I do not have that version and my NPM claims I already have 0.1.1

Maybe the version didn't get bumped for NPM?

GaryREM commented 8 years ago

I thought I was. Modified the plugin to set the door state.

Looking through the code, the latest version was not installed when I did it from npm.

So now I'm getting the 'always closed' issue (was showing 'always open') using Eve.

jkoehl commented 8 years ago

Ok looks like the last fix for the status was fixed AFTER the version bump to 0.1.1.

I think all that needs to be done is the package.json needs updated to 0.1.2 or something.

[Update] I can confirm that with the latest code in this repo both of my doors report proper status so we just need the package.json file version bumped.

AppleTechy commented 8 years ago

@GaryREM Ok thats good news! Can you query siri asking her if your garage door is open or closed? Then I can determine if you are now facing the problem I think you are.

AppleTechy commented 8 years ago

@jkoehl I just message @nfarina about getting the package.json version bumped. ***The version number was bumped and now should have the correct version

AppleTechy commented 8 years ago

@GaryREM Do you have a slack account? Its much easier to go back and forth when debugging stuff on slack. :)

jkoehl commented 8 years ago

I just updated the module using npm and it got the new version. So as far as my setup goes everything is now working!

Thanks @AppleTechy @nfarina

GaryREM commented 8 years ago

Yes, new version is working!

Eve does not appear to update status correctly, but when I asked Siri if garage doors were closed (after closing a door and waiting several minutes for Eve to change status from Open to Closed) Siri said the doors were closed and the Eve display changed to Closed.

jkoehl commented 8 years ago

@GaryREM I found that with the Eve app I had to pull to refresh the status and then it did show the door status as expected. Not sure why it isn't "live" updating but may just be their app.

tideline3d commented 8 years ago

I was experiencing this problem as well, even after the update.

Turns out that there still seems to be a bug if you don't specify a device ID in config.json. I configured my device, though I only have 1 door, and everything seems to be working.

JerGitHub commented 8 years ago

Just updated homebridge-liftmaster from 0.1.1 to 0.1.2 and it's working again! woo-hoo! Just opened one of my garage doors with Siri and closed it too. Reporting correctly in Eve and Insteon+ too. Thanks for sticking with this.

nfarina commented 8 years ago

👍

JerGitHub commented 8 years ago

OK - I might have spoken a little too soon after more testing. So the "Open" and "Closed" status is working however, having more than 1 garage door may be causing issues. If I ask to open any one of the 3 garage doors by saying "Open John's garage door" or "Open Jane's garage door" or "Open Suzie's garage door" - Siri always comes back with this. Any ideas what to check for? img_4586

tideline3d commented 8 years ago

@JerGitHub I've found that Siri doesn't like items that aren't in a room. You may try adding them to the 'Garage' room, or even a room for each one. For example, I have a 'Breakfast Area Light' but if I leave it in the default room and say 'Siri, turn on the breakfast area light' she responds 'Sorry, I didn't understand all of that. Would you like me to turn on all the lights?'. I put the 'Breakfast Area Light' in the 'Breakfast Area' room, and now the same phrase works reliably.

JerGitHub commented 8 years ago

@jw59 - Already have that all setup in Eve/Insteon+. It's in a "Garage" room. I wonder if I need to delete the homebridge .persist folder, reboot, etc. when I upgraded the plugin?

jkoehl commented 8 years ago

One thing I did that helped was change the default "Siri Name" for each door to be unique. In my case I made it just "left" and "right" and that seemed to help my setup. So if I say "open the left garage door" it seems to work now.

The default was both doors seemed to show the same "Garage Door Opener" name for each door before I did that in the Eve app.

On Mon, Jan 25, 2016 at 3:44 PM, JerGitHub notifications@github.com wrote:

@jw59 https://github.com/jw59 - Already have that all setup in Eve/Insteon+. It's in a "Garage" room. I wonder if I need to delete the homebridge .persist folder, reboot, etc. when I upgraded the plugin?

— Reply to this email directly or view it on GitHub https://github.com/nfarina/homebridge-liftmaster/issues/11#issuecomment-174657077 .

JerGitHub commented 8 years ago

OK - I figured it out. It's the same naming issue that I am having with my Nests. It's not so intuitive how HomeKit handles all of its naming - definitely not an Apple-like easy-to-use experience yet.

I have Garage set as a Room and John's Garage Door is set from the liftmaster-plugin since I named it that in the Liftmaster App. But when you go into Eve/Insteon+ it shows the Room as Garage and the Siri Name/Siri Control as Garage Door for all three of my garage doors and the Accessory Name as each one of the 3 names it gathers when loading the plugin from the Liftmaster site.

So what I had to do was go in and rename all of the Siri Name/Siri Control's to a different name to take out the word "garage" in it. So for each one of my 3 garage doors, it is now and seems to work: Room = Garage Siri Name/Control = John Door Accessory Name = John Garage Door

Room = Garage Siri Name/Control = Jane Door Accessory Name = Jane Garage Door

Room = Garage Siri Name/Control = Suzie Door Accessory Name = Suzie Garage Door

JerGitHub commented 8 years ago

@jkoehl looks like we wrote at the same time! Not a fan of how Apple is handling the naming in HomeKit. It's definitely confusing. Not sure why the Accessory Name can't be the Siri/Control name? Same thing happened with the new homebridge-nest plugin that pulls all of my Nest names as the Accessory Name and doesn't allow me to query correctly with Siri/HomeKit until I change all the Siri/Control Names.

u2jrmw commented 8 years ago

I have the older MyQ which is built in to the opener and has a hub. It does not appear to even offer a door status...

I spat out all the device.Attributes display names and this is my list:

[Garage Door] online [Garage Door] gatewayID [Garage Door] desc

This might explain why my door never reports the right status (it always reports closed which is the default setting in the code)

Of course the MyQ app works just fine to show the open/closed status. and Homebridge works to open and close the door, no matter the status. Just a shame I can't get an accurate read via Homekit.

u2jrmw commented 8 years ago

OK, I think I fixed it, but its 2 am so I'm trying to limit the testing of opening and closing the garage door...

The culprit for my setup is in this code:

            if (thisAttributeSet.AttributeDisplayName == "desc") {
              thisDoorName = thisAttributeSet.Value;

              break;
            }

That break is killing the loop before it gets to the door status. Maybe on other configurations door status always comes before desc, but not for me. Once I comment out that break, my status starts working!

I assume the break was added to minimize the number of elements the loop went through (my json has 9 attributes on the opener), but it broke too early for me.

I'm pretty pleased with myself right now. Hopefully the author can make that change in the production code.

BrianNewell commented 8 years ago

FYI... I also had this issue until I added the "deviceID" to config.json. [using "homebridge-liftmaster@0.1.2", single opener/door]

dipesh9414 commented 8 years ago

I am new to Homebridge and have recently added this plugin and works great but I do have a question. I am using Home app for triggers and they work when the garage door is opened or closed with the Home app but triggers are not working when the door is opened using the remote opener or the keypad. Is that the limitation on how this works? What I am trying to do is turn on my kitchen and bedroom lamp when the garage door is open and shut off the lights when the door is closed. Again it works just fine when i give instructions to open or close with Siri but not when it is manually closed through the traditional remotes.

nfarina commented 8 years ago

@dipesh9414 Yes this is expected - Homebridge doesn't "know" that your door has changed until it gets around to querying the web API to see what's new, so it's not really useful for triggers in this case.

dipesh9414 commented 8 years ago

thanks for the quick reply. quick check whether it is worth trying out the MyQ plugin as I have the MyQ bridge also. will that work with what i am trying to do?

AppleTechy commented 8 years ago

The MYQ plugin is the exact same just a less developed version. If you join the LiftMaster Slack channel we have been working on a newer more accurate plugin. Though it is still in development as we are trying to get more users to verify success using it.

On Monday, May 9, 2016, dipesh9414 notifications@github.com wrote:

thanks for the quick reply. quick check whether it is worth trying out the MyQ plugin as I have the MyQ bridge also. will that work with what i am trying to do?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/nfarina/homebridge-liftmaster/issues/11#issuecomment-217980177

kcharwood commented 8 years ago

I just got Homebridge setup with my MyQ device. Joined the slack channel as well. I'm seeing the state stuck in Close.

Happy to help a test a new version if one is available.

u2jrmw commented 8 years ago

You could try my fix a few comments up. Worked great for me. I submitted it for inclusion in the product but haven't seen that happen yet.

brianwarehime commented 8 years ago

Has anyone else tried @u2jrmw's fix? My status is stuck in "Open" and it's rather annoying.