# \[Simple\] Lights turning on/off based on motion

**URL:** <https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889>\
**Category:** Flows\
**Tags:** flow\
**Created:** [March 21, 2019, 5:36pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889 "2019-03-21T17:36:00Z")\
**Posts on this page:** 11\
**Page:** 5

<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:** [July 22, 2023, 9:13am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/97 "2023-07-22T09:13:20Z")

</div>

Only put any additional conditions to the “light on” flow, or you might get the situation that a sudden increase of brightness (as example) your lights stay on.

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [July 22, 2023, 10:15am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/98 "2023-07-22T10:15:28Z")

</div>

> **[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...

Maybe this is usable for you.

---

<div class="post-metadata">

**Author:** ![The\_Cowman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/the_cowman/32/31807_2.png) [@The\_Cowman](https://community.homey.app/u/The_Cowman)\
**Post date:** [January 27, 2024, 2:32pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/99 "2024-01-27T14:32:23Z")

</div>

I’m a bit new into flows / advanced flows.  
However, I’m to start using this more frequently.

I’ve a Xiaomi motion sensor to switch on a light bulb when there is a motion, with the help of a Fibaro Relay Switch.  
But, I also want to be able to switch the light bulb with a manual switch. This switch is connected to the Fibaro Relay Switch and this is working.

So, I made an advanced flow, where the motion sensor enables the light bulb. This is working.  
But when there is motion detected and someone accidental also switch the manual switch, the light bulb gots turned off. But I want to change it such that the light bulb is switched on without a timer.  
How can I do this?  
Don’t know if I can ask this question in this topic; if not, please mention that and I will open a seperate topic.

 ![Advanced flow - Kelder](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/1/015986a3adad73a142e00d490af3e55099ebc0d8.png)

(I was not able to share an advanced flow, how do I do that?)

---

<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 27, 2024, 2:45pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/100 "2024-01-27T14:45:03Z")

</div>

> [@The\_Cowman](#):
>
> share an advanced flow, how do I do that?

Like you just did. Or use the[Flow Exchanger](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981), which can export & import flows directly.

In that same topic you’ll find several example flows on how to control a light without you being left in darkness

> [@The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/8):
>
> ### Flow example:
> 
> ![Screenshot from 2022-09-21 00-48-34](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/a/2aa742727e50bc75f1e9b207663d1b8b84560c32.png)

.

This one includes a luminance condition of any sensor (while a light does not always have to turn on at daytime), and a check if the light is on or not:

> [@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):
>
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/7/872eb2a13db1aefba1fd30d900e8032c1464240a.png)

´

---

<div class="post-metadata">

**Author:** ![The\_Cowman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/the_cowman/32/31807_2.png) [@The\_Cowman](https://community.homey.app/u/The_Cowman)\
**Post date:** [January 27, 2024, 8:19pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/101 "2024-01-27T20:19:31Z")

</div>

Hi Peter,

Thanks.  
Switching the light bulb with motion sensor is successful, also with timer.  
However, do you know how to overrule this flow when the normal (old fashioned switch with Fibaro Relay) is used. Then a timer of 1 hr should be used, but I don’t know how to setup this.

---

<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 27, 2024, 9:51pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/102 "2024-01-27T21:51:14Z")

</div>

YW, Cowman,

This is a good start I think:

> [@The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/84):
>
> # Zone activated Device with Manual Device OnOff option
> 
> When you have, say, a garage with (a) motion sensor(s), and (a) (garage)door sensor(s), the light should turn on for 3 minutes after a motion event, or an opened garagedoor;  
> While there’s movement, lights stay on;  
> When the button gets pushed, lights should turn on, and stay on until the button is pushed again.
> 
> ![Screenshot 2023-09-17 at 03-11-50 1.HomeyPro Peter](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/c/dc5e2a670aff248e5dc0f34e5574e59fe968955a.png)

---

<div class="post-metadata">

**Author:** ![The\_Cowman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/the_cowman/32/31807_2.png) [@The\_Cowman](https://community.homey.app/u/The_Cowman)\
**Post date:** [March 23, 2024, 11:33am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/103 "2024-03-23T11:33:59Z")

</div>

Hi Peter,

It took a while to find some time to work on this flow.  
Because the Flow Exchanger still isn’t working with all templates, I recreated the flow. At first I didn’t know that “push button” was an AVD.  
Now I have the AVD included, however, what flow is behind the “Push Button”-AVD?

For your information, I’m using a Fibaro switch to switch a normal light bulb. The fibaro switch is also connected to the wall switch. Currently, Homey doesn’t see any difference between an action with the wall switch and a switch via Homey (i.e. a flow). At least, not with my current Flow.

---

<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:** [March 24, 2024, 7:26pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/104 "2024-03-24T19:26:31Z")

</div>

Hi,

> [@The\_Cowman](#):
>
> Now I have the AVD included, however, what flow is behind the “Push Button”-AVD?

None, it’s just a virtual push button to show the functionality of this flow; I assume you replace it by the Fibaro.  
Then the flow would look something like this:

 ![Screenshot from 2024-03-24 20-25-21](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/8/28aeecb26dee024f03e69f02ebc6b811c9cb18be.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:** [April 17, 2024, 11:23am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/105 "2024-04-17T11:23:20Z")

</div>

4 posts were split to a new topic: [Turn off Roborock Dock when charging is finished](https://community.homey.app/t/turn-off-roborock-dock-when-charging-is-finished/108363)

---

<div class="post-metadata">

**Author:** ![Patrick\_Van\_Deursen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick_van_deursen/32/56539_2.png) [@Patrick\_Van\_Deursen](https://community.homey.app/u/Patrick_Van_Deursen)\
**Post date:** [April 23, 2024, 1:33pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/106 "2024-04-23T13:33:23Z")

</div>

hi Peter, just a question on the flow of yours, as I see it more often. after the fibaro wall switch on request, you have the check to see if the lights are turned off, and if so to turn them on. Why not immediately turn them on? Is that because you use a switch and not a push button?

---

<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:** [April 23, 2024, 7:40pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/107 "2024-04-23T19:40:34Z")

</div>

> [@Patrick\_Van\_Deursen](#):
>
> you have the check to see if the lights are turned off

Hi Patrick  
No, it can’t hurt to turn off/on the light when it’s already off/on.  
To me it’s cleaner from a logical or programmatical point of view I think.

A more hands-on example to check a light’s state would be:  
When…  
-button X is pressed  
And…  
-light A is on  
Then…  
-turn light A off  
Else…  
-turn light A on

[Previous page](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889.md?page=4)
