KraigM / homebridge-wink

Wink hub plugin for HomeBridge
54 stars 37 forks source link

Siri does what she's told and then claims she can't find the device #14

Closed pdlove closed 8 years ago

pdlove commented 8 years ago

This was reported in #3 but isn't related to the original request other than being found during user testing. When requesting Siri to work with a home kit device, she does it and then reports that she can't find the device. This appears to be due to the callback not sending the original request's value back to Siri and wasn't found during original testing because I did my testing with Apple's Homebridge Developer test app. A resolution will be submitted soon on this.

KraigM commented 8 years ago

Well its not the original request's value that we are sending, but the value after the change has been made. Really Siri wants you to make the change and then respond with the updated value. We are just leaving too early because Wink takes longer then Siri is willing to wait.

pdlove commented 8 years ago

That's a good point. What is really odd is that the locks work fine. And with the locks, it takes a VERY long time to reply compared to the light switch.

pdlove commented 8 years ago

I need a bit of help... Any idea how to trigger the event? I'm thinking like this:

    this
        .addService(Service.Lightbulb)
        .getCharacteristic(Characteristic.On)
        .on('get', function (callback) {
            callback(null, that.device.last_reading.powered);
        })
        .on('set', function (value, callback) {
            that.updatePropertyWithoutFeedback(function() { this.trigger("get",callback); }, "powered", value, value);
        });

Essentially it will change it this to make it so all of the calls will be Updates With Feedback. Does anyone know how to trigger the get event with the callback?

KraigM commented 8 years ago

Not sure what you are talking about. Can you jump on slack?

KraigM commented 8 years ago

@pdlove Your proposed fix is better then any I could think of to solve the real issue :smile:. I committed what I was working on to a feature branch (to be finished in the future) and merged your changes into a new hotfix branch.

There was one minor issue that made it crash, so I fixed that. I also played with the refresh interval numbers and now Siri always gives me a proper response (it doesn't delay her enough to give up).

Side note: Make sure to add the issue number to your commits (as seen above) as it makes it so much easier down the line (i.e. Who wrote this code? Crap it was me. Why did I write it... lets see "Fixed stuff"... ugh. but if the comment has an issue number then you get a link back to an entire desc, convo, etc of why that changeset(s) exists).

Another side note: Make sure to pull latest from the main repo before you add new commits. You changesets were behind and git wouldn't auto merge it (BeyondCompare ftw).

msroest commented 8 years ago

Getting this with 1.0.1 as well.

Thanks so much for all the work @pdlove @KraigM

pdlove commented 8 years ago

Is anyone still having this problem after updating to 1.0.2?

msroest commented 8 years ago

umm not this exactly but I do have Siri just sit there and not respond that somethings been done. Even though the wink has performed the action.

3space123 commented 8 years ago

Yes. As of 19-Jan-16, Siri says that she cannot complete the command, yet the light still responds. Is this because Siri's command is getting through, but the acknowledgement is not getting back to her?

KraigM commented 8 years ago

We will prob have to change it to not wait for wink to update. Bad part is we run into the possibility that it might not really work even though Siri will say it did.

3space123 commented 8 years ago

@KraigM: I realize the implications of that potential solution. It's just that Siri executes the command, it works. Then, she talks for 4s saying it didn't work, even though the lights have already responded correctly.

pdlove commented 8 years ago

I was just looking to see if my garage door opener supported Siri directly and it seems they've delayed that support. I wonder if they're done it for this very reason. Once it comes online with HomeKit support, I'll take a look at what it does to tell Siri "I'm working on it." as that may be the only way we'll know. I was thinking for my next lock purchase to be homekit enabled, but I think locks respond quick enough. It's impossible for a Garage Door to respond fast enough.

KraigM commented 8 years ago

Should be fixed under 1.1.0

KraigM commented 8 years ago

Released in version 1.1.0