Automating Bathroom Mirror Clock with Raspberry Pi: A Fun Project!

Hey everyone, I wanted to share a fun project I recently completed that’s been a lifesaver in my daily routine. I’ve been using a Raspberry Pi to control my bathroom mirror’s built-in digital clock, and it’s been working like a charm!I purchased this sleek bathroom mirror that boasts a digital clock, but the catch was that the clock could only be set via Bluetooth. Initially, I used a smartphone app to synchronize the time, but I quickly grew tired of manually resetting it every time the power went out. That’s when I decided to automate the process using my Raspberry Pi.The mirror’s Bluetooth module was a bit of a mystery at first. It didn’t have any obvious branding, just a Bluetooth name “YMIOT-BT.” After some digging, I discovered it was manufactured by Shenzhen Yuming Electronics. To understand how it communicates, I used Wireshark to capture the Bluetooth traffic. Turns out, the time is transmitted in plain text, which made it easier to decode and replicate.Here’s a quick breakdown of how I set it up:1. Bluetooth Discovery: I used the Raspberry Pi’s Bluetooth capabilities to detect the mirror’s device.2. Script Development: I wrote a Python script that connects to the mirror and sends the current system time.3. Cron Job Automation: To ensure the clock updates daily, I scheduled the script to run every 12 hours using cron.The best part? Now, I don’t have to worry about the clock losing time during power outages. It’s automatically set when the power comes back on, saving me from the hassle of resetting it manually.This project was a great way to combine my love for DIY tech projects with practical home automation. If anyone else is looking to tackle a similar project, feel free to reach out—I’d be happy to share more details or help troubleshoot any issues!Cheers to all the Raspberry Pi enthusiasts out there—let’s keep innovating and making our homes smarter one project at a time! :rocket::sparkles: