How to catch the temperature freeze from aquara sensor

I have some aquara sensors that sometimes freezes the temperature.

I want to make an automation that…
when temperature stays the same for x hours it gives me a message…

how do I code the first part ?