feat: add Home Assistant integration and improve CLI/UI

Home Assistant Integration:
- New homeassistant.py module with webhook support
- Webhooks for scan results, new devices, and device departures
- Absence detection with configurable timeout
- Documentation in docs/HOME_ASSISTANT.md

CLI Improvements:
- Replace 'web' command with start/stop/restart/status
- Background daemon mode with PID file management
- Foreground mode for debugging (--foreground)

Web UI Enhancements:
- Improved device list styling and layout
- Better floor assignment UI
- Enhanced map visualization

Documentation:
- Add CHANGELOG.md
- Add docs/API.md with full endpoint reference
- Add docs/CHEATSHEET.md for quick reference
- Update project documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
User
2026-02-01 03:31:02 +01:00
parent 0ffd220022
commit 7cc7c47805
16 changed files with 2704 additions and 108 deletions

78
CHANGELOG.md Normal file
View File

@@ -0,0 +1,78 @@
# Changelog
All notable changes to RF Mapper are documented here.
Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
---
## [0.3.0] - 2026-02-01
### Added
- **3D Map Visualization** - MapLibre GL JS integration with building extrusion
- **Floor-based positioning** - Assign devices to floors, filter by floor
- **SQLite database** - Historical device tracking with 7 tables
- **Historical data API** - 15+ new endpoints for device history, stats, alerts
- **Live BT tracking mode** - 4-second scan interval with auto-start
- **Movement detection** - Statistical analysis (5-sample avg + 2σ threshold)
- **bleak BLE scanning** - Reliable RSSI via D-Bus/BlueZ (replaced hcitool)
- **Floor persistence** - Floor assignments saved in database
- **Popup persistence** - Device popups stay open during live updates
- **Custom distance override** - Manual distance setting via popup
- **Position smoothing** - Statistical averaging for stable positions
- **Filter-aware scanning** - Skip WiFi/BT based on toggle state
- **Auto-scan feature** - Background scanning with configurable interval
- **Device labeling** - Custom names via API
- **Favorite devices** - Mark important devices
- **Alert system** - New device detection, activity alerts
- **Activity patterns** - Hourly/daily usage analysis
- **Database cleanup** - Automatic and manual data retention
### Changed
- Switched from `hcitool` to `bleak` Python library for BLE scanning
- Improved distance estimation algorithm
- Enhanced web UI with real-time updates
### Fixed
- BT RSSI acquisition now reliable (bleak library)
- Floor assignments persist across page reloads
- Popups no longer close during live tracking
---
## [0.2.0] - 2026-01-25
### Added
- **World Map view** - Leaflet.js integration with device markers
- **2.5D visualization** - Height-based display
- **Auto-identify Bluetooth** - Device type inference from name/manufacturer
- **OUI lookup** - Manufacturer identification from MAC address
- **Signal quality indicators** - Visual strength representation
- **Request profiling** - Optional per-request performance analysis
- **Request logging** - Optional request logging to file
### Changed
- Improved CLI output formatting
- Better error handling for scan failures
---
## [0.1.0] - 2026-01-15
### Added
- Initial release
- **WiFi scanning** - Uses `iw` command
- **Bluetooth scanning** - Uses `hcitool` and `bluetoothctl`
- **CLI interface** - scan, visualize, analyze, list, config commands
- **Web interface** - Flask-based dashboard
- **Radar visualization** - ASCII and web-based radar view
- **Distance estimation** - RSSI-based path loss model
- **Configuration system** - YAML config with environment variable overrides
- **JSON data storage** - Scan results saved as JSON files
- **GPS support** - Reference position for mapping