# Just tried to make a flow. Won't work

**URL:** <https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356>\
**Category:** Questions & Help\
**Created:** [December 9, 2023, 10:56pm UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356 "2023-12-09T22:56:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RJUK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rjuk/32/79584_2.png) [@RJUK](https://community.homey.app/u/RJUK)\
**Post date:** [December 9, 2023, 10:56pm UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356/1 "2023-12-09T22:56:14Z")

</div>

Hi folks, I just tried to make a super basic flow and it won’t work. Not sure what hope I have of making a complicated one when something so basic won’t even work.

The flow is simple. I have an Aqara P1 motion sensor and a Sonoff Zigbee plug.

My flow just says “if the P1 sensor detects a lux under 15 lux and the movement alarm is triggered, then turn the lamp on.” Simple.

Except, the P1 is reporting 0 lux and the motion alarm is triggered and nothing happens. It seems to work if I don’t specify the lux, but even then the light just seems to stay on indefinitely. I just want it on for, say, 30 seconds unless further movement is detected.

There isn’t any obvious way to do that really basic thing though and I want it to account for the lux level so the light doesn’t activate during the day.

What am I doing wrong?

 ![IMG_4087](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/a/7afe0212f6d1d26934e5d656d8daeced5dc3a75c.png)

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [December 9, 2023, 11:21pm UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356/2 "2023-12-09T23:21:12Z")

</div>

When the lux goes below 15 lux while there is no movement, the flow wil never trigger any more.  
So change the lux and movement:  
WHEN movement is detected  
AND lux is less 15  
THEN turn on the light

To switch off the light you make another flow:  
WHEN no movement is detected  
THEN switch off the light with a delay of 1 minute

There are plenty examples of more sophisticated flows, with counters or zone activity, that prevend the light to switch off when motion is detected again during the one minute delay time.

---

<div class="post-metadata">

**Author:** ![RJUK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rjuk/32/79584_2.png) [@RJUK](https://community.homey.app/u/RJUK)\
**Post date:** [December 10, 2023, 12:13am UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356/3 "2023-12-10T00:13:48Z")

</div>

I already thought about that, but it forces me to pick the lux first. If I start with “if there is motion” then there is no lux setting to be selected, for some reason…

---

<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:** [December 10, 2023, 4:14am UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356/4 "2023-12-10T04:14:05Z")

</div>

For the check of the brightness (lux) in the _ **And…** _ section, you have to use a logic flow card:

 ![IMG_3826](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/b/cbfde48bc61a74e44ba5061891f6e61660f02846.jpeg)

---

<div class="post-metadata">

**Author:** ![RJUK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rjuk/32/79584_2.png) [@RJUK](https://community.homey.app/u/RJUK)\
**Post date:** [December 30, 2023, 5:29pm UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356/5 "2023-12-30T17:29:27Z")

</div>

Thanks, that worked.

How do I get that same light to turn off after, say, 30 seconds if no further movement is detected?

---

<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:** [December 30, 2023, 6:13pm UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356/6 "2023-12-30T18:13:44Z")

</div>

You can use this tutorial as base. You just need to add the brightness logic flow card:

> [@\[Simple\] Lights turning on/off based on motion](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889):
>
> Simple flow for turning lights on and off based on motion What to use Timer app. In this case i used [the Countdown app](https://apps.athom.com/app/nl.bevlogenheid.countdown) Motion sensor. Used a Neo Coolcam pir v1 in this case. A light to switch on and off. Used a Fibaro Dimmer2 in this case to turn a “dumb bulb”. Start making the timer We click more/apps/Countdown. Then we click configure app. Here we make the timer. Choose a name for your timer. In this case i used “Badkamer” Click “Add timer” Start making the flows In this case i used…

Or you can use _ **Zone Activity** _ as already mentioned by @Rmb.  
For more info about _ **Zone Activity** _ please check these support articles:

> **[Using Zone Activity](https://support.homey.app/hc/en-us/articles/360026209853-Using-Zone-Activity-)**
>
> Zone Activity enables Homey users to view and respond to activity in their homes. For example, when someone enters the Hallway Zone, a motion sensor or door/contact sensor can detect this, making t...

> **[Customizing Zones](https://support.homey.app/hc/en-us/articles/360012079134-Customizing-Zones)**
>
> You can manage the structure of your home and the names and icons of Zones in the Devices tab in the Homey app and in the Homey Web App. Take a look at how to customize your smart home!
> Changing th...

---

<div class="post-metadata">

**Author:** ![RJUK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rjuk/32/79584_2.png) [@RJUK](https://community.homey.app/u/RJUK)\
**Post date:** [December 30, 2023, 6:58pm UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356/7 "2023-12-30T18:58:47Z")

</div>

Thanks. Got that working also - your help has been amazing.

One last request, if I may?

How can I also have this flow not fire between certain hours? When I put my young daughter to bed, I want to be able to sneak out of her room without the lamp on the landing triggering, so want to suppress the flow between, say, 8pm and 6am.

\*Edit: don’t worry - just noticed the time/date part. Missed that earlier. All sorted.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [January 2, 2024, 8:15am UTC](https://community.homey.app/t/just-tried-to-make-a-flow-wont-work/97356/8 "2024-01-02T08:15:53Z")

</div>

Here’s an example with zone activity.  
Saves a lot of time and tweaking.

> [@Please help me with my first advanced flow](https://community.homey.app/t/please-help-me-with-my-first-advanced-flow/96573/40):
>
> When making the first steps with Homey advanced flows, best is to keep it simple. I advocate built-in timers and zones. This helps you avoid making mistakes and they are more efficient. You can always make it more sophisticated later. The below example flow does not use any specific device. It assumes the motion sensor and the light are in the room (zone) you created. So you can always drag more lights or motion sensors to the zone or change devices without having to adjust the flow. Less ma…
