r/raspberry_pi • u/t1m0thyj • 9d ago
Show-and-Tell Turned a $30 Bluetooth pixel clock into a smart weather clock with my Pi
A few months ago I ordered this $30 pixel clock on Amazon: https://www.amazon.com/dp/B0GY3BX9QC
It has a 32x16 LED matrix and is advertised as programmable but the customization is limited to a list of presets in the companion mobile app. And it loses time whenever there is a power outage, requiring me to manually connect over Bluetooth in the app to re-sync the time.
Since I didn't love any of the presets, I gave the app APK to Claude and asked it to reverse engineer the Bluetooth communication. It successfully did so and now I can fully manage the clock without the app, including updating the display, adjusting LED brightness, and syncing the time.
The code for controlling the clock and instructions to use it are on GitHub: https://gist.github.com/t1m0thyj/4445e29c1520ac2764489865ae40da86
Now I have the following automations powered by the iledclock.py driver script on my Pi 3:
- Background image is refreshed every 30 min to show weather info (current temperature and 2-frame animation of conditions), which is retrieved with the free OpenMeteo API.
- Brightness is adjusted to match ambient brightness in the room, using
gpiozero.LightSensorto read data from an LDR (Light-Dependent Resistor). - Time is synced when the clock controller script starts (whenever the Pi reboots after a power outage), and every 24 hours to prevent clock drift.
I've not shared the code for these automations yet, as they are heavily customized for my setup (e.g., the LDR readings are shared by another Python script over a socket). But I'll share relevant snippets if anyone is interested.
8
u/Gizmo45 9d ago
How does the Pi control it? Is it mounted inside the enclosure?
4
u/N72826 8d ago
I recently did the same thing for my aquarium lights!
3
u/viper2035 8d ago
Very cool project. Do you have any interest to make an home assistant add-on for the display?
3
u/lamyjf 8d ago
Would be nice to just use the clock as a countdown timer, can that be done? (no need for the bottom part.)
2
u/Zealousideal_Ad5358 6d ago
3
u/dearmash 8d ago
I have a different clock I use webserial to connect to over bt from the browser, I'll have to try and see if I can get that working with this also.
Thanks for the write up!