# Why is this flow not working ? (Temp sensor, time, switch)

**URL:** <https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580>\
**Category:** Flows\
**Created:** [January 6, 2021, 5:04pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580 "2021-01-06T17:04:56Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nymalt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nymalt/32/29792_2.png) [@Nymalt](https://community.homey.app/u/Nymalt)\
**Post date:** [January 6, 2021, 5:04pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/1 "2021-01-06T17:04:56Z")

</div>

Hi,  
I’m struggling to understand why my flow is not working. The logic behind the flow seems to me it should work. I have a small Aqara temperature sensor (Zigbee), Cleverio small socket (Z-wave). My time Zone is Norway.

My flow is as follows:

 ![Screenshot_20210106_175411_app.homey (2)](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/4/24cd58695b9eaf5be0f7e7809c4ff2fb9cf3131a.jpeg)  
 ![Screenshot_20210106_175415_app.homey (2)](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/3/4333c7282131e4e0e9f72e50f9b9ebe8afa29821.jpeg)  
 ![Screenshot_20210106_175419_app.homey (2)](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/f/cf1e665618d1f45a7d13084139c15c4c89dc821c.jpeg)

Today it was over 25 degrees celcius in the room from a wood oven, and I wanted my electrical oven to switch off (which is plugged into the Cleverio socket), but it didn’t happen.

Any ideas ?

Best regards,  
Martin Bergholtz

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 6, 2021, 5:26pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/2 "2021-01-06T17:26:52Z")

</div>

Was this device also turned on by Homey?

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

Try to remove this card (it’s not really needed) and see if it works than.

---

<div class="post-metadata">

**Author:** ![Nymalt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nymalt/32/29792_2.png) [@Nymalt](https://community.homey.app/u/Nymalt)\
**Post date:** [January 6, 2021, 6:07pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/4 "2021-01-06T18:07:29Z")

</div>

Hi, I tried to remove the og turned on (even though it is always turned on through Homey). Pressed test and it didn’t work. I set a threshold below current temperature, and pressed test. Doesn’t work. Really strange.

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [January 6, 2021, 6:16pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/5 "2021-01-06T18:16:52Z")

</div>

You say it is always turned on by homey, I hope you don’t mean you’ve turned on the option “always on” in advanced settings? because that will forbid turning it off. And the temperature, is that the local tag or the temperature from another device? Checking the marks wile running a test as asked by @RoyWissenburg is indeed the first way to go to see if homey thinks a condition is not met or a command fails. If they all succeed, is manually turning the devce of working as expected? Maybe it’s a range problem?

you could also make a flow to check if the temp actually changes by having no conditions and simply posting a notification. Maybe the temp was 25 stable?

---

<div class="post-metadata">

**Author:** ![tlangelaar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tlangelaar/32/10980_2.png) [@tlangelaar](https://community.homey.app/u/tlangelaar)\
**Post date:** [January 6, 2021, 7:01pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/6 "2021-01-06T19:01:11Z")

</div>

Which temperature tag did you insert? Make another flow in which you check if temperature changed then send notification to timeline: [Shared Flow | Homey](https://homey.app/f/umI3pr). The temperature tag to be inserted in the notification is the local one (top of tag list). Disable/delete this flow after short test as it can run very often.

---

<div class="post-metadata">

**Author:** ![Kees\_Van\_der\_linden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kees_van_der_linden/32/32625_2.png) [@Kees\_Van\_der\_linden](https://community.homey.app/u/Kees_Van_der_linden)\
**Post date:** [January 6, 2021, 7:10pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/7 "2021-01-06T19:10:15Z")

</div>

Are the sensor and the room thermometer near to eachother? Otherwise you can’t measure the difference.  
Temperature precision: ±0.3℃ for the sensor, what is the room thermometer precision?  
What are the setting for the sensor?  
My temperature sensor has a setting for the minimum value difference that must be reached before the sensor makes contact with Homey.

---

<div class="post-metadata">

**Author:** ![Nymalt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nymalt/32/29792_2.png) [@Nymalt](https://community.homey.app/u/Nymalt)\
**Post date:** [January 6, 2021, 9:38pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/8 "2021-01-06T21:38:00Z")

</div>

Hi and thanks for many suggestions. @Edwin_D and @tlangelaar - it is not set to “Always on” in advanced. The tag i choose is from the Aqara sensor tag:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/d/bdfec522065d08e5cd905cf8b588f466ca0bacd4.png)  
Range is not a problem as it’s in the room next door to the homey and sensor shows correct values (verified with other sensors to see).

@Kees_Van_der_linden The sensor shows correct values compared to other sensors. Seeing the Aqara showed 25 degrees, and I wanted treshold to shut off at 23,5 it should be big enough gap right ?

@Edwin_D I did to a test and the strange this is that I get a yellow exlamation mark next to the logic:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/f/bf89b5c72f9e1421d0042fb6d1545618873195af.png)  
Thats from pressing test and saying 25 (tried with various levels above 23.5 too - same result). The weird thing is that I have the same flow for switching off at night, and that test gives a green check mark 🤔  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/b/5bf5156f37a671e6fd8844b01130f421641cffe3.png)

Really strange

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [January 7, 2021, 8:47am UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/9 "2021-01-07T08:47:26Z")

</div>

Not that strange, the temperature tag you used isn’t the local tag (which you fill in when pressing test) but the device’s tag, which has the value `22.4` which definitely isn’t greater (higher) then `23.5`

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [January 7, 2021, 12:01pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/10 "2021-01-07T12:01:45Z")

</div>

I think @Caseda might be on the right track. When playing around in Homeyscript I too had problems when reacting on value changes that it seemed like the flow to change the value change was triggered BEFORE the value in the devices capability reflected the same change. I took another approach but didn’t investigate further what originally went worng when it finally worked.

If this is true, the local tag will give you the right value and the tag from (the same!) device will not. If that fixes your problem, I think you should send in a bug report to Athom.

Maybe this can be tested, I will see if I can create a flow on any of my aqara temp sensors to verify that this can actually happen.

EDIT: so far the local tag and the sensor tag are equal on firmware V5 RC50, so it doesn’t seem to be a problem for me.

When you test the flow in the web interface, I think you can see an error message for the tag that fails sometimes (was it by hovering/clicking on the error icon, or did it just show as a banner on top? I’m not sure).

---

<div class="post-metadata">

**Author:** ![Nymalt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nymalt/32/29792_2.png) [@Nymalt](https://community.homey.app/u/Nymalt)\
**Post date:** [January 7, 2021, 9:36pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/11 "2021-01-07T21:36:01Z")

</div>

Hi, it seems what @Caseda says is correct. The test button does not use the temperature I enter in the Test - but the actual temperature read from the sensor itself.

I changed to flow to fit with what the temperature is right now, and changing around the time so it would be correct within the time frame of when I press test. Doing all that - the flow works. However it did not turn off that day when the room was alot warmer due to extra heat from wood oven. Very strange as the temperature sensor in the flow was 2 degrees higher than my treshold for turning it off. Might be a coincidence - but I will see if it happens again when I reheat it with wood oven as supplement again.

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [January 7, 2021, 10:06pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/12 "2021-01-07T22:06:12Z")

</div>

Ah yes, using the actual sensor again instead of the local variable does break the test. Never thought of that - I guess this must have fooled a lot of others too. Good catch @Caseda !

Dit you notice shortly after 6:00? Because if the temp is high before 6:00 it wont turn off until the temp changes after 6:00. So if the temp was stable from 6:00 on… Maybe you also need a rule when it’s 6:00 and the temp is above the threshold, turn it of too.

---

<div class="post-metadata">

**Author:** ![Nymalt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nymalt/32/29792_2.png) [@Nymalt](https://community.homey.app/u/Nymalt)\
**Post date:** [January 9, 2021, 6:24pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/13 "2021-01-09T18:24:19Z")

</div>

Hey - it was not high until midday, so sadly no. Can’t seem to get this working right. I’ve tried alot now. Strange

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [January 9, 2021, 6:44pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/14 "2021-01-09T18:44:46Z")

</div>

Then start from scratch.  
WHEN temp changes THEN push message to phone with the temp tag provided at the top saying “In this flow”.  
When that works take the next step:  
WHEN temp changes AND (logic card) temp is higher then 23.5 (make sure to use the tag again provided at the top saying “In this flow”) THEN push message with the correct tag.  
Move on from there.  
In the insights u see the temp actually change?

---

<div class="post-metadata">

**Author:** ![Nymalt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nymalt/32/29792_2.png) [@Nymalt](https://community.homey.app/u/Nymalt)\
**Post date:** [January 9, 2021, 7:14pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/15 "2021-01-09T19:14:43Z")

</div>

Thank you @Rocodamelshekima , I will try this and do it as steps to see. Good idea.

Insight shows the temperature does change, so the sensor should work 🙂

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/1/91f6352e9746483c6a59f28a80f49e86eee46ba7.png)

---

<div class="post-metadata">

**Author:** ![Nymalt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nymalt/32/29792_2.png) [@Nymalt](https://community.homey.app/u/Nymalt)\
**Post date:** [January 10, 2021, 8:53pm UTC](https://community.homey.app/t/why-is-this-flow-not-working-temp-sensor-time-switch/40580/16 "2021-01-10T20:53:36Z")

</div>

@Rocodamelshekima Apparently all my sensors send the temperature through the message function, and now it seems all my flows are working. What happened the other day is beyond my understanding, as the flow should have worked - but didn’t. Now it works and I’ve not changed it. Hoping it stays that way 😅
