# Turn off lights after any non specific action

**URL:** <https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701>\
**Category:** Flows\
**Created:** [September 30, 2019, 9:36pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701 "2019-09-30T21:36:09Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niels\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels_f/32/15942_2.png) [@Niels\_F](https://community.homey.app/u/Niels_F)\
**Post date:** [September 30, 2019, 9:36pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/1 "2019-09-30T21:36:09Z")

</div>

Hi everyone,

Thanks for reading my first forum post 🙋‍♂️

I made a flow that turns on the lights in my hallway, when I get home and it’s past sunset.  
The lights are set to stay on for 90 seconds.

Now I’m trying to find a way to keep the hallway lights on until I have done something else, like start a flow or turn on another light.

Is there a way to do that?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [October 1, 2019, 3:51am UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/2 "2019-10-01T03:51:33Z")

</div>

Welcome @Niels_F  
This is a way to do this [[Simple] Lights turning on/off based on motion](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889)

---

<div class="post-metadata">

**Author:** ![Niels\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels_f/32/15942_2.png) [@Niels\_F](https://community.homey.app/u/Niels_F)\
**Post date:** [October 1, 2019, 5:57am UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/3 "2019-10-01T05:57:13Z")

</div>

Thanks for your reply marcel, but I don’t think that flow does what I’m looking for…  
I don’t have a motion sensor in my hallway and I don’t want my lights to turn off after a time of nothing.

I would like them to turn off after any non specific action

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [October 1, 2019, 6:03am UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/4 "2019-10-01T06:03:16Z")

</div>

You can combine several flows together.

Flow1  
When arrive at home  
Then switch lights on  
And enable Flow 2  
And start Flow 2 after 90s

Flow 2  
When flow ist started  
Then switch lights off

Flow 3  
When a specific action  
Then disable Flow 2

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [October 1, 2019, 11:15am UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/5 "2019-10-01T11:15:09Z")

</div>

These days it’s also useful to use the “zone activity” 🙂

---

<div class="post-metadata">

**Author:** ![Niels\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels_f/32/15942_2.png) [@Niels\_F](https://community.homey.app/u/Niels_F)\
**Post date:** [October 1, 2019, 11:44am UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/6 "2019-10-01T11:44:32Z")

</div>

Thank you very much Jamie!  
I will test that when I get home, but that might well do the trick;

If:  
Any of the other zones are activated

And:  
Timer activated by turning on hallway light upon entering is running

Then:  
Turn off hallway lights

---

<div class="post-metadata">

**Author:** ![Gareth\_Evans](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gareth_evans/32/15022_2.png) [@Gareth\_Evans](https://community.homey.app/u/Gareth_Evans)\
**Post date:** [October 1, 2019, 11:59am UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/7 "2019-10-01T11:59:23Z")

</div>

Does zone activity also include turning lights on? hadn’t realised that, it may make me rethink some of my existing flow, just assumed it related to movement or contact sensors.

---

<div class="post-metadata">

**Author:** ![Gareth\_Evans](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gareth_evans/32/15022_2.png) [@Gareth\_Evans](https://community.homey.app/u/Gareth_Evans)\
**Post date:** [October 1, 2019, 12:02pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/8 "2019-10-01T12:02:06Z")

</div>

The way i’ve achieved similar is with variables, create and set a variable to zero, when something else happens e.g. a light switching on or the TV switching on then increase the variable by 1, then a separate flow that is when variable is greater than 1 turn hallway light off, catch all also when everyone leaves the house then set variable to 0. Hope that makes sense.

---

<div class="post-metadata">

**Author:** ![Niels\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels_f/32/15942_2.png) [@Niels\_F](https://community.homey.app/u/Niels_F)\
**Post date:** [October 1, 2019, 12:14pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/9 "2019-10-01T12:14:58Z")

</div>

Yeah I thought of that gareth, but that would mean I have to set a variable for every device in my home.  
Using zones I have multiple devices under 1 “if”.

One of the zone cards is; if zone is activated.  
I’m guessing turning on a light will activate a zone

---

<div class="post-metadata">

**Author:** ![Niels\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels_f/32/15942_2.png) [@Niels\_F](https://community.homey.app/u/Niels_F)\
**Post date:** [October 1, 2019, 1:09pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/10 "2019-10-01T13:09:13Z")

</div>

Hmm, turning on lights will not activate a zone, as I just discovered. so I’m afraid that won’t work in this case

---

<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:** [October 1, 2019, 1:45pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/11 "2019-10-01T13:45:31Z")

</div>

The only things activating zones are **motion sensors** (`alarm_motion` capability) and **contact sensors** (`alarm_contact` capability), so any flows that turn on a light based on motion it can seem that it also turns on “lights on” but that is definitely not the case.

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [October 1, 2019, 6:03pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/12 "2019-10-01T18:03:48Z")

</div>

Add a virtual motion sensor?

---

<div class="post-metadata">

**Author:** ![Gareth\_Evans](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gareth_evans/32/15022_2.png) [@Gareth\_Evans](https://community.homey.app/u/Gareth_Evans)\
**Post date:** [October 2, 2019, 2:27pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/13 "2019-10-02T14:27:12Z")

</div>

So using the apps: [https://apps.athom.com/app/com.swttt.devicegroups](https://apps.athom.com/app/com.swttt.devicegroups)

this will definitely help with the light part, create a basic group, just with capability of on/off and add all lights to it, any of the lights switching on will trigger the group be classified as on.

Still thinking on the flows part.

---

<div class="post-metadata">

**Author:** ![Niels\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels_f/32/15942_2.png) [@Niels\_F](https://community.homey.app/u/Niels_F)\
**Post date:** [October 6, 2019, 9:14am UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/14 "2019-10-06T09:14:24Z")

</div>

Thank you very much, I think this might do the trick!

---

<div class="post-metadata">

**Author:** ![Niels\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels_f/32/15942_2.png) [@Niels\_F](https://community.homey.app/u/Niels_F)\
**Post date:** [October 12, 2019, 4:24pm UTC](https://community.homey.app/t/turn-off-lights-after-any-non-specific-action/18701/15 "2019-10-12T16:24:02Z")

</div>

All in all my flows look like this:

First flow, to start a coming home timer:  
If:  
Someone comes home  
Then:  
Start countdown ‘‘coming home’’ for 240 seconds (since my homey registers me coming home when I’m turning into my parking lot

Second flow to turn hallway lights on:  
If:  
Contact alarm turns on  
And:  
Coming home timer is running  
It’s after sunset  
Hallway lights are off  
Then:  
Dim hallway lights to 60% during 1 sec  
Start countdown timer ‘‘coming home lights off’’ for 120 seconds

Third flow to turn off hallway lights:  
If:  
Light group is turned on (pretty much all my lights except my toilet)  
And:  
Countdown timer ‘‘Coming home lights off’’ is running  
Then:  
Turn off hallway lights after 10 seconds  
Stop timer ‘‘coming home lights off’’

For some reason I can’t login to my homey from my desktop, so I couldn’t make screenshots to make this easier.

Thanks again for your help guys! 🙂
