# Light Dim at night

**URL:** <https://community.homey.app/t/light-dim-at-night/17953>\
**Category:** Flows\
**Created:** [September 9, 2019, 11:33pm UTC](https://community.homey.app/t/light-dim-at-night/17953 "2019-09-09T23:33:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen\_Kokhuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_kokhuis/32/12592_2.png) [@Jeroen\_Kokhuis](https://community.homey.app/u/Jeroen_Kokhuis)\
**Post date:** [September 9, 2019, 11:33pm UTC](https://community.homey.app/t/light-dim-at-night/17953/1 "2019-09-09T23:33:49Z")

</div>

Hello,

I have the following flow:

 ![Screenshot_20190909-153604](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/8/8d1e11ca3c44a9506f9c52e8dac7232d1dd4da26.jpeg)

I want the light to dim at 20% in the evening en 5% at night. With this flow both are triggered at the same time. Does anyone has an idea of what’s wrong with the flow?

---

<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:** [September 10, 2019, 8:12am UTC](https://community.homey.app/t/light-dim-at-night/17953/2 "2019-09-10T08:12:09Z")

</div>

What it says is when movement occurs and it meets your IF, turn on the light at 20%. At that moment your lux will go up. When movement occurs and it will not meet your IF because the lux went up, it will turn on the light at 5%. So the lux will go down, etc

I have made a extra flow which measures the lux only when the lights are off. Just make a extra variable.

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

---

<div class="post-metadata">

**Author:** ![Marvin\_Schenkel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marvin_schenkel/32/10195_2.png) [@Marvin\_Schenkel](https://community.homey.app/u/Marvin_Schenkel)\
**Post date:** [September 11, 2019, 12:57pm UTC](https://community.homey.app/t/light-dim-at-night/17953/3 "2019-09-11T12:57:11Z")

</div>

I use a few other tricks for this:

- I set luminance thresholds per room to determine whether the room is dark / light
- I set a variable ‘Hallway\_LightDark’ to either light / dark based on luminance changed events
- I only turn on lights when motion has been detected AND it is dark in that room.

---

<div class="post-metadata">

**Author:** ![FKey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fkey/32/14793_2.png) [@FKey](https://community.homey.app/u/FKey)\
**Post date:** [September 11, 2019, 6:02pm UTC](https://community.homey.app/t/light-dim-at-night/17953/4 "2019-09-11T18:02:54Z")

</div>

When your luminance is larger than 15,  
It will trigger the else…  
Dont thinks that is what you want.  
The 2nd OR is not usefull. Its a restriction of the 1st and bot will trigger the THEN.

My advice: dont make the flows too complex. more flows is not bad, so split them up

Make 2 flows for the trigger  
1 WHEN movement AND luminance is lower then 15 AND NOT dagdeel nacht THEN trigger flow 3

2 WHEN movement AND luminance is lower then 15 AND dagdeel nacht THEN trigger flow 4

3 WHEN this flow is started … your 20% flow

4 WHEN this flow is started… your 5% flow

Put them Together in a folder. This way they are much easier to read, lesser error prone. (And you can also trigger flow 3 and 4 for other purposes)

---

<div class="post-metadata">

**Author:** ![Jeroen\_Kokhuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_kokhuis/32/12592_2.png) [@Jeroen\_Kokhuis](https://community.homey.app/u/Jeroen_Kokhuis)\
**Post date:** [September 11, 2019, 6:25pm UTC](https://community.homey.app/t/light-dim-at-night/17953/5 "2019-09-11T18:25:58Z")

</div>

I did created a second flow just like you described and it works perfect. Thanks
