mirror of
https://github.com/sudoxnym/roomba_rest980.git
synced 2026-04-14 11:37:46 +00:00
## Problem Roomba i3 models were frequently showing "unknown" status in Home Assistant instead of proper vacuum states (cleaning, docked, returning, etc.). This was caused by incomplete status mapping for the i3 model's specific status reporting format. ## Root Cause Analysis 1. **Incomplete phase mapping**: i3 models rely more heavily on phase data than cycle data for status reporting 2. **Missing model-specific logic**: i3 models (SKU starting with R3) report status differently than i7/s9 models 3. **Insufficient fallback handling**: No proper fallback when status combinations weren't recognized 4. **Null pointer exceptions**: Missing runtime stats causing crashes in LegacyCompatibility and sensor calculations ## Solution Implemented ### Enhanced Status Detection (vacuum.py) - **Comprehensive phase-to-activity mapping**: Added PHASE_MAPPING dict for reliable i3 status detection - **Model detection**: Automatically detects i3 models and applies model-specific handling - **Improved error handling**: Better error state detection for various error codes and not_ready states - **Battery state logic**: Special handling for low battery and charging states on i3 models - **Debug logging**: Enhanced logging to identify and debug unknown status combinations ### Null Safety Fixes (LegacyCompatibility.py & sensor.py) - **Safe attribute access**: Added null checks for runtimeStats, signal, bbmssn, and bbrun objects - **Graceful calculation handling**: Proper fallback values for missing time/area data - **Sensor error prevention**: Default values (0) for missing runtime statistics ### Configuration Entry Stability (__init__.py) - **State validation**: Added ConfigEntryState.LOADED check before forwarding platform setups - **Improved error isolation**: Cloud coordinator failures no longer prevent main integration functionality - **Better logging**: Enhanced error messages for debugging setup issues ## Testing - Tested with Roomba i3 model showing previous "unknown" status - Verified proper status reporting for all vacuum states - Confirmed backward compatibility with i7/s9 models - No more TypeError exceptions from null runtime stats ## Benefits - ✅ Eliminates "unknown" status for Roomba i3 models - ✅ More accurate and responsive status reporting - ✅ Better user experience with proper vacuum state visibility - ✅ Enhanced debugging capabilities for future status mapping issues - ✅ Improved integration stability and error resilience - ✅ Prevents crashes from missing data fields Fixes: Roomba i3 status unknown issue |
||
|---|---|---|
| .. | ||
| roomba_rest980 | ||