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

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.

:right_arrow: 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?! :scream::scream:

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.

:play_button: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.

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

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

2 Likes

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 :grimacing:

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

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

I don’t know if it’s really « easier » :joy:

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

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

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

Wouldn’t that amount to determining whether the device has transmitted information to Gladys (if the device is offline or online) ( feature already proposed )

@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.

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 …

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 « recent » states on the dashboard:

Personally, the proposed development is enough for me!

2 Likes

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

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