One way to detect if a sensor’s value is stale (i.e. has not changed for a long time) is to compare the entity’s last_changed to the current time. If it’s more than some threshold value, like 30 minutes, that means the entity’s value hasn’t changed in the past half-hour.
You can create an automation with a Template Trigger that triggers when the monitored temperature sensor is stale. The action can be whatever you want. It can log the incident to a file, notify you, do both and more. In the example below it simply posts a notification to all notification services you have configured.
alias: example abc123
trigger:
- platform: template
value_template: "{{ now() - states.sensor.temperature.last_changed >= timedelta (minutes=30) }}"
action:
- service: notify.notify
data:
title: Stale Temperature
message: "{{ now().timestamp() | timestamp_local }} Value unchanged for the past 30 minutes."