Exploring ESPHome for a Custom Door Lock Project

Hello everyone, I wanted to share my recent experience with ESPHome and my journey into creating a custom PoE door lock system. This project has been a fantastic learning opportunity and I thought I’d walk through some of the highlights and challenges I encountered along the way.

Project Overview

I’ve always been intrigued by the idea of integrating technology into everyday objects, and my door lock was no exception. The goal was to create a system that not only provided secure access but also incorporated modern smart home features like TOTP (Time-based One-Time Password) codes and face recognition. After some research, I decided to use an ESP32-S3 module paired with a Wiznet5500 Ethernet module for the PoE functionality. This setup allowed me to power the device directly over Ethernet, which was a significant advantage in terms of wiring and convenience.

TOTP Implementation

One of the key features I wanted was the ability to generate TOTP codes. This ensures that even if someone observes the code being entered, it becomes useless after a short period. Implementing this required a bit of tinkering with the ESP32’s timekeeping capabilities and ensuring the code generation was both secure and reliable. The result has been seamless, with the keypad automatically cycling through codes every 30 seconds.

Face Recognition Integration

Another aspect I found particularly exciting was integrating face recognition. I utilized Frigate, which provided a robust framework for detecting and recognizing faces. The system communicates with my security module over UDP to determine the door’s status, enabling features like auto-locking when the door is opened. This integration has worked flawlessly for several months now, and it’s been a joy to see it in action.

Challenges and Solutions

One of the initial hurdles was managing the limited connections on the Wiznet5500 module. I had ambitious plans to add Apple HomeKey support, but the hardware constraints made it challenging. However, I managed to work around this by implementing a button on the lock screen to handle unlocking, which proved to be a practical solution.

Another challenge was routing the wires through my metal door. I opted for a creative approach using a coat hanger to thread the wires through the foam core, which turned out to be much easier than anticipated. This method also allows for easy replacement if the wires become brittle over time.

Future Plans

While the project is already functional, there are several enhancements I’m eager to implement. I’m particularly interested in adding Android tap-to-unlock functionality, which would provide a seamless user experience. Additionally, I’ve been experimenting with palm vein scanning, though this remains a longer-term goal due to its complexity.

Conclusion

This project has been an incredible journey, blending hardware hacking with software development. ESPHome has proven to be an invaluable tool, offering the flexibility and power needed to bring this vision to life. I’m excited to continue refining the system and exploring new features that can enhance its functionality and integration within my smart home ecosystem.

If anyone has questions or suggestions, I’d be happy to discuss further! Happy tinkering! :rocket: