# Comparing two temperatures & controlling one plug

**URL:** <https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683>\
**Category:** Flows\
**Created:** [September 15, 2021, 6:59am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683 "2021-09-15T06:59:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Thulin](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thulin/32/1687_2.png) [@David\_Thulin](https://community.homey.app/u/David_Thulin)\
**Post date:** [September 15, 2021, 6:59am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/1 "2021-09-15T06:59:33Z")

</div>

Hi!  
I have a fan with a plug that I want on if “Bedroom C°” \< “Office C°“ else off. I think I have managed to create the flow as it works when tested, but not alone.

What am I doing wrong?  
David

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/a/9aa95fdc048fc474dc894af7ceeac898c9ea8b42.jpeg)

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [September 15, 2021, 7:54am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/2 "2021-09-15T07:54:12Z")

</div>

This will trigger once and that is not what you are aiming for.

Replace the WHEN card with “Temperature has changed”.  
In the AND section place a logic card where you compare both temperatures.

Here an example with LUX:

 ![Schermafbeelding 2021-09-15 om 09.56.35](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/1/310156012f25787a7657cac284a19c14e39451c3.png)

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [September 15, 2021, 8:09am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/3 "2021-09-15T08:09:45Z")

</div>

The flow should work this way, but not with the “else” option.  
So you need an additional flow to turn the fan off again:

When…  
– Temperature (Bedroom) becomes less than temperature (Office)  
Then…  
– Turn off

---

<div class="post-metadata">

**Author:** ![David\_Thulin](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thulin/32/1687_2.png) [@David\_Thulin](https://community.homey.app/u/David_Thulin)\
**Post date:** [September 15, 2021, 9:51am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/4 "2021-09-15T09:51:35Z")

</div>

This makes perfect sense. I’ll try!

D

---

<div class="post-metadata">

**Author:** ![David\_Thulin](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thulin/32/1687_2.png) [@David\_Thulin](https://community.homey.app/u/David_Thulin)\
**Post date:** [September 15, 2021, 10:45am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/5 "2021-09-15T10:45:28Z")

</div>

Hi!  
When I try to create the temperature comparison (on my Aqara sensors) in the “And” section I can’t access temperature at all - only “Battery alarm”. Also if I do the comparison in “when” I can’t add the “temperature changed” in “And”.

Help!  
D

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [September 15, 2021, 11:16am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/6 "2021-09-15T11:16:25Z")

</div>

Use a Logic card, as seen in my flow example.!

 ![Screenshot_2021-09-15-13-18-11-900_app.homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/7/470dad2209b2f2efcf128870b6102ceca8454270.jpeg)

 ![Screenshot_2021-09-15-13-18-20-733_app.homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/d/8dbb2600e6e60e7b03c61b023e946b213e56439f.jpeg)

---

<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 15, 2021, 11:25am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/7 "2021-09-15T11:25:51Z")

</div>

Logics tutorial if needed:

> [@Getting Started - Logic variables](https://community.homey.app/t/getting-started-logic-variables/20132):
>
> Hi everyone, in this tutorial I will tell you about logic variables and you will learn: how to create a variable the different kind of variables and; their properties and limitations some uses cases of the different types First, let’s take a look at what Athom gave us to work with, shall we? In your app, go to the ‘more’ tab and hit ‘logic’. I already have some variables in my app, so my screen looks like this: You’ll notice I made a blue mark on the printscreen, highligh…

---

<div class="post-metadata">

**Author:** ![David\_Thulin](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thulin/32/1687_2.png) [@David\_Thulin](https://community.homey.app/u/David_Thulin)\
**Post date:** [September 15, 2021, 1:04pm UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/8 "2021-09-15T13:04:13Z")

</div>

Hi!

I feel silly. Thanks for helping me!

D

---

<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 15, 2021, 2:28pm UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/9 "2021-09-15T14:28:39Z")

</div>

Don’t feel silly. We all started with nothing.

---

<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:** [September 15, 2021, 4:06pm UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/10 "2021-09-15T16:06:43Z")

</div>

Almost every one misses this one the first time, so basically it is nog a particularly good user experience design.

---

<div class="post-metadata">

**Author:** ![RogerSt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rogerst/32/12432_2.png) [@RogerSt](https://community.homey.app/u/RogerSt)\
**Post date:** [September 22, 2021, 8:51am UTC](https://community.homey.app/t/comparing-two-temperatures-controlling-one-plug/51683/11 "2021-09-22T08:51:24Z")

</div>

I don’t fully understand your use case. It seems that you want to control the temperature in a room.

Maybe this app can offer a potential solution as well: VThermo

> **[VThermo](https://homey.app/nl-nl/app/no.almli.thermostat/VThermo/)**
>
> Virtual thermostat and humidity controller

I have not used it myself but it seems to manage heating devices without the need for a dedicated thermostat.

Have fun!
