Send notification when device is not updated?

I have conbee II and Aqara temperature and humidity sensor. It works fine except that the battery reporting is not correct.

As a fail safe, I would like to run an automation when the sensors last update is more than x amounts of hours old. This way I could react if there are connection issues or empty battery. How can I do this?

I was just thinking about doing the same for a BT sensor that drops every now and then…

Replace sensor/duration as needed in this template trigger;

{{ now() - states.sensor.hygrometer_humidity.last_changed > timedelta(minutes = 5) }}