"Forget" a value after a certain time (~timeout)

Feature description
Gladys should forget the value of certain sensors if the last reading is too old.

Concrete example
Scenes and the dashboard currently display 20°C as the outdoor temperature at my place (in the middle of January), because the sensor has been out of battery since September.
I would prefer that after a reasonable amount of time (12h or 24h) the value be forgotten and that Gladys display « no recent value ».

FYI I started this thread since it’s indeed an important concept :slight_smile:

It will look like this:

I set a default value of 48h.

It will be adjustable globally in the settings. We’ll see whether in the long run we’ll make different durations per feature type — that seems a bit overkill at first; I think a global setting is more than sufficient.

5 Likes

In the Node-RED function I wrote, I have a 24-hour value for all my sensors.

1 Like

The setting looks like this:

2 Likes

This feature is available in Gladys Assistant 4.28 :

1 Like

Thanks @pierre-gilles,

The basic idea is good and I was actually waiting for it as well.
However, immediately after the update, I realize it’s not entirely suitable.

Indeed, for all my devices going through Node-RED or Arduino for example, and out of a concern for database economy (we certainly care a lot about that), I only update the data if they are different, sending beforehand the last value before the new one. I therefore end up with some features without values for a while, but I compensate by sending the date/time of the last reception as text without saving it to the database.

So I end up with this on the dashboard even though it works fine (Netatmo works in intervals so the battery can remain at the same value for 1 month or more)

Would it be possible to consider adding options for the types of features concerned to enable or disable this parameter in the future?
2nd solution: act per device?
3rd solution: on the Node-RED side, force sending a value every xx hours corresponding to the time set for this option… just make sure it doesn’t restart in the meantime otherwise the sends get skipped…

I’m reposting my reply to @spenceur here:

2 Likes