# Trying to use temperature has not changed for X hours

**URL:** <https://community.homey.app/t/trying-to-use-temperature-has-not-changed-for-x-hours/78973>\
**Category:** Questions & Help\
**Tags:** flow\
**Created:** [April 6, 2023, 2:58pm UTC](https://community.homey.app/t/trying-to-use-temperature-has-not-changed-for-x-hours/78973 "2023-04-06T14:58:10Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [April 9, 2023, 2:50pm UTC](https://community.homey.app/t/trying-to-use-temperature-has-not-changed-for-x-hours/78973/6 "2023-04-09T14:50:39Z")

</div>

Try this HomeyScript example:

> [@A script to check sensor last update](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142/7):
>
> Perhaps something like this: const INVALIDATE\_AFTER = 86400; const invalidatedDevices = []; for (const device of Object.values(await Homey.devices.getDevices())) { for (const capabilityObj of Object.values(device.capabilitiesObj || {})) { if (capabilityObj.lastUpdated && (Date.now() - new Date(capabilityObj.lastUpdated) \> INVALIDATE\_AFTER \* 1000)) { invalidatedDevices.push(device.name); } } } await tag('InvalidatedDevices', invalidatedDevices.join(', ')); return invalidatedDe…

---

_[View the full topic](https://community.homey.app/t/trying-to-use-temperature-has-not-changed-for-x-hours/78973)._
