Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for T8506 (C220) wifi door lock with keypad #377

Merged
merged 9 commits into from
Feb 10, 2024

Conversation

justinlindh
Copy link
Contributor

This PR adds support for the T8506 (C220) door lock with wifi and keypad. This is my first contribution to this repository, so please let me know if I missed anything (are there tests in this repo?) and I'll be happy to update.

Tested locally using client/server ws wrapper. Device properties:

{
  type: 'result',
  success: true,
  messageId: 'get_properties',
  result: {
    serialNumber: 'T8506<redacted>',
    properties: {
      name: 'Front Door',
      model: 'T8506',
      serialNumber: 'T8506<redacted>',
      hardwareVersion: 'V2',
      softwareVersion: '1.1.1.6',
      type: 184,
      stationSerialNumber: 'T8506<redacted>',
      battery: 100,
      lockStatus: 4,
      autoLock: true,
      autoLockTimer: 60,
      autoLockSchedule: false,
      autoLockScheduleStartTime: '23:00',
      autoLockScheduleEndTime: '6:00',
      wrongTryAttempts: 6,
      wrongTryLockdownTime: 300,
      sound: 2
    }
  }
}

Addresses #356

@justinlindh
Copy link
Contributor Author

Looks like lockStatus isn't updating on external state change and I'm not entirely sure of why yet. I'll continue to debug, but should probably move this into draft until resolved.

@justinlindh
Copy link
Contributor Author

OK; resolved the failed push notification updates. It's not registering the lock command, though; neither through the device.lock command or device.set_property <sn> lock true, so I'll figure that out.

@justinlindh
Copy link
Contributor Author

I haven't had much time to really drill into this, but in case anybody is interested, I'm blocked on figuring out the Eufy public key request/response at the moment. The API returns (converted to hex, trailing bytes truncated) this:

bfef 22bd bfef efbd bdbf ef28 bdbf ef54 bdbf ef49 bdbf bfef ...

This fails in both getAdvancedLockKey and getLockV12P2PCommand with Error [ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY]: Public key is not valid for specified curve

I'll keep playing with this as time allows, but if anybody has any clues on , please let me know.

@bropat bropat changed the base branch from master to develop October 6, 2023 16:26
@kebel87
Copy link

kebel87 commented Nov 29, 2023

Did you end up finding a fix? I have the same issue 😔

@justinlindh
Copy link
Contributor Author

Apologies, but I haven't had time to look into it further. I'll try to take a look this week and see if I can get anything further figured out.

@bropat bropat added the work in progress Working on it label Dec 3, 2023
@bropat bropat added this to the 3.0.0 milestone Dec 3, 2023
@bropat
Copy link
Owner

bropat commented Feb 9, 2024

Added support for this device.

Todo:

  • Add user management support (add, delete, modify, get)

@bropat bropat added implemented and removed work in progress Working on it labels Feb 10, 2024
@bropat bropat marked this pull request as ready for review February 10, 2024 09:55
@bropat bropat merged commit a2d045a into bropat:develop Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants