Closed psuet closed 4 weeks ago
I tried to build a config myself by somewhat copying and modifying from other BLE Locks implemented and experienced the following problem: The device in question does not implement the typical dp 46/47 or any other simple dp to unlock the box without some form of key (locking is not in-scope; its a snapping mechanism).
While trying to figure out how the app provides unlocking capabilities, i discovered that this lock uses dp 61 or dp 71 (https://developer.tuya.com/en/docs/iot/title?id=K9nmje3twsy7n#title-27-Locking%20and%20unlocking). As far as I can identify, this mechanism still needs to be implemented tuya-local. That was my logical next step.
Problem: I need a method to retrieve the required remote key programmatically. The (what looks like the) key can be easily retrieved by looking at the device logs in the developer portal (Base64 encoded).
Example "No-Code Unlock (with Key)" Message from the Dev Portal: 01 EF BF BD 01 30 30 30 30 30 30 30 30 EF BF BD 01
(Hex, base64-decoded; Possible Key replaced by all zeros)
I need clarification on how this message could be a valid DP 61 Message. Is that the right message? If someone can enlighten me, I would appreciate that.
Setting a new remote unlocking key seems to be possible be possible with DP 73 (instead of the far more simple DP 60)
I have not tried that yet since I somehow failed to grasp the concept of Central ID and peripheral ID and their influence on the Unlock Key. Not a Tuya Expert, yet.
Do you (@make-all) have any guidance on how you would like a remote function using DP 61 implemented in tuya-local? Does somebody know if there is a way to retrieve the key required?
If there is a standard way of unlocking by supplying a code, then I think the HA lock entity does provide an API for this. Because these dps are documented as "raw", I have not attempted to implement them yet, as I don't have sufficient info or a test device.
As for the method of finding the keycode, I think that can be left as a manual exercise, as it is supposed to be there for security, and in some cases the owner may want it entered by the user (on a pinpad etc), in others it can be passed as a parameter in an automation etc.
Log Message
Information about DPS mappings
TinyTuya Output
Product ID
Information about how the device functions
The Device in Question is a Tuya BLE Enabled Lock Box , that can be opened remotely and offers a multitude of code configuration options (time-based / one-time / interval).
By default the Lock used a 6 digit code
Manual (German / French): https://www.pearl.de/pdocs/NX4964_11_185461.pdf
In my example its connected through a ZX-5538 BLE Gateway.