Jluc
31. Juli 2026 um 12:04
1
Im Gespräch gibt die KI Feuchtigkeitswerte für die Küche an, obwohl dort kein Sensor oder eine Sonde vorhanden ist.
Antwort der KI auf die Frage: « Feuchtigkeit im Haus »
Die Feuchtigkeit im Haus beträgt 52,0 % im Wohnzimmer, 51,7 % im Schlafzimmer 1, 52,2 % im Schlafzimmer 3, 52,3 % in der Küche, 52,5 % im Badezimmer, 52,7 % im Technikschacht, 52,8 % auf dem Nordbalkon und 52,9 % auf dem Südbalkon.
Ich habe auch ein kleines Problem:
Alles ist falsch: Der gesendete GET-Request scheint nicht korrekt zu sein
Danke für euer Feedback, das hilft mir, an diesen kleinen dummen Bugs zu arbeiten
Ich habe einen korrigierenden Pull Request gemacht:
master ← claude/gladys-ai-agent-feedback-am8ux3
ouvert 07:57AM - 01 Aug 26 UTC
### Description
This PR adds age tracking to sensor readings exposed to the LLM… , helping it distinguish between live measurements and stale values from sensors that have stopped reporting (dead batteries, unplugged devices, etc.).
**Key changes:**
1. **New `formatAge()` function** in `formatValue.js` that calculates how long ago a sensor value was last updated, returning compact formats like `'12min'`, `'3h'`, or `'6d'`. Returns `null` when the timestamp is missing or invalid.
2. **Updated `formatValue()` function** to include an `age` field in its output alongside `value` and `unit`. This provides the LLM with temporal context for every sensor reading.
3. **Improved empty state handling** in `buildSchemas.js` for the `device.get-state` tool. When no devices match the query, the tool now explicitly tells the LLM "no device is configured" instead of returning an empty list, preventing the model from hallucinating plausible values.
4. **Updated AI chat prompt** to clarify that the LLM should only report values present in tool results and never infer or estimate missing data.
All existing tests have been updated to expect the new `age` field, and comprehensive new tests cover:
- Age calculation in minutes, hours, and days
- Fresh values (0min)
- Future-dated values (treated as fresh due to clock skew)
- Missing or invalid timestamps (null age)
- Stale sensor tracking
### Checklist
- [x] Tests pass: All unit tests updated and new tests added for age tracking functionality
- [x] Linter and prettier pass
- [x] No breaking changes: The `age` field is additive; existing code consuming `value` and `unit` continues to work
https://claude.ai/code/session_01YHsCQc8ttFMpWzZAaYSwwn
## Summary by CodeRabbit
- **New Features**
- Sensor readings now display how long ago they were recorded.
- Clear messages appear when no matching devices or measurements are found.
- AI responses identify missing sensors, account for stale readings, and disclose incomplete tool results.
- **Bug Fixes**
- Prevented empty or misleading device-state responses when no results are available.
- Improved handling of missing, invalid, future, and outdated measurement timestamps.