forked from manutoky/haKachelmannWetter
-
Notifications
You must be signed in to change notification settings - Fork 0
API & Rate Limits
Fischer, Fabian edited this page Apr 28, 2026
·
1 revision
This integration uses all 5 available API endpoints of the Kachelmann v02 API:
| Endpoint | Purpose | Fields |
|---|---|---|
/current/{lat}/{lon} |
Current weather conditions | 15 |
/forecast/{lat}/{lon}/advanced/1h |
Hourly forecast (24h) | 22 |
/forecast/{lat}/{lon}/advanced/6h |
6-hourly forecast (~10 days) | 24 |
/forecast/{lat}/{lon}/trend14days |
14-day trend with probabilities | 29 |
/tools/astronomy/{lat}/{lon} |
Sun/moon rise/set, moon phase | 16 |
All endpoints are fetched in parallel using asyncio.gather for maximum speed.
| Metric | Value |
|---|---|
| Daily request limit | 700 requests |
| Requests per update | 5 (one per endpoint) |
| Default interval (10 min) | ~720 requests/day |
| Recommended interval (15 min) | ~480 requests/day ✅ |
| Safe interval (20 min) | ~360 requests/day ✅ |
requests_per_day = (24 * 60 / update_interval_minutes) * 5
| Interval | Requests/day | Status |
|---|---|---|
| 5 min | 1440 | ❌ Way over limit |
| 10 min | 720 | |
| 12 min | 600 | ✅ OK |
| 15 min | 480 | ✅ Comfortable |
| 20 min | 360 | ✅ Very safe |
| 30 min | 240 | ✅ Minimal usage |
Set the update interval to 900 seconds (15 minutes) for a good balance between freshness and API budget.
The integration tracks rate limit headers from API responses:
-
X-RateLimit-Remaining→sensor.kachelmannwetter_api_requests_remaining -
X-RateLimit-Limit→ stored internally
Enable the diagnostic sensor to monitor your usage:
- Go to the KachelmannWetter device
- Find "API requests remaining" (disabled by default)
- Enable it
When the API returns 429:
- The integration reads the
Retry-Afterheader - Logs a warning with the retry delay
- Schedules an automatic retry after the specified delay
- Raises
UpdateFailedso HA shows the entity as unavailable temporarily
No manual intervention needed — it recovers automatically.
| HTTP Status | Meaning | Action |
|---|---|---|
| 401 | Invalid API key | Reauth flow triggered |
| 403 | Location not configured | Check API location settings on kachelmannwetter.com |
All API requests have a 10-second timeout. If the API is slow or unreachable, the update fails gracefully and retries at the next interval.
Official API docs: api.kachelmannwetter.com/v02/_doc.html