M5Stack Tab5 + ESP-IDF + LVGL โ a full-featured Home Assistant control tablet, Frigate viewer, and sensor bridge.
This project extends the official M5Tab5 User Demo firmware into a beautiful, animated home control panel.
Links to key design and documentation resources:
-
docs/TASKS.md: prioritized roadmap for milestone planning. -
docs/ARCHITECTURE.md: firmware structure and runtime data flow. -
docs/ASSETS.md: asset pipeline expectations and QA checklist. -
docs/AI_GUIDELINES.md: workflow rules for AI-driven contributions. -
Navigation Rail Preview
- Persistent left rail with icon buttons for Rooms, Frigate Security, Local Climate Station, TV Controls, and Settings.
- Tap a destination to reveal a full-bleed gradient backdrop (
linear-gradient(90deg, #fcff9e 0%, #c67700 100%)). - Cards, buttons, and title bars share softened 16 px radii and shadows to match the hardware aesthetic.
-
First Page: Rooms Dashboard The tablet boots directly into the Rooms view for lighting and scene control.
-
Second Page: Landscape-first dashboard (1280ร720)
At-a-glance view of lights, climate, security, and media from Home Assistant. -
Third Page: Frigate Notifications+ Cameras Shows last detection in a intelligently parsed format along with camera name, time and object.
- Live local stream (HLSโMJPEGโsnapshot fallback)
- Swipe camera carousel
- Event timeline with thumbnails & PiP viewer
-
Fourth Page: Sensors Data, Visualizations, Charts Shows Sensors stats from Home Assistant
- Nice Charts for history.
- More details and parsed sensor data.
-
Features List:
-
Home Assistant Integration (MQTT Discovery)
Seamless integration with local Home Asssistant via MQTT.- Toggle lights, fans, switches with state sync & animated controls.
- View real-time sensor states with charts.
- Control climate, media players and Android TVs.
- Trigger scenes and automations.
-
Voice Control
Using Tab5 Mics & Speakers with HA- Wake-word detection on-device
- Audio routed through ES8388 mic/speaker
- Forward to Home Assistant Assist or external LLM
-
Tab5 Sensor Exposure Using stuff from base code, we get and publish these states to HA:
- Battery voltage/current, charging state
- Touch, button, and IMU events
- Audio levels & speaker status
- Publish via MQTT for HA use
-
Control Center
- Brightness slider (backlight light entity)
- Volume & mute
- Quick toggles: Do Not Disturb, Auto-brightness
- Sleep & restart controls
-
Developer Experience
- Modular LVGL components (
ui_home,ui_rooms,ui_security,ui_control_center) - Design tokens & wireframes in
docs/for AI/assistants - CI-friendly (ESP-IDF build, firmware artifacts)
- Modular LVGL components (
Install the repo's clang-format hook locally with pre-commit:
pip install pre-commit # once per machine
pre-commit installRunning pre-commit install configures Git to automatically run clang-format on
changed files before each commit.
For manual formatting or static analysis runs, use the consolidated helper in
tools/clang_tools.sh:
./tools/clang_tools.sh format # clang-format across tracked sources
./tools/clang_tools.sh tidy # clang-tidy using compile_commands.json
./tools/clang_tools.sh fix # format + clang-tidy --fixThe repo base is forked from default demo of M5Stack Tab5. Our custom data is in the following folders:
- docs/ โ wireframes, AI guides, design tokens
- custom/ui/ โ LVGL UI modules
- custom/integration/ โ MQTT + HA + Frigate glue code
- custom/platform/ โ Display, input, audio, power drivers
- custom/assets/ โ Shared UI assets (fonts, icons, future binaries)
See
docs/wireframes.mdfor the low-fi design spec anddocs/AI_Codex_Guide.mdfor AI coding guidelines.
- Custom home screens render a built-in gradient background, so no wallpaper assets are flashed or loaded from storage.
- ESP-IDF v5.4.2 (tested with the ESP32-P4 target)
- Python 3.8+ (for build scripts)
- Toolchain installed per Espressif instructions
- libusb-1.0 runtime (required by OpenOCD). On Debian/Ubuntu install via
sudo apt-get install libusb-1.0-0; on macOS usebrew install libusb.
Tested with ESP-IDF v5.4.2 for esp32p4; newer releases may require additional fixes.
Optional:
- Mosquitto broker + Home Assistant for end-to-end testing
- Frigate (or any RTSP/MJPEG camera source)
-
Clone the repo
git clone https://github.com/baba-dev/M5Tab5-UserDemo.git cd M5Tab5-UserDemo -
Select the Tab5 platform
cd platforms/tab5 -
Set ESP32-P4 target
idf.py set-target esp32p4 Only required once per build directory unless you clean the build output. -
Build firmware
idf.py build -
Configure (optional)
idf.py menuconfig Set Wi-Fi SSID & password (or flash once and store in NVS). Set MQTT broker URI & credentials.
Every release publishes a browser flasher at GitHub Pages (Settings โ Pages).
Open: https://baba-dev.github.io/M5Tab5-UserDemo/flash.html
This uses ESP Web Tools to flash firmware.bin described by manifest.json.
(Install button is loaded via the official script CDN.)
Connect Tab5 over USB-C. Run the following from platforms/tab5/.
Flash:
idf.py -p /dev/ttyACM0 flash
Monitor logs:
idf.py monitor
Exit with Ctrl+].
ESP-IDF 5.4.2 bundles the supported ESP32 Wi-Fi remote under
$IDF_PATH/components/espressif__esp_hosted/slave. Flash that image once per
Tab5 so the SDIO link comes up reliably:
cd $IDF_PATH/components/espressif__esp_hosted/slaveidf.py set-target esp32idf.py buildidf.py -p <remote_port> flash
The build output produces build/network_adapter.bin if you prefer to flash via
esptool.py. Shipping units use CONFIG_SLAVE_IDF_TARGET_ESP32, so the ESP32-C6
firmware is no longer stored in this repository. Host any experimental C6 image
as an external download and link it from the docs instead of committing binaries.
-
Ensure Mosquitto or other MQTT broker is running.
-
Enable MQTT Discovery in HA.
-
After boot, entities (lights, switches, sensors) will appear automatically.
-
Optionally configure automations to send control payloads back to Tab5 (e.g., set brightness, trigger scenes).
-
Use LVGL debug overlay (if enabled) to monitor FPS and heap usage.
-
Check integration/mqtt_contract.h for topic map and extend as needed.
-
Test camera performance with multiple stream types; pick best one for latency.
Run scripts/update_goldens.sh after UI changes to refresh the LVGL golden screenshots used by snapshot tests.
-
Follow docs/AI_Codex_Guide.md for consistent code style and PR scope.
-
Open small PRs for each feature (UI screen, component, or binding).
-
Include screenshots or short videos of the UI changes in PR descriptions.
-
Keep design tokens and wireframes up to date when introducing visual changes.