Commit graph

49 commits

Author SHA1 Message Date
sudoxnym
d70ec6973f Fix Roomba i3 status showing "unknown" - Enhanced status mapping and error handling
## 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
2025-10-02 01:34:14 +00:00
ia74
666b624510 Message 2025-09-07 19:43:11 -05:00
ia74
975128885c - Add some Mop attributes to the sensors list 2025-09-07 19:38:02 -05:00
ia74
84f425522c - Revert mistake from 1.14.0 to 1.13.0 2025-09-07 19:22:11 -05:00
ia74
f168ae46a6 - Fix HA Lost connection (WebSocket) when open the camera entity
Fixes #3 by including OpenSans font
2025-09-07 19:21:11 -05:00
ia74
b52ecf6e33 Test 2025-08-18 07:23:04 -05:00
ia74
6812721c47 Merge branch 'main' of https://github.com/ia74/roomba_rest980 2025-08-17 20:22:31 -05:00
ia74
c3aefa8a21 - Fixes #2
- Make camera image async
- Bump to v1.12.0
2025-08-17 20:22:29 -05:00
Aiden
7b24e91eb8
Update README.md 2025-08-15 00:12:25 -05:00
Aiden
fc32ed282f
Update README.md 2025-08-13 17:47:25 -05:00
ia74
75d4429233 more granularity on what the activity is 2025-08-12 17:31:53 -05:00
ia74
b9c9e1a897 - add errors to auth & automatically reauth
- make mapping cleaner
- fix device info not fully showing
- add not ready and error sensors
2025-08-12 17:17:59 -05:00
Aiden
699310c93c
Update README.md 2025-08-09 13:48:43 -05:00
ia74
c2d46895b2 fidx that too 2025-08-09 01:20:17 -05:00
ia74
292a97e33b improt decode erorr 2025-08-09 01:19:07 -05:00
ia74
42c6a09b11 add back issue tracker i DO NOT KNOW HOW THAT GOT AWAY 2025-08-09 01:09:22 -05:00
ia74
8904c9349f i goofed the entry/entity/unique ids when i replaced them and some identifiers that broke the config entries 2025-08-09 01:06:45 -05:00
ia74
336499f9d1 turn off UMF saving 2025-08-09 00:58:55 -05:00
ia74
78f605e5ce its still same keys 2025-08-09 00:54:49 -05:00
ia74
e72009ff03 now will hacs like me (add issue_tracker) 2025-08-09 00:51:26 -05:00
ia74
b035324c2f move to runtime_data and work on bronze 2025-08-09 00:49:29 -05:00
ia74
d310a8441f check if active mission, otherwise dont show start/elapsed time 2025-07-27 16:15:03 -05:00
ia74
cad8af474b Don't show mission start time, if it's a previous command and not active 2025-07-25 09:01:11 -05:00
ia74
8d62f4b534 Dynamic icon 2025-07-25 08:40:19 -05:00
ia74
fdb079e3af test rooms 2025-07-25 08:35:36 -05:00
ia74
7a4b72b3a8 yea 2025-07-25 08:26:54 -05:00
ia74
76cecb966e oh i just have to make it that 2025-07-25 08:26:42 -05:00
ia74
d04f64a4a1 version bump 2025-07-25 08:24:24 -05:00
ia74
7fb598988d make 1/8 2025-07-25 08:24:14 -05:00
ia74
a7b540dc1a calibration? 2025-07-25 08:17:42 -05:00
ia74
87a51117b3 remove debug feat 2025-07-24 19:05:07 -05:00
ia74
a74b846bc2 1.5 2025-07-24 19:01:07 -05:00
ia74
bfa11c4d59 Test camera 2025-07-24 19:00:45 -05:00
ia74
8e6f8799fb fix the alphabet 2025-07-24 17:32:53 -05:00
ia74
71004308bc 1.4.1 2025-07-24 16:26:39 -05:00
Aiden
ba9553a128
Add HACS validation 2025-07-24 16:22:39 -05:00
Aiden
e6e7b08811
Add hassfest 2025-07-24 16:21:36 -05:00
ia74
23177f2abf Add favorites 2025-07-24 16:17:57 -05:00
ia74
d4803cf4b4 raedme 2025-07-21 17:46:41 -05:00
ia74
74b3b6e478 make better 2025-07-21 17:44:58 -05:00
ia74
e77e353890 readme change 2025-07-20 17:28:52 -05:00
ia74
db91093ab7 add cloud support & new sensor Cloud Attributes 2025-07-20 17:21:44 -05:00
ia74
5abe164d1f - Add name back 2025-07-20 14:57:14 -05:00
ia74
14c44e6680 update 2025-07-20 14:51:13 -05:00
ia74
44c2a2391d yes 2025-07-20 14:33:33 -05:00
ia74
6164cce27c whoops 2025-07-15 18:15:11 -05:00
ia74
0718bdbb50 how do i intall it 2025-07-15 18:14:27 -05:00
ia74
d28c6e90b6 romba rest 908 2025-07-15 17:58:13 -05:00
ia74
87ef490eed opl 2025-07-15 17:33:16 -05:00