# A script to check sensor last update

**URL:** <https://community.homey.app/t/a-script-to-check-sensor-last-update/63142>\
**Category:** Questions & Help\
**Tags:** homeyscript\
**Created:** [April 29, 2022, 7:44am UTC](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142 "2022-04-29T07:44:44Z")\
**Posts on this page:** 1\
**Showing post:** 39

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [September 20, 2023, 6:53am UTC](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142/39 "2023-09-20T06:53:16Z")

</div>

As there is for some time options to see Lastseen timestamp for Zigbee devices, here is the script for Zigbee devices only, which might be more accurate for Zigbee devices. Thanks @Caseda for your overview script 😉

**Version 0.3** - updated for HomeyScript v. 3.5.1  
**Version 0.3b** - fixed for THEN card (returning TEXT value), primary use-better use is for AND card though  
**Version 0.4** - added option to filter out routers and/or end devices  
**Version 0.5** - added option to exclude ZONES, moved variables to the top to be more user friendly  
**Version 0.6** - improved formatting of the output  
**Version 0.7** - fixes  
**Version 0.8** - battery level added

> <https://github.com/shaarkys/Homey_Scripts/blob/main/checkLastUpdate_Zigbee.js>

Example for 2 hours threshold :

 ![inclbatter](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/5/e5051e48773bb0566007c54428e0b85aad111bd3.png)  
 ![nokstatbatt](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/d/cd59fa2ff16618579523992e77a66efcdda83528.png)

All device types version : [A script to check sensor last update - #25 by Sharkys](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142/25)

---

_[View the full topic](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142)._
