hjdhjd / homebridge-doorbird

Homebridge plugin for Doorbird
Apache License 2.0
54 stars 14 forks source link

DoorBird Unlocking Without Prompting. #29

Closed hjdhjd closed 5 years ago

hjdhjd commented 5 years ago

So lately it seems that the DoorBird will now unlock itself when you open the Home app. Seems to be most prevelant when you kill the Home app and restart it cleanly. I’m seeing this behavior on iOS 12.1 and the latest homebridge / DoorBird / node...

What you see in the logs looks like:

DoorBird set state to unlock DoorBird lock opened DoorBird set state to lock DoorBird auto lock initiated

Even though not unlock action was initiated. Could it be something happening when the plugin is first queried from a clean start of the Home app?

It’s quite odd...

mrhund commented 5 years ago

Hi, tried with my iPad and iPhone (both on 12.1) and was not able to reproduct the problem. Could you please provide more detailled steps?

brownad commented 5 years ago

I haven’t seen this either. However I remember putting in a way of locking the door on load (doesn’t really lock) as home app would by default make it load as unlocked. Even though it doesn’t unlock. Maybe you’re seeing that?

Sent from my iPhone

On 3 Dec 2018, at 15:05, mrhund notifications@github.com wrote:

Hi, tried with my iPad and iPhone (both on 12.1) and was not able to reproduct the problem. Could you please provide more detailled steps?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

hjdhjd commented 5 years ago

Could well be. If I had a consistent way to recreate it, I’d debug it. :)

@brownad - it could well be that. The thing is, it triggers as “unlocked”. I have a rule that kicks it when the DoorBird unlocks and it’s definitely getting triggered. What’s unclear to me (and will be difficult to test given my home layout) is whether HomeKit reporting that the DoorBird is unlocked is actually reflecting what’s really happening on the DoorBird or whether it’s a code glitch.

What is definitely happening from time to time, usually as a result of Home being opened up after a force-quit, is that the DoorBird will report unlocked and then locked and trigger associated actions.

Thoughts on testing / debugging further?

brownad commented 5 years ago

Just double checking but is it actually unlocking the device or showing up as unlocked? Really hope it isn’t the former..

Possible to put some console statements around the events. I would need to check if I left that there, could add it back in but needs a proper review, as locks needed to be locked on app startup. I am having issues with the latest firmware and iOS app from doorbird so cant rule that out just yet. One firmware version was double rolled out recently.

Sent from my iPhone

On 3 Dec 2018, at 16:38, hjdhjd notifications@github.com wrote:

Could well be. If I had a consistent way to recreate it, I’d debug it. :)

@brownad - it could well be that. The thing is, it triggers as “unlocked”. I have a rule that kicks it when the DoorBird unlocks and it’s definitely getting triggered. What’s unclear to me (and will be difficult to test given my home layout) is whether HomeKit reporting that the DoorBird is unlocked is actually reflecting what’s really happening on the DoorBird or whether it’s a code glitch.

What is definitely happening from time to time, usually as a result of Home being opened up after a force-quit, is that the DoorBird will report unlocked and then locked and trigger associated actions.

Thoughts on testing / debugging further?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

brownad commented 5 years ago

this still happening @hjdhjd

hjdhjd commented 5 years ago

Sorry, I’ve been a bit busy with other projects, but yes...this is still happening with regularity...and no good way to tell if the lock / unlock messages I see are real or phantoms...there’s a decent distance between the house and the lock.

What’s a good way to debug WHY this keeps happening?

My closest guess is that occasionally the Home app triggers the plugin’s initialization all over again for some reason.

DoorBird set state to  unlock
DoorBird lock opened
DoorBird set state to  lock
DoorBird auto lock initiated

Also...as a side note...would be good to update logging to confirm to conventions in homebridge...the logging for this plugin can look funky in the log files since it isn’t using homebridge’s log function versus the console log function...

hjdhjd commented 4 years ago

So...I've solved recreating this easily and understand WHAT the issue is, not necessarily WHY it's happening. If you create an automation to unlock the Doorbird it can get triggered for reasons that aren't obvious at first.

The problem is that unlocking a door is a "secure" action in the HomeKit world that requires authentication. If you want to unlock the Doorbird using Siri on your HomePod, for example, you'll be prompted to use your iPhone instead since you can authenticate yourself there.

How to work around this issue?

Well, it turns out that if unlocking the Doorbird is triggered by another automation everything is happy. So, let's say that if you turn on the light on your front porch, you want the Doorbird to unlock. That works just fine.

So far, so good. Now...let's go a step further and trigger that light turning on, and in turn triggering the Doorbird to unlock, by using something like an Eve Button. So when you press the Eve Button, it turns on the porch light, which then unlocks the Doorbird.

That works. Sort of. The behavior you end up with is what I've described above in this thread. It does in fact work, but it also results in some strange behavior where the automations get triggered in a seemingly random fashion on their own.

I've abandoned trying to make this work for now...Apple really should have a better way for dealing with secure HomeKit actions on devices like HomePods without having to resort to workarounds like I've described above.

I just wanted to document this for posterity in case someone else runs into this thread and experiences similar challenges. You can avoid scratching your head for months at a time like me.

mrhund commented 4 years ago

Thank you, this is indeed very useful!

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbrownad%2Fhomebridge-doorbird%2Fissues%2F29%3Femail_source%3Dnotifications%26email_token%3DAGOOB2722OWICRJ33KNAUC3Q264R7A5CNFSM4GHVHSG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYSA2I%23issuecomment-569450601&data=02%7C01%7C%7C71a570e26c8b4cf13acf08d78bd87e14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637131634247304573&sdata=Yk1%2FehJwtJwr0MR291luwQY6jdgwe8GJUAdkYfn9YZs%3D&reserved=0, or unsubscribehttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGOOB2YEEZT4K5DXCIFT2CTQ264R7ANCNFSM4GHVHSGQ&data=02%7C01%7C%7C71a570e26c8b4cf13acf08d78bd87e14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637131634247314578&sdata=JFtwDtA20qlevjFjGVA7jPKT9LMMDdGCkQ%2Bu6GcpBK8%3D&reserved=0.