# Alert and create an "Unavailable" status for a device (out of battery, no connection, etc.)

**URL:** <https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442>\
**Category:** Demandes livrées\
**Tags:** feature-core, device-indispo\
**Created:** [July 28, 2022, 5:57am UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442 "2022-07-28T05:57:22Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [July 28, 2022, 5:57am UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/1 "2022-07-28T05:57:22Z")

</div>

**Feature description**  
Gladys notifies me when a sensor stops working, stops sensing, or no longer returns data.

**Context**  
I have a 100% Zigbee home automation setup, with a majority of Xiaomi devices connected directly to Gladys.

➡ Currently, the last known value **is still used in scenes** , as if the sensor were still working.

I also noticed this because the scene that notifies me when a room has been too humid for several hours kept returning the same result … Since November 17, 2021?! 😱😱

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/4/4729f38a24d8290cff11983667dd505c9ea5bba9.png)

I’ve noticed two things,

1. The battery value of Xiaomi devices seems absolutely useless. Sensors stop working overnight while still reporting 100%!

2. **BUT** Gladys will always display the last recorded value, even if it is **several weeks** old. I’m realizing this now because my sensors didn’t show the high temperatures from earlier in the week.

▶Here are my recommendations:

- Determine the age of the last received value.
- When it exceeds 24h (or even 48h if needed), Gladys should warn that the sensor is offline.

---

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [July 28, 2022, 7:38am UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/2 "2022-07-28T07:38:34Z")

</div>

Very good idea. Some boxes already do that (room temperature, graphs)

How do you handle the case of a «&nbsp;door open&nbsp;» sensor, for example? Which can send a value once a week or less?

---

<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:** [July 28, 2022, 8:27am UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/3 "2022-07-28T08:27:39Z")

</div>

> [@cicoub13](#):
>
> How do you handle the case of a «&nbsp;door open&nbsp;» sensor, for example? One that can send a value once a week or less?

Good question! One solution would be to have different values depending on the device type.

Besides, the case of door-open sensors is special:

- You go on vacation for a month, your doors don’t move for a month
- It’s quite possible to have a door that doesn’t move for 6 months (like a garden shed in winter)

I don’t really have the answer here 😬

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [July 28, 2022, 8:54am UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/4 "2022-07-28T08:54:12Z")

</div>

A checkbox in the sensor configuration box: «&nbsp;Warn if the sensor remains inactive for more than 48 hours&nbsp;»

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [July 28, 2022, 9:14am UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/5 "2022-07-28T09:14:42Z")

</div>

Something simpler, a per-type setting in the settings.

---

<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:** [July 28, 2022, 11:57am UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/6 "2022-07-28T11:57:48Z")

</div>

I don’t know if it’s really «&nbsp;easier&nbsp;» 😂

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [July 28, 2022, 12:09pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/7 "2022-07-28T12:09:28Z")

</div>

I don’t see myself managing that on each device. On a category of devices, though, yes 🤔

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [July 28, 2022, 4:18pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/8 "2022-07-28T16:18:28Z")

</div>

It could be by type in Gladys settings, with default values.

AND with a checkbox checked by default («&nbsp;notify on failure&nbsp;») when adding a device, similar to how data retention is currently handled.

---

<div class="post-metadata">

**Author:** ![mikael](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mikael](https://community.gladysassistant.com/u/mikael)\
**Post date:** [August 5, 2022, 12:20pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/9 "2022-08-05T12:20:50Z")

</div>

Wouldn’t that amount to determining whether the device has transmitted information to Gladys (if the device is offline or online) ( [feature already proposed](https://community.gladysassistant.com/t/nouvelle-feature-signal-strength-ou-etat-de-la-connexion/6165/72) )

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [August 5, 2022, 12:27pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/10 "2022-08-05T12:27:18Z")

</div>

@mikael the link you gave concerns another request.

I searched but I can’t find a similar request, but if I remember correctly this topic has already been addressed.

---

<div class="post-metadata">

**Author:** ![mikael](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mikael](https://community.gladysassistant.com/u/mikael)\
**Post date:** [August 11, 2022, 9:50am UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/11 "2022-08-11T09:50:14Z")

</div>

In principle, these two requests are the same in my opinion:

- we want to know whether a device is online or not.

but we have two different approaches, one via the network link and the other via the data  
In both cases, if the recorded value is greater than X time then it should be considered obsolete. (allow a user to choose the TTL of their device or device group with a default TTL)

regarding battery management, all my Xiaomi sensors went from 100% to less than 50% all of a sudden …

---

<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:** [September 11, 2023, 5:59pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/12 "2023-09-11T17:59:34Z")

</div>

This feature hasn’t been developed exactly, but I developed a feature that goes in that direction in Gladys Assistant 4.28: the ability to display only «&nbsp;recent&nbsp;» states on the dashboard:

> [@Gladys Assistant 4.28 : Expiration des états de capteurs, nouveaux appareils Zigbee, et plus!](https://community.gladysassistant.com/t/gladys-assistant-4-28-expiration-des-etats-de-capteurs-nouveaux-appareils-zigbee-et-plus/8352):
>
> Salut à tous ! C’est lundi, c’est l’heure d’une nouvelle release Gladys smile Et il y a plein de nouveautés dans Gladys Assistant 4.28 !! Expiration des états de capteurs Désormais, les «&nbsp;vieux&nbsp;» états de capteurs ne seront plus affichés sur le tableau de bord, et seront remplacé par une indication que l’état n’est plus à jour : Pratique pour trouver les capteurs qui n’envoient plus de valeurs ! La délai par défaut est de 48 heures et peut-être modif…

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [September 11, 2023, 6:57pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/13 "2023-09-11T18:57:19Z")

</div>

Personally, the proposed development is enough for me!

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [September 11, 2023, 7:00pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/14 "2023-09-11T19:00:56Z")

</div>

I also think that for more advanced things, Node-RED does the job 👌

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 11, 2023, 7:40pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/15 "2023-09-11T19:40:32Z")

</div>

Next step: put this data into scenes to be able to create alerts with Telegram

---

<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:** [October 27, 2023, 3:54pm UTC](https://community.gladysassistant.com/t/alerter-et-creer-un-statut-indisponible-dun-equipement-plus-de-batterie-connexion-etc/7442/16 "2023-10-27T15:54:56Z")

</div>


