Validity of values

I’m using several sensors (door/window/temperature/humidity) and a few actors with Zigbee2MQTT. Is there a best practice or a standard procedure with Home Assistant for detecting and handling sensors failing to report new values?

E.g. if i use a thermostat and a separate room temperature sensor and try to build an automation that adjusts the set temperature of the termostat I have to stop fully opening the thermostat if the room temperature sensor fails below the desired temperature and the value no longer changes.

Or I would like a windows sensor to show “unknown” if it didn’ report/confirm the last value for a certain time (preferrably with a kind of keep-alive mechanism e.g. once an hour).

Is there a way for a signal to go “bad” or “undefined” if a (preferably configurable) criteria is met? Of course for Zigbee there seems to be no standard reporting interval but if e.g. the temperature sensor is known to report a new value every 5 minutes I would like the signal to be set to “undefined” after 15 or 20 minutes.

use the ‘availability’ settings in Zigbee2MQTT. There is a separate option for battery devices and mains powered devices.

I configured these two timeouts, but it seems to be trial and error as there doesn’t seem to be a general maximum time between two updates. Additionally I would need to set these values per sensor as the reporting frequenc differs. The reporting frequency of some of my window sensors is so low that there can be many hours before a failing sensor can be detected.

But even with these two timeouts set I can see the devices in Zigbee2MQTT addon as “offline” but in Home assistant overview page simply the old values are shown without any hint.