Skip to content

feat: implement auto-lock delay for Dahua door strikes no.2#2041

Open
t09 wants to merge 1 commit into
koush:mainfrom
t09:fix/dahua-lock-autolock
Open

feat: implement auto-lock delay for Dahua door strikes no.2#2041
t09 wants to merge 1 commit into
koush:mainfrom
t09:fix/dahua-lock-autolock

Conversation

@t09

@t09 t09 commented May 12, 2026

Copy link
Copy Markdown

additional #2017:

Amcrest plugin changes:

  • Initialize lockState to Locked on startup so HomeKit accepts the device
  • lock() / unlock() now properly update lockState (faking the state as requested)
  • Auto-lock delay: can be changed in WebUI because Amcrest not reading config of doorbell itself
  • New setting "Auto-Lock Delay (Seconds)" with key dahuaAutoLockDelay

HomeKit plugin changes:

  • Add LockMechanism service to Doorbell accessories that have the Lock interface
  • Link it via addLinkedService so iOS shows the lock button in the camera view
  • Use setTimeout(150ms) before updateCharacteristic to avoid HAP notification/SET-response collision - else it hangs.

The HomeKit change was necessary because without it, the Lock interface on a Doorbell device is never exposed to HomeKit regardless of the Amcrest plugin state.

@t09 t09 closed this May 13, 2026
@t09 t09 reopened this May 14, 2026
@koush

koush commented May 16, 2026

Copy link
Copy Markdown
Owner

use a script or something to do this, it does not need to be in a plugin.

@koush koush closed this May 16, 2026
@koush koush reopened this May 16, 2026
@koush

koush commented May 16, 2026

Copy link
Copy Markdown
Owner

I dont understand the amcrest side changes, this seems like a reporting issue? does the device not report lock state?

@t09

t09 commented May 20, 2026

Copy link
Copy Markdown
Author

No my Dahua VTO2000A doesn't report lock state. http://IP/cgi-bin/accessControl.cgi?action=getDoorStatus&channel=1 gives back Info.status=Close all the time which I guess most doorbells do because only electrical lock ist installed. You would need to install a seperate sensor (magnetic/reed contact) to get status. Next was I can't read timer from Dahua itself (no event) even if you can set time in DahuaUI - so I had to implant a timer in the Amcrest plugin to fake the "lock". Had to mod homekit - else the lock wouldn't show in the videostream itself but as seperate widget.

@t09

t09 commented Jun 27, 2026

Copy link
Copy Markdown
Author

any other ideas how to implent this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants