# Simple Motion Activated Advanced Flow

**URL:** <https://community.homey.app/t/simple-motion-activated-advanced-flow/72257>\
**Category:** Flows\
**Tags:** flow, homey-pro, advancedflow\
**Created:** [November 16, 2022, 3:31pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257 "2022-11-16T15:31:52Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [November 16, 2022, 3:31pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/1 "2022-11-16T15:31:53Z")

</div>

This category is created to show, and explain the working of specific Flows in homey.  
Can anyone see why this is failing?

What is wrong with this Flow, What is missing?

ie When Back Door Motion Sensor detects motion turn on the lights - wait 10 seconds turn off.

Once I can get this to work will add if the Luminance is below a certain level AND motion detected.

 ![Screenshot 2022-11-16 at 15.27.16](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/4/a439a9666efe97b74e2e6f453dcda7b7866cfece.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:** [November 16, 2022, 3:44pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/2 "2022-11-16T15:44:54Z")

</div>

You have used a condition card “The motion alarm is on” as a trigger card. But you have to use the trigger card “The motion alarm turned on”.

---

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [November 16, 2022, 3:51pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/3 "2022-11-16T15:51:41Z")

</div>

Good catch thanks!!

So then in this case once lux goes below xxxxxlx AND Motion is detected it should work

 ![Screenshot 2022-11-16 at 15.49.42](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/8/4888a0f711183bcdfd247bf1dbe363f460317227.png)

---

<div class="post-metadata">

**Author:** ![DaneedeKruyff](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daneedekruyff/32/964_2.png) [@DaneedeKruyff](https://community.homey.app/u/DaneedeKruyff)\
**Post date:** [November 16, 2022, 4:11pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/4 "2022-11-16T16:11:25Z")

</div>

It _could_ work, but not always.  
To achieve it _should_ work I’d have the trigger on detecting motion and add the luminance check as a condition.

---

<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:** [November 16, 2022, 4:32pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/5 "2022-11-16T16:32:17Z")

</div>

As @DaneedeKruyff say:

**When…**  
— The motion alarm turned on  
**And…**  
— Lux \< 10000 (really high value 🤔)  
**Then…**  
— whatever

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 16, 2022, 4:41pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/6 "2022-11-16T16:41:34Z")

</div>

> [@Busta999](#):
>
> This category is created to show, and explain the working of specific Flows in homey.

Here, some examples:

> [@The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/5):
>
> Zone activated Light/Device with Lux condition Here is a flow that lets you control a light or other device, based on the lux of a sensor, when a zone detects motion. The light or device are only turned on/off when it’s not yet on/off. Just replace the items with your own: Required App [Chronograph](https://homey.app/nl-nl/app/nl.fellownet.chronograph/Chronograph/) TEF: H4sIAAAAAAACA7VWS5PbNgz+KzuaHJcpnyKpa3vM9NDuqR2PByRBW1Nb8sjyJunW/72gbO/a2abRbNODTVLC4wPwAdRT9Wff4f6h/wV3G4hYNU+VsoBCyZqBs4JpB8B8iJFJGVKSNZdWTnIdbGmtfiMDdz+X/fF4X6XyxgT…

> [@The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/6):
>
> Motion activated Light/Device with Lux condition Here is a flow that lets you control a light or other device, based on the lux of a sensor, when a motion device detects motion. The light or device are only turned on/off when it’s not yet on/off. Just replace the items with your own: If your Luminance belongs to the Sensor you select, you can leave Luminance to Don’t change, and it will change with settings the Sensor. So, just select your Sensor en Light. Required Ap…

> [@The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/24):
>
> Motion activated Light/Device, off after a certain time of no motion This flow uses a motion sensor to turn a device (light) on and after 5 minutes (can be adjusted) if no motion, it turns the device off. Set you device (light) and your motion sensor: Apps used: [Chronograph](https://homey.app/nl-nl/app/nl.fellownet.chronograph) TEF: [TEF:FLOWS:H4sIAAAAAAACA61UTW/bMAz9K4bOUadPS8p1O26n7TYUASVRiYHEDhy3WxHkv49WUqDBWizoeogtRRT9Ht8jjyyz5ZE5n6TGpLh1FrhBRB50VlxiDKpEJ4sLc1zPluxrt95MbMESrbd1fVowG61XzliuhfPcBFt4CJ5W2uoA…

---

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [November 16, 2022, 5:35pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/7 "2022-11-16T17:35:07Z")

</div>

Agreed

But not supported in Homey ☹

You can’t have LUX as an AND ☹  
At least I can’t see it as an option.

 ![Screenshot 2022-11-16 at 17.31.44](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/9/59d909d663ddd8125d73ab858d3c32fe23199026.png)

There must be a way to trigger a light based on motion AND it being dark surely I cannot be the first person who only need the light on when it is dark?

The 10,000 is a sunny (ish) day - trying to test the Flow drops to \<100 lux for real use

---

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [November 16, 2022, 5:38pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/8 "2022-11-16T17:38:04Z")

</div>

I guess I may be able to detect when the sensor shows it as being Dark outside and create a variable “ITSDARKOUTSIDE” = TRUE

Then use that variable as an AND statement - I’ll test it.

Pretty cack handed way though

---

<div class="post-metadata">

**Author:** ![DaneedeKruyff](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daneedekruyff/32/964_2.png) [@DaneedeKruyff](https://community.homey.app/u/DaneedeKruyff)\
**Post date:** [November 16, 2022, 5:38pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/9 "2022-11-16T17:38:34Z")

</div>

You need to use a logic card as a condition, in that card you can compare the tag containing the lux value to your desired value.

---

<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:** [November 17, 2022, 4:54am UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/10 "2022-11-17T04:54:13Z")

</div>

Please have a look at this tutorial:

> **[Using Homey Logic in Flows](https://support.homey.app/hc/en-us/articles/4410240765586-Using-Homey-Logic-in-Flows)**
>
> You’ve probably seen Homey Logic. Once you get the hang of it, it's a great tool for any smart home. By creating your own Variables and using these in your Flows as Tags, you can often accomplish c...

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 17, 2022, 6:14am UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/11 "2022-11-17T06:14:43Z")

</div>

> [@DirkG](#):
>
> Please have a look at this tutorial:

Hey Dirk,

While it’s an awesome link (thank you!), it doesn’t show (i didn’t watch the whole video yet, skimmed it) what @Busta999 needs.  
So just to clearify things:

This is the card you need:  
Add the next **And** card:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/0/f0993303cff984d96c8e9cb78239a0fde29a8e1a.png)

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/5/b5eb617de508957040a5c7b75ed93e4638652da1.png)

- [tag:Number] is smaller then [number]

Here you place the Lux Tag from sensor in the tag:number field.

This is how you compare many device/app values in Flows: The Logic cards and the tags.

---

<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:** [November 17, 2022, 9:56am UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/12 "2022-11-17T09:56:27Z")

</div>

This was just an additional information about using logic in flows. @DaneedeKruyff had already described how @Busta999 has to implement it.

---

<div class="post-metadata">

**Author:** ![Philip\_Montgomery](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philip_montgomery/32/12434_2.png) [@Philip\_Montgomery](https://community.homey.app/u/Philip_Montgomery)\
**Post date:** [November 17, 2022, 10:14am UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/13 "2022-11-17T10:14:44Z")

</div>

![Screenshot 2022-11-17 101335](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/3/235ab31510fd9437ad90335b50ad4ccf1cfb86e3.jpeg)  
Hue scenes set in the Hue phone app, been working grand

---

<div class="post-metadata">

**Author:** ![Homey2](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/homey2/32/37387_2.png) [@Homey2](https://community.homey.app/u/Homey2)\
**Post date:** [November 20, 2022, 10:50am UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/14 "2022-11-20T10:50:29Z")

</div>

@Arie_J_Godschalk

In the first example, Zone activated Light, why use chronograph?

There is a card for IF zone inactive for 5 min.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 20, 2022, 11:22am UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/15 "2022-11-20T11:22:46Z")

</div>

I know, there also is a zone active example.

But zone activity goes upwards, so i personally prefer to use a motion-flow, instead of a zone-activity flow.  
It gives me a more clear direct control over a light and sensor.

Also handy if you have multiple lamps and sensors in one “room”, like, i have a few lights and sensors in the hallway, and the should not al be activated the same way like a group. The light in front of the bathroom should not be activated when someone walks to the kitchen.

But yeah, you can also use Zone Activity, like [The Flow Exchange(r) - Exchange Your Flows with Others! - #5 by Arie\_J\_Godschalk](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/5).  
Altho, i see it still uses Chronograph.

Tou know what, i guess i just havent seen a good example using the zone-activity-time.  
Perhaps you can create and post a great example?

---

<div class="post-metadata">

**Author:** ![Homey2](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/homey2/32/37387_2.png) [@Homey2](https://community.homey.app/u/Homey2)\
**Post date:** [December 4, 2022, 6:10pm UTC](https://community.homey.app/t/simple-motion-activated-advanced-flow/72257/16 "2022-12-04T18:10:48Z")

</div>

> [@Turn light off?](https://community.homey.app/t/turn-light-off/69916/8):
>
> If you do not mind, I post below an alternative using the built-in timers of Homey. Many ways lead to Rome. The benefit is easy maintenance: Add/Replace a motion sensor to a zone Add/Replace lamps to a zone No need for a special stopwatch/countdown Downside: One virtual device (motion trigger) required smiling_face_with_tear Virtual Devices are extremely useful.
