bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.
MIT License
169 stars 24 forks source link

[Feature request]: T8520P smart lock Support #291

Closed DaftHonk closed 5 months ago

DaftHonk commented 7 months ago

Version

1.7.1

Node version

20.10.0

Operating System type

Linux

Operating system version

Ubuntu 22.04

Describe the bug

Attempting to set a device property from eufy-security-client results in error: Error Public key is not valid for specified curve

To reproduce

  1. Start server: node ~/node_modules/eufy-security-ws/dist/bin/server.js using 2FA-enabled account
  2. Attempt to lock door: node ~/node_modules/eufy-security-ws/dist/bin/client.js -c device.set_property -a T8520XXXXXXXXXXX locked true
  3. Door fails to lock with error from server.

Screenshots & Logfiles

2024-01-01 20:12:05.861  INFO  Eufy Security server listening on host localhost, port 3000 
2024-01-01 20:12:08.934  INFO  MQTT connection successfully established 
2024-01-01 20:12:08.969  INFO  Successfully registered to MQTT notifications for lock T8520XXXXXXXXXXX 
2024-01-01 20:12:11.961  INFO  Connected to station T8520XXXXXXXXXXX on host 172.21.20.103 and port 21033 
2024-01-01 20:12:20.432  INFO  Push notification connection successfully established 
2024-01-01 20:12:42.133  INFO  Initiated closing of connection to station T8520XXXXXXXXXXX for saving battery. 
2024-01-01 20:12:42.137  INFO  Disconnected from station T8520XXXXXXXXXXX 
2024-01-01 20:15:14.212  ERROR Unexpected error 
 Error  Public key is not valid for specified curve
details:
{
  code: 'ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY'
}
error stack:
• diffiehellman:158 dhComputeSecret
    node:internal/crypto/diffiehellman:158:11

• utils.ts:549 getAdvancedLockKey
    node_modules/eufy-security-client/src/p2p/utils.ts:549:25

• utils.ts:669 getLockP2PCommand
    node_modules/eufy-security-client/src/p2p/utils.ts:669:39

• station.ts:4419 lockDevice
    node_modules/eufy-security-client/src/http/station.ts:4419:46

• eufysecurity.ts:1149 setDeviceProperty
    node_modules/eufy-security-client/src/eufysecurity.ts:1149:31

• task_queues:95 processTicksAndRejections
    node:internal/process/task_queues:95:5

• message_handler.ts:209 handle
    node_modules/eufy-security-ws/src/lib/device/message_handler.ts:209:17

• server.ts:125 receiveMessage
    node_modules/eufy-security-ws/src/lib/server.ts:125:21

2024-01-01 20:15:14.258  INFO  Client disconnected with ip: ::1 port: 33392 code: 1000 reason: Normal Closure

Additional context

Get the same error with other writable properties. Have tried with owner account (2FA), as well as a separate account both 2FA-enabled and not, shared as both device and whole home.

DaftHonk commented 7 months ago

I can provide a verbose log from the server, but I'd rather not post it here as there's an awful lot of personal data in it.

kebel87 commented 6 months ago

I have the same issue and want to help. How can I contribute (by providing logs or access to device)?

bropat commented 6 months ago

This device is currently not supported, so this is not a bug, but a request for improvement. The device must first be supported in eufy-security-client.