# 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:** 25

<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:** [July 7, 2023, 12:58pm UTC](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142/25 "2023-07-07T12:58:22Z")

</div>

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 device app type - thanks @Peter_Kawa\*  
0.3 - update for new HomeyScript - **compatible now only with HomeyScript v. 3.5.1 and later**  
0.3b - fixed for THEN card (returning TEXT value), primary use-better use is for AND card though  
0.4 - added option to exclude ZONEs  
0.5 - better output formatting and fixes date times sometimes N/A  
0.6 - added ability to exclude ZWave/Zigbee devices or all others  
0.7 - Adds battery-level monitoring for ANY devices  
0.8 — Any-device LastUpdated + Battery monitor, NA/invalid lastUpdated ⇒ NOK with reason codes (“no updates”), Uses system/runtime time zone by default (universal); optional TIME\_ZONE override

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

 ![example](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/d/2db49d27eddd55c335881b891229a18323c344cc.png)

Zigbee ONLY version : [A script to check sensor last update - #39 by Sharkys](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142/39)

---

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