# \[APP\]\[Pro\] Advanced Virtual Device (Device Capabilities App) with Unique Text Status Indicator

**URL:** <https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198>\
**Category:** Apps\
**Tags:** app, tools, virtual-device, device-capabilities, avd\
**Created:** [August 30, 2022, 7:24pm UTC](https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198 "2022-08-30T19:24:40Z")\
**Posts on this page:** 1\
**Showing post:** 89

<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:** [September 27, 2022, 5:18pm UTC](https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198/89 "2022-09-27T17:18:22Z")

</div>

> [@HuisCHovens](#):
>
> The shared flow to see if the sensor is still awake is a nice tool. Can the script this also be added to my flower sensors from Xiaomi?

My flower sensors send temperature values, so they are reported between the temperature sensors  
However, I made a mistake in the flow, the contact sensor check was added twice 🤪  
You can replace the script in the last HomeyScript flowcard, with this code below.  
The [TEF file](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/13) is also updated, you can just import it again.

> **Code (clickme)**
>
> ```auto
> // Sensor.Temperature_Check, to check Temperature sensors connection by comparing last update times
> let array = [];
> 
> const devices = await Homey.devices.getDevices({ filter: {class: 'sensor', capabilities: 'measure_temperature'} });
> _.forEach(devices, device => {
> array.push( device.name + '\t==> ' + device.capabilitiesObj?.measure_temperature.lastUpdated?.substring(0,16) );
> });
> 
> //oldest date on top sort array = ["time_stamp device", "time_stamp device", "time_stamp device"]
> const array_sorted = array.slice().sort(function(time_stamp, device) { 
> const firsttime_stamp = time_stamp.split(" ")[0];
> const secondtime_stamp = device.split(" ")[0];
> if(firsttime_stamp < secondtime_stamp) return -1;
> if(firsttime_stamp > secondtime_stamp) return 1;
> return 0;
> });
> 
> console.log("Temperature sensors:\n" + array_sorted.join('\n') + "\n\nSensor.Temperature_Check.js");
> 
> Homey.flow.runFlowCardAction({
> uri: 'homey:manager:notifications',
> id: 'create_notification',
> args: {
> text: "Temperature sensors:\n" + array_sorted.join('\n') + "\n\nSensor.Temperature_Check.js"
> },
> });
> return array_sorted.join('\n');
> 
> ```

---

_[View the full topic](https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198)._
