🔧 HTTP 429 Error Handling Improvements
This release significantly improves the integration's ability to handle HTTP 429 (Too Many Requests) errors from the Ariston API.
Key Features
🚀 Enhanced Error Detection & Handling
- Specific HTTP 429 Detection: Automatically detects rate limiting errors using multiple patterns
- Retry-After Header Support: Parses Retry-After headers for precise timing when available
- Exponential Backoff: Progressive delays that increase with consecutive 429 errors (up to 32x multiplier)
- Smart Error Classification: 429 errors are handled separately from other API failures
⚡ Improved Rate Limiting
- Increased Base Intervals: Minimum call interval increased from 2 to 5 seconds
- Dynamic Rate Limiting: Automatically increases intervals when 429 errors occur (up to 8x multiplier)
- Extended Batch Windows: Increased from 5 to 10 seconds to reduce API call frequency
- Intelligent Caching: Extended cache TTL to reduce unnecessary API calls
🛡️ Circuit Breaker Enhancements
- 429-Aware Circuit Breaker: Doesn't open circuit breaker for temporary rate limiting errors
- Separate Error Tracking: Tracks 429 errors independently from other API failures
- Faster Recovery: System recovers more quickly from rate limiting issues
📊 Enhanced Monitoring & Debugging
- Rate Limiting Statistics: New 'rate_limited' counter in API statistics
- 429 Error Metrics: Tracks consecutive 429 count and last occurrence time
- Improved Logging: Better error messages and debugging information for 429 errors
- API Stats Service: Use
ariston.get_api_statsto monitor rate limiting
Cache TTL Improvements
- State Updates: 30 seconds → 2 minutes
- Bus Errors: 5 minutes → 10 minutes
- Energy Data: 10 minutes → 15 minutes
- Features: 1 hour → 2 hours
Expected Results
- ✅ Fewer HTTP 429 errors due to better rate limiting
- ✅ Faster recovery when 429 errors do occur
- ✅ More stable integration with reduced API load
- ✅ Better monitoring and debugging capabilities
Migration
No configuration changes required. The improvements are automatically active after updating.
Technical Details
- Enhanced
APICallManagerwith 429-specific error handling - Improved retry logic with Retry-After header parsing
- Extended caching to reduce API call frequency
- Circuit breaker that distinguishes between temporary and permanent errors
This release addresses the common issue of HTTP 429 errors that many users experience with the Ariston API, providing a much more robust and stable integration experience.