Xiaomi Sherlock Smartlock

I also look forward to your story about how you hooked up esp8266!

Hi, I am trying to open the keyfob, hoping to do no damage, but having a hard time. May you explain how you did it?

Remove battery cover first then remove battery . The front face of the keyfob is glued to the back , try to use sharp cutter and try to disjoint the face of the back .
I will share a video trying to discribe it

is there way to make sherlock s2 to work with mihome ?

I red somewhere that will be added, but was not an official voice/post. Until yesterday was not. I wrote to Sherlock asking from them an integration to Internet (Mi home or any other way of using BLE through the iuinternet). If enough users write, maybe they will isten.

I wrote here

[email protected]

1 Like

Hi guys, I’ll explain you how I got to control the lock with an esp8266.

  1. I disassembled the lock trying to find some wires or some possibility to control the motor with MQTT protocol.

  2. I found four wires going from the main board to the touch switch. (You can see them in the photo from zanerv)
    7fd6a745184983ef3d359c32a5f99d76b46035de_1_666x500

  3. I checked the wires and I realized about the code color: red -> positive, ground -> negative, withe -> data and yellow -> data. After this I tried to decode the protocol connecting the data wires from the touch switch to a ftdi usb adapter. I realized that when I pushed the switch to open it sent an 0 and when I pushed it to 1 it sent an 0 too, so I was confused.

  4. After I have tried with serie protocol, I used a logic analyzer, and I realized that when I pushed to open, the switch down pulse from the yellow wire during 19 ms and when I pushed to close the pulse was down during 43 ms. So I discovered how it worked.
    photo_2018-12-19_12-09-24
    photo_2018-12-19_12-09-33

  5. Knowing how it worked, I got a ESP8266 and I developed a program with arduino IDE to send both pulses to one pin depending of an mqtt message. This is the code: Xiaomi Sherlock MQTT code

  6. I added also to the code the possibility to continue detecting the touch switch. So the pinout of the esp8266 will be the next:

  7. I put the esp8266 out from the lock and the wires over the plastic case:

  8. Take attention that it’s necessary to connect the positive and negative directly to the lock battery.

  9. I attach also two photos with circuit finished and with the case closed:


  10. And finally the project is finished, I tried to be as much specific as I can, if you need some more details just tell me and I’ll explain you! I don’t know if this one is the best solution but I have done it some days ago and until now it’s working really good :slight_smile:

11 Likes

Impressive.

The worry is about battery consumption. Usually WiFi consumes a lot. How is your experience on it?
Also can you transmit the state (locked /unlocked)?

Need to decide between this solution and the keyfob hack

It’s totally true that it have incremented battery consumption, I have used it during one week and I have chargued it one time. It’s not too much at least for me, I’ll tell you all when I will experiment more chargue cycles.

For sure, I know all time the lock state because touching the phisical switch or doing it over MQTT, it goes across the esp8266.

I have tested it only for a week but it’s working really good, as soon as I connect the battery it connects to the wifi. I’ll update it using node-red and sensors as touch sensor, bluetooth beacons and wifi tracker.

The key solution it’s maybe easier but as much as I know, it is not compatible with all the lock versions, just with the last.

Hello guys, I have a vertical lock but i’m not able to mount the system vertically (no space with my door). Is there any solution so the key comes back in the vertical position by default after it finishes to close the door? (so i can open it from outside with my key?) Something like a configuration from the sherlock smartlock? Thanks

I asked sane question to a YouTuber, he said no.

That’s why the instructions specifically say to mount it as shown in the manual only.
But if you apply the keyfob hack, you open with your cellular

I think that the best solution it’s change the cylinder, using one with double clutch. It allows you to use one key inside and one key outside. It’s not expensive, it’s easy to install and it provides you safety because if the battery is out or for some reason the lock is not working, you will be able to open the door.

I’m currently trying to bypass the default horizontal detection by cutting a new corner on the last plastic circle so it will stop vertically instead of horizontally, I will come back here to show you the result

1 Like

I forget to take photos but i successfully manged to make the sherlock S2 work with vertifical lock by stop up the 2 whole from the last mechanism circle which contains the metal part (the key). After removing the 2 whole, i have created one at 90° so the system stops vertically

1 Like

Trying but having really a hard time

Did you find a solution for this problem?

A separate battery for the esp device could work well I think. How much power does it use? Also is there a way to modify the lock to work with the Xiaomi ZigBee devices?

I have a door sensor from Xiaomi and I would like to make the lock, lock the door when ever the sensor detects a locked door

srborines
Thank you very much. Great job!
Can you give the settings for HASS, I try this but i have a problem with state.Thank you!

lock:

  • platform: mqtt
    name: Frontdoor
    state_topic: “door/available”
    command_topic: “door/action”
    payload_lock: “0”
    payload_unlock: “1”
    optimistic: true
    qos: 1
    retain: true
    value_template: ‘{{ value.x }}’

The state topic is “door/status”. The topic “door/available” is just published when you start the lock the first time. So you would have to config it like this:

platform: mqtt
name: Frontdoor
state_topic: “door/status”
command_topic: “door/action”
payload_lock: “0”
payload_unlock: “1”
optimistic: true
qos: 1
retain: true
value_template: ‘{{ value.x }}’
1 Like

I am not sure about that but I’ll check it in some days because I’m gonna this way (https://github.com/Koenkk/zigbee2mqtt) to control xiaomi ZigBee devices. I’ll let you all know!

I was wrong here. I mean, if the cylinder has double clutch when you introduce the key from outside you’ll not move the other key and you can open but you’ll have to do really really a lot of force against the xiaomi sherlock motor and that’s not right at all.

So the best solution is use a simple clutch cylinder (due the lock has a way that when the key is horizontal you can insert a key from outside and you’ll “disconnect” the inside key from the lock motor) or if you have a vertical cylinder it’s a really great solution what nishanthGit said!