# Anuncio de temperatura en una habitación sin sonda/captador

**URL:** <https://community.gladysassistant.com/t/annonce-de-temperature-dans-une-piece-non-equipee-de-sonde-capteur/10405>\
**Category:** Configuration\
**Created:** [31 Julio, 2026 12:04 UTC](https://community.gladysassistant.com/t/annonce-de-temperature-dans-une-piece-non-equipee-de-sonde-capteur/10405 "2026-07-31T12:04:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jluc](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jluc/32/12397_2.png) [@Jluc](https://community.gladysassistant.com/u/Jluc)\
**Post date:** [31 Julio, 2026 12:04 UTC](https://community.gladysassistant.com/t/annonce-de-temperature-dans-une-piece-non-equipee-de-sonde-capteur/10405/1 "2026-07-31T12:04:08Z")

</div>

En la discusión, la IA indica tasas de humedad en la cocina donde no hay ningún sensor o sonda presente.

Respuesta de la IA a la pregunta: «&nbsp;Humedad en la casa&nbsp;»

La humedad en la casa es del 52,0 % en el salón, 51,7 % en el dormitorio 1, 52,2 % en el dormitorio 3, 52,3 % en la cocina, 52,5 % en el baño, 52,7 % en el conducto técnico, 52,8 % en el balcón norte y 52,9 % en el balcón sur.

---

<div class="post-metadata">

**Author:** ![Chris75](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/6a8cbe/32.png) [@Chris75](https://community.gladysassistant.com/u/Chris75)\
**Post date:** [31 Julio, 2026 18:45 UTC](https://community.gladysassistant.com/t/annonce-de-temperature-dans-une-piece-non-equipee-de-sonde-capteur/10405/2 "2026-07-31T18:45:03Z")

</div>

Yo también tengo un pequeño problema:

 ![Capture d'écran 2026-07-31 204216](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/b/7/b7121bb60e5d250ac9bcb78d35643cbd1d519f0e.png)

Todo está mal: a priori, el get enviado no es correcto

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [1 Agosto, 2026 08:23 UTC](https://community.gladysassistant.com/t/annonce-de-temperature-dans-une-piece-non-equipee-de-sonde-capteur/10405/3 "2026-08-01T08:23:10Z")

</div>

Gracias por vuestros comentarios, me permiten iterar sobre estos pequeños errores tontos 🙂

He hecho una PR correctiva :

> <https://github.com/GladysAssistant/Gladys/pull/2731>
>
> \### 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.
