github francescopace/espectre 2.0.0
v2.0.0 - ESPHome Native Integration

latest releases: 2.3.0, 2.2.0, 2.1.0...
one month ago

๐Ÿš€ Major - ESPHome Native Integration

Complete platform migration from ESP-IDF to ESPHome

This release represents a major architectural shift from standalone ESP-IDF firmware to a native ESPHome component, enabling seamless Home Assistant integration.

โš ๏ธ Note: Extensively tested on ESP32-S3 and ESP32-C6, but bugs may still exist. Community contributions, bug reports, and support for additional ESP32 variants are welcome!

๐ŸŽฏ Two-Platform Strategy

ESPectre now follows a dual-platform development model:

Platform Role Focus Target
ESPectre (ESPHome - C++) Production Motion detection only Smart home users, Home Assistant
Micro-ESPectre (Micro Python) R&D Features + Filters for research Researchers, developers, academics

ESPectre focuses on core motion detection for Home Assistant integration.
Micro-ESPectre provides features (variance, skewness, kurtosis, entropy, IQR, spatial_, temporal_) and advanced filters (Butterworth, Wavelet, Savitzky-Golay) for research/ML applications.

New Architecture:

  • Native ESPHome component: Full C++ implementation as ESPHome external component
  • Home Assistant auto-discovery: Automatic device and sensor registration via Native API
  • YAML configuration: All parameters configurable via simple YAML files
  • OTA updates: Wireless firmware updates via ESPHome

Implementation:

  • components/espectre/: Complete ESPHome component with Python config and C++ implementation
  • Modular C++ architecture: calibration_manager, csi_manager, sensor_publisher, etc.
  • Binary sensor for motion detection
  • Movement score sensor
  • Adjustable threshold (number entity) - controllable from Home Assistant

๐Ÿ”„ Micro-ESPectre

R&D Platform for Wi-Fi CSI Motion Detection - Pure Python implementation for MicroPython

Micro-ESPectre is the research and development platform of the ESPectre project, designed for rapid prototyping, algorithmic experimentation, and academic/industrial research. It implements motion detection algorithms in pure Python, enabling fast iterations without compilation overhead.

Key Features:

  • โšก Instant Deploy: ~5 seconds to update code (no compilation)
  • ๐Ÿ”ง MQTT Integration: Runtime configuration via MQTT commands
  • ๐Ÿงฌ Auto Calibration Algorithm: Automatic subcarrier selection (F1=97.1%)
  • ๐Ÿ“Š Analysis Tools: Complete suite for CSI analysis and algorithm optimization
  • ๐Ÿงฎ Feature Extraction: Statistical features (variance, skewness, kurtosis, entropy, IQR)
  • ๐ŸŽฏ Confidence Score: Experimental motion detection confidence estimation
  • ๐Ÿ’พ NVS Persistence: Persistent configuration on filesystem

Advanced Applications (ML/DL ready):

  • ๐Ÿ”ฌ People counting
  • ๐Ÿƒ Activity recognition (walking, falling, sitting, sleeping)
  • ๐Ÿ“ Localization and tracking
  • ๐Ÿ‘‹ Gesture recognition

Dependencies:

  • micropython-esp32-csi - Custom MicroPython fork with native CSI support for ESP32 family
  • MQTT broker (e.g., Mosquitto)

๐Ÿงช Test Suite Refactoring

Migration from Unity (ESP-IDF) to PlatformIO Unity for ESPHome consistency

The test suite has been migrated from ESP-IDF's Unity framework to PlatformIO Unity, aligning with the ESPHome ecosystem and enabling native (desktop) test execution without hardware.

Complete test suite with 68 test cases organized in 5 suites and Memory leak detection:

Suite Tests Focus
test_csi_processor 19 API, initialization, validation, memory management
test_hampel_filter 16 Outlier removal filter behavior
test_calibration 21 NBVI algorithm, variance, percentile calculations
test_calibration_file_storage 9 Calibration persistence and file I/O
test_motion_detection 3 MVS performance with real CSI data (2000 packets)
# Run tests locally
cd test && pio test -e native

๐Ÿ”„ CI/CD Pipeline

GitHub Actions integration for automated quality assurance

  • Automated testing: Runs on push to main/develop and pull requests
  • ESPHome build verification: Compiles espectre.yaml to validate component
  • Status badge: Real-time CI status displayed in README
  • Path filtering: Only triggers on changes to components/espectre/ or test/

Don't miss a new espectre release

NewReleases is sending notifications on new releases.