# Create flow to find sensor that stopped working

**URL:** <https://community.homey.app/t/create-flow-to-find-sensor-that-stopped-working/100790>\
**Category:** Flows\
**Created:** [January 11, 2024, 1:11pm UTC](https://community.homey.app/t/create-flow-to-find-sensor-that-stopped-working/100790 "2024-01-11T13:11:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PoJa84](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/poja84/32/114582_2.png) [@PoJa84](https://community.homey.app/u/PoJa84)\
**Post date:** [January 11, 2024, 1:11pm UTC](https://community.homey.app/t/create-flow-to-find-sensor-that-stopped-working/100790/1 "2024-01-11T13:11:46Z")

</div>

Today i found out that one of my sensors (outdoor temp) had stopped working about 10 days ago. No problem, i repaired the connection and now it’s working again.

But it didn’t show up as faulty or broken, but just stopped sending new temperatures. It reported the same temp for 10 days.

So now i want to create a flow to detect such a faulty sensor. It needs to check the temperature reported by the sensor and trigger a warning when a sensor reports the same temperature for a certain amount of time (it is a outdoor sensor, so temperature should change frequently).

But, i have no idea where to begin. Maybe read the temperature, store it in a variable, then check the next hour and trigger a warning when the variable has the same temperature?

Who can help me with concrete tips? Someone has had the same problem and developed an solution?

Thanks!

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/7/a79075df7f4846879ad3e5f7e8600bddfeeffec2.png)

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [January 11, 2024, 1:44pm UTC](https://community.homey.app/t/create-flow-to-find-sensor-that-stopped-working/100790/2 "2024-01-11T13:44:16Z")

</div>

I am using the Device capability app to retrieve the latest update time from Insights.  
If you search in this forum you will find many topics regarding this.

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [January 11, 2024, 3:05pm UTC](https://community.homey.app/t/create-flow-to-find-sensor-that-stopped-working/100790/3 "2024-01-11T15:05:09Z")

</div>

Hi @PoJa84 ,  
@Anders_Gregow 's solution is good. In case you don’t know Device capabilities or do not want to use it, my proposals would be.  
_When…_ **#temperature** changes _Then…_ _Start or Replace Timer ‘Quality check’ with xxx Minutes/Hours_  
_When…_ _Timer ‘Quality check’ is finished_ _Then…_ **Tell me**

Alternatively  
_When…_ _Every xxx Minutes/Hours_ \*And…\*Logic: **#MyLastTemperature** is equal to **#temperature**  
_Then…_ _Logic: Calculate **#MyCheckCountdown** as {{ **#MyCheckCountdown** - 1 }}_  
_Else_  
_Logic: Set **#MyLastTemperature** to **#temperature** _  
_Logic: Set **#MyCheckCountdown** to **3** _

With:  
_When…_ _Logic: **#MyCheckCountdown** has changed_  
_And…_ _Logic: **#MyCheckCountdown** equals **0** _  
_Then…_ **Tell me**

I hope that is understandable.  
You can use the Timer you want and Push Notifications Emails or Messengers as you like,

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [January 11, 2024, 4:38pm UTC](https://community.homey.app/t/create-flow-to-find-sensor-that-stopped-working/100790/4 "2024-01-11T16:38:59Z")

</div>

> [@A script to check sensor last update](https://community.homey.app/t/a-script-to-check-sensor-last-update/63142/1):
>
> Hello everyone, In my home set-up I have a bunch of Aqara sensors directly connected to a Homey that I use to monitor temperature and humidity (and for some of them, to trigger some automations based on those). Overtime they run out of battery and I only realised it when the automations don’t start or for the “passive” ones, only when I dive a little deeper in the Insights section. My idea was to use a script to read at a regular interval (say every day) the last updated value of a given senso…

---

<div class="post-metadata">

**Author:** ![PoJa84](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/poja84/32/114582_2.png) [@PoJa84](https://community.homey.app/u/PoJa84)\
**Post date:** [January 12, 2024, 9:19am UTC](https://community.homey.app/t/create-flow-to-find-sensor-that-stopped-working/100790/5 "2024-01-12T09:19:42Z")

</div>

Thanks for the replies.

I don’t want to add to much apps in Homey. Also, working with Homey Script is beyond me, or better, i have no desire/time to learn this…

So i want to solve my problems with an advanced flow. In the reply of @Torch1969 i found a flow which i recreated and which seems to be te solution.

It checks if the stored variable is the same as the actual temp, and if so, it gives a warning. If not, it stores the current temperature as the new variable.

It seems to work when i test it.

Thanks all!

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/2/729a26ec85a1b55b996dbc8131a2881c2483e82c.png)
