---
name: smart-home-and-maker
description: "Smart home automation (Home Assistant, Zigbee, Tuya) and custom maker electronics (ESP32, LVGL, BLE dashboards)."
---

# Smart Home & Maker Electronics

Comprehensive guide for home automation and custom hardware development.

## Home Assistant (ZimaOS Docker)

Manage a Home Assistant instance running as a Docker container on ZimaOS.

### Status & Config
- Port: **8123**
- Config: `/DATA/AppData/homeassistant/config/`
- API: Requires Long-Lived Access Token.

### Inspection & Management
- Use `docker exec` for status checks.
- Read `.storage/` JSON directly if no API token (Device/Entity/Area registries).
- Zigbee support via USB dongles (Sonoff, SkyConnect).
- WiFi/Tuya support (TP-Link Kasa, Amazon Basics via LocalTuya/Smart Life).

### API & Control
- REST API on port 8123.
- Use `curl` with Bearer token.
- Refresh-token exchange for temporary JWTs.

## Maker Electronics: ESP32 Dashboards

Full workflow for building ESP32-based desk dashboards (AMOLED, LVGL, BLE).

### Hardware Platform
- **Waveshare ESP32-S3-Touch-AMOLED-2.16** (8MB PSRAM, 480x480 AMOLED).

### Firmware & UI (LVGL)
- C++ / PlatformIO.
- PSRAM must be OPI (`qio_opi`).
- Software rotation in `flush_cb`.
- LVGL 9 font patching required.

### Communication (BLE)
- Custom BLE GATT service for data/HID.
- Host-daemon (Python) polls data and pushes via BLE.

## Common Pitfalls
- **Home Assistant**: Long-lived tokens are hashed; exchange refresh tokens for headless access.
- **Tuya**: Bulbs must be paired via Smart Life app (not just Alexa) to enable Tuya LAN.
- **ESP32**: PSRAM is mandatory for LVGL; check memory type in `platformio.ini`.
