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

<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 18, 2023, 8:40am UTC](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142/31 "2023-09-18T08:40:10Z")

</div>

> [@Tirrazo](#):
>
> doesn’t matter what type

It matters, you need to adjust conditions in the script… name and-or class (device type)

> [@Sharkys](#):
>
> ```auto
> if (!device.name.match(/temperature/i)) continue; // Include by regex device name
> if (device.name.match(/Flood|TVOC|Netatmo Rain|Motion|Flora|Rear gate Vibration Sensor|Vibration Sensor Attic Doors/i)) continue; // Exclude devices with given name
> if (!device.class.match(/sensor|button|remote|socket|lights/i)) continue; // Include device types
> 
> ```

---

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