A hands-on smart home assistant that blends hardware, messaging systems, and AI-driven control through user command and AI auto context awareness.
ASHA (Agentic Smart Home Assistant) is a smart home control system built around events, like motion detected or door opened,lights turned on etc, not buttons.
Instead of hard-coding logic everywhere, ASHA uses:
- 🟠 ESP32 hardware
- 🟣 MQTT (event messaging)
- 🔵 Modular software design
- 🟢 AI agents for decision-making
The goal is simple:
🔁 Something happens → a message is sent → the system reacts(uses a custom AI to do something) You want to turn on the light by just talking to your AI assistant? or give it a custom command without hard coding it?
example: "Hey ASHA, if I'm home turn on the blue light, whenever my mom comes home lower the termperature, if it gets dark outside turn on the porch light, call the nanny's phone when you hear the baby cry, turn of all the lights at 11pm, if the current starts fluctuating turn off the main power supply"
"ASHA, enter auto mood"
-
ASHA uses carefully trained data to manage home security, lighting, temperature, and other systems by it self. EXAMPLE: you can put asha in auto-mood and it knows that "I have to save electricity so if no one is home turn off all the lights and lower the temperature," or "i have to protect the house so if I hear a loud noise turn on all the lights and sound the alarm."
2.An automatic mode where ASHA uses its AI capabilities to learn your habits and preferences over time, adjusting the home environment accordingly without explicit commands. For example, it can learn when you usually arrive home and preemptively turn on the lights and adjust the thermostat to your preferred settings.
because home automation should be: free, flexible, and not owned by big corporations only.
+------------+ MQTT +----------------+
| Laptop / | ─────────────▶ | ESP32 |
| Python / | | (LED / Sensors)|
| AI Agent | ◀───────────── | |
+------------+ Events +----------------+
|
|
MQTT Broker
(Mosquitto)
Key idea:
📢 ESP32 does not “listen to commands” — it listens to events
| Component | Purpose |
|---|---|
| ESP32 | Hardware control (LEDs, sensors) |
| MQTT | Event-based communication |
| Mosquitto | MQTT broker |
| PlatformIO + VS Code | Development environment |
| C++ | Firmware |
| Python | AI / automation layer |
| HTTP | MQTT |
|---|---|
| Request → Response | Event-driven |
| Heavy | Lightweight |
| Needs constant polling | Instant push |
| Not ideal for IoT | Built for IoT |
MQTT allows:
- Real-time control
- Device-to-device communication
- Two-way messaging (commands + feedback)
- Easy scaling
ASHA/
├── src/
│ ├── main.cpp # ESP32 entry point
│ ├── core/ # Startup & system setup
│ ├── helpers/ # Tools & utilities
│ └── handler/ # MQTT logic (callbacks, handlers)
│
├── platformio.ini
├── pyproject.toml
└── README.md
🧠 Mixing folders like core/ and helpers/ is intentional — it mirrors real software architecture.(also, because No one ever taught me what real folder structure should look like)
Topics are NOT folders — they are routing labels.
home/led/yellowhome/led/main
Example:
home/led/yellow → ON
Means:
“Something wants the yellow LED to turn ON”
- ESP32/your own microcontroller connects to WiFi
- ESP32/your own microcontroller connects to MQTT broker
- ESP32/your own microcontroller subscribes to:
home/led/# - A message is published
- ESP32/your own microcontroller receives event
- Callback function runs
- Hardware reacts by JUST natural LANGUAGE PROCESSING (no hard coding).
mosquitto -vmosquitto_sub -h localhost -t "home/led/#" -vmosquitto_pub -h localhost -t home/led/yellow -m ON
mosquitto_pub -h localhost -t home/led/yellow -m OFF🎉 LED responds instantly.
- Event-first, not command-first
- Loose coupling
- Hardware reacts, software decides, AI BRAINS
- Ready for:
- AI agents
- Context awareness
- Multiple devices
- Long-range communication (LoRaWAN)
- 🔁 Two-way feedback (sensor → MQTT)
- 🧠 AI decision engine (MCP-style agents)
- 📡 LoRaWAN support for long-range devices
- 🔐 Secure MQTT (auth + TLS)
- 📱 Mobile dashboard
ASHA is not just a project.
It’s:
- A learning sandbox
- A real-world architecture
- A foundation for agentic systems
- A smart home assistant that grows with its creator
Simple today. Powerful tomorrow.
⚡ PlatformIO Docs 💬 Mosquitto MQTT ⭐ GitHub Repo
[ ] Add PWM support. [ ] currently the LLM will publish to "home" topic... but what if i want to turn of the light in the bedroom instead of hall... This generic approach fall shot. Solution can be simple as this: have a SSOT (single source of truth) file that maps the pins to their locations(what could go wrong?) [ ] When a user says something like "turn on the light" we should have a simple way of knowing where the user is located (so we can turn on the light in that room)... maybe use bluetooth beacons or wifi triangulation?