Smart Bulb Automation
Self-hosted home automation system reviving orphaned smart bulbs with open Tasmota firmware, an Express TypeScript MQTT service, and an installable PWA dashboard.
This project started with a practical frustration at home.
We had smart bulbs that worked mechanically, but the company behind them shut down. Their cloud servers went offline, the mobile app was pulled from app stores, and functional hardware turned into electronic waste.
I treated it as a hardware recovery project: reflash the bulbs with open firmware and build a private control system that did not rely on someone else's cloud infrastructure.
Technical architecture and communication pipeline
The system replaces proprietary vendor APIs with open standards and a lightweight web service:
1. Firmware and local protocol migration (Tasmota)
I reflashed the bulbs with open-source Tasmota firmware, unlocking direct local Wi-Fi and MQTT control:
- Configured the bulbs to connect securely to a private cloud MQTT broker over TLS (MQTTS).
- Enabled discovery and state telemetry reporting, eliminating vendor lock-in completely.
2. Backend service (Express, TypeScript, and MQTT.js)
An Express.js and TypeScript backend acts as the bridge between web clients and the MQTT message broker:
- Two-way state synchronization: subscribes to Tasmota's
stat/,tele/, anddiscoverytopics to track state changes from physical wall switches or remote commands. - Command dispatch: publishes targeted commands to
cmnd/topics for full power toggling, white ambiance (153 mired warm to 500 mired cool), RGB hue/saturation sliders, and brightness dimming (0% to 100%). - Request validation with Zod: strictly validates payload schemas before sending commands to hardware, preventing invalid parameters from crashing the microcontroller.
- Structured logging with Winston: captures connection drops, message acknowledgements, and device telemetry.
- Mandatory API key authentication: protects every endpoint so unauthorized network requests cannot access home fixtures.
- Live device diagnostics: reports real-time Wi-Fi RSSI signal strength, firmware version, uptime, and restart reasons alongside an embedded MQTT debug log console.
3. Progressive Web App frontend (Tailwind CSS and Service Worker)
The client interface was built for fast daily use:
- Built with responsive Tailwind CSS designed around touch targets and one-handed mobile operation.
- Includes a service worker (
service-worker.js) that caches core UI assets offline and enables full PWA installation on iOS and Android home screens. - Implements optimistic UI updates: the button responds immediately while the backend confirms state transition via the MQTT broker.
Why it stayed
My family still uses this dashboard daily.
It is one of my favorite projects because it solved an immediate household problem with clean software engineering. Instead of discarding functioning hardware, it gave the devices a second life on open protocols that will never expire due to a vendor shutdown.