# Last Updated Check for values

**URL:** <https://community.homey.app/t/last-updated-check-for-values/117737>\
**Category:** Questions & Help\
**Created:** [October 9, 2024, 3:55pm UTC](https://community.homey.app/t/last-updated-check-for-values/117737 "2024-10-09T15:55:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johbiraus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johbiraus/32/78856_2.png) [@johbiraus](https://community.homey.app/u/johbiraus)\
**Post date:** [October 9, 2024, 3:55pm UTC](https://community.homey.app/t/last-updated-check-for-values/117737/1 "2024-10-09T15:55:23Z")

</div>

Hi,

I was hoping for some help checking if a value hasn’t been updated for a while. I tried the different scripts posted around but I couldn’t get them to work.

I have a flow that fetches swimming temperatures from a couple of websites. The fetched value is then used to update a virtual device that displays swimming temperatures from different locations. However, during winter time, these sensors are physically taken down, leading to long periods without updating the value.

My wish is to have a script check how long ago a chosen value in this virtual device (or a variable if that makes things easier), and then output that as a number I can use in a flow.

I don’t know if the “Last Update” number one can see by tapping a sensor value is discoverable through Homey Script or not. But if it is, that would be really cool.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 9, 2024, 4:10pm UTC](https://community.homey.app/t/last-updated-check-for-values/117737/2 "2024-10-09T16:10:01Z")

</div>

I just posted this in another thread.  
While it’s aimed at zigbee, I’m sure you’ll be able to use it for any device

> [@A script to check sensor last update](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142/25):
>
> Updated script I posted above - added counter of non responding devices - eg, in case you would like to initiate some action based on number of not-responding devices - please note this is the version I’m using, so feel free to change relevant variables below the section // Filter devices to check Changelog : 0.1 - update - converting notReportingCount to a number - if you used previous version of script, delete tag by await tag(‘notReportingCount’, null);\* 0.2 - added filtering based on dev…

---

<div class="post-metadata">

**Author:** ![johbiraus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johbiraus/32/78856_2.png) [@johbiraus](https://community.homey.app/u/johbiraus)\
**Post date:** [October 9, 2024, 4:47pm UTC](https://community.homey.app/t/last-updated-check-for-values/117737/3 "2024-10-09T16:47:43Z")

</div>

It looks like most of the scripts in that thread list all “unavailable” devices. What I’d like to do is to check a given value from a sensor, for example through a tag or a variable; one script that takes in a tag or variable as an argument, and returns how long since the last update as a number.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 9, 2024, 9:04pm UTC](https://community.homey.app/t/last-updated-check-for-values/117737/4 "2024-10-09T21:04:24Z")

</div>

To check upon one capability, you can use this flowcard from this neat app, [Device Capabilities](https://community.homey.app/t/app-pro-device-capabilities-enhance-the-capabilities-of-devices/43287):

> ![1000035761](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/4/a4b9b0d96e6627aff52c7a1201e32fd54e73953b.jpeg)

_ **‘from 0 minutes ago’** _ means: ‘the last updated value’

> ![1000035767](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/4/44d94f0cceb9b55f64962eadb99f5a1603a45f4d.jpeg)

Output:

> ![1000035769](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/c/7c1cf70001e51277df55e8a148471d28354810ca.jpeg)
