# Flow for turning off heating source if window is open

**URL:** <https://community.homey.app/t/flow-for-turning-off-heating-source-if-window-is-open/99967>\
**Category:** Questions & Help\
**Tags:** advancedflow\
**Created:** [January 4, 2024, 11:45am UTC](https://community.homey.app/t/flow-for-turning-off-heating-source-if-window-is-open/99967 "2024-01-04T11:45:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon78407409](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon78407409](https://community.homey.app/u/anon78407409)\
**Post date:** [January 4, 2024, 11:45am UTC](https://community.homey.app/t/flow-for-turning-off-heating-source-if-window-is-open/99967/1 "2024-01-04T11:45:26Z")

</div>

Hi!  
I’m new to advanced flow, and I’m trying to figure out a simple way to turn off the heat if a window is open.

My HeatIt thermostats for floor heating have a “on” or “off” card, and I have Aqara door/window sensors on the windows.

I’d like to have a generic flow that can handle all these situations rather than having one for each thermostat and window.

If a window has been left open for more than 3 minutes - turn the heat off until it’s closed again.

But there doesn’t seem to be an easy way to handle this? I could go without the timer, but still it doesn’t seem to have a generic sensor and “on/off” device I can control with labels?

Am I wrong?

---

<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 4, 2024, 2:30pm UTC](https://community.homey.app/t/flow-for-turning-off-heating-source-if-window-is-open/99967/2 "2024-01-04T14:30:45Z")

</div>

Hi @anon78407409 ,  
I am not sure, if I understand you right.  
For many sensors there is a _If…_ card **IsOpen for _xxx_ minutes** as well as **IsClosed** or similar and for the heating system there should be some cards to switch them on and off or to change temperature.

With simple cards you must write one Flow for _WindowOpen_ and one for _WindowClosed_, If you have several windows in the same room you may use cards on the zone where you put the devices. I do not have those sensors so I do not know how exactly they look like.

But if you want a simple flow that works in all rooms, like _If…_ something happens on a device _Then…_ switch on/off heating in the room, where the device is, I do not have a clue if it works with simple ore advanced flows. Probably you have to try _Scripts_ which I did not yet.

---

<div class="post-metadata">

**Author:** ![anon78407409](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon78407409](https://community.homey.app/u/anon78407409)\
**Post date:** [January 5, 2024, 11:17am UTC](https://community.homey.app/t/flow-for-turning-off-heating-source-if-window-is-open/99967/3 "2024-01-05T11:17:03Z")

</div>

I’ll take a closer look on what the cards can do.  
The sensor is basically a contact alarm. So it’s active when the window is open.  
If advanced flows are using more resources than simple ones, I can of course just use a normal flow, but that would mean a WindowOpen and WindowClosed for each room. This does of course work, but I was hoping there was an easy way to use labels for rooms;  
“If window in **room 1** is open for more than 1 minute, turn off heating in **room 1** ”

---

<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:** [January 12, 2024, 3:38pm UTC](https://community.homey.app/t/flow-for-turning-off-heating-source-if-window-is-open/99967/4 "2024-01-12T15:38:47Z")

</div>

> [@anon78407409](#):
>
> If a window has been left open for more than 3 minutes -

Device capabilities app:  
 ![Screenshot from 2024-01-12 16-38-21](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/8/c820bd38eb27265b3ca4efbcf12c939e53ad6b84.png)
