# Light flow times and sun

**URL:** <https://discourse.nodered.org/t/light-flow-times-and-sun/20860>\
**Category:** General\
**Created:** [26 January 2020 00:58 UTC](https://discourse.nodered.org/t/light-flow-times-and-sun/20860 "2020-01-26T00:58:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oddmn](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@oddmn](https://discourse.nodered.org/u/oddmn)\
**Post date:** [26 January 2020 00:58 UTC](https://discourse.nodered.org/t/light-flow-times-and-sun/20860/1 "2020-01-26T00:58:32Z")

</div>

Hello.  
Trying to create a flow that dim lights at different times (ok). In the same flow i want to add my lux (fibaro motion sensor) reader to turn off/on light if it is light outside is bright.

here is my flow.

[flows(2).json](https://discourse.nodered.org/uploads/short-url/aO4p9TK68TX7t8eE0MJOKfOiDjo.json) (2.4 KB)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [26 January 2020 11:37 UTC](https://discourse.nodered.org/t/light-flow-times-and-sun/20860/2 "2020-01-26T11:37:13Z")

</div>

Was there a question in there? It also helps to give a screenshot of your flow to save people having to trawl through it which takes time. It also helps to tell us what custom node(s) you are using to try and get an outcome.

---

<div class="post-metadata">

**Author:** ![oddmn](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@oddmn](https://discourse.nodered.org/u/oddmn)\
**Post date:** [26 January 2020 11:57 UTC](https://discourse.nodered.org/t/light-flow-times-and-sun/20860/3 "2020-01-26T11:57:19Z")

</div>

I have setting up a flow that dim lights in different times of day. this work now.  
I then want to if possible to turn of the light when the suns come up or it get bright outside. Was thinking to use my fibaro montion senors for that. it read lux.  
setup is Nodered connecte to my Fibaro Hc2.

Or even better adjust the light all the way using only lux sensor if possible?

 ![light](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/391e64e353abf8fdc9ccecc94b06faa9d28361b2.jpeg)

[flows(3).json](https://discourse.nodered.org/uploads/short-url/d9WpZLm8cP9SPOP2pW5HL5jjXGG.json) (3.6 KB)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [26 January 2020 13:44 UTC](https://discourse.nodered.org/t/light-flow-times-and-sun/20860/4 "2020-01-26T13:44:57Z")

</div>

Have you checked in the flows library? There is at least one node that returns solar/lunar/celestial info (suncalc).

To base it on lux, get a flow that takes the sensor data, filters for the level you want and sets a flow variable. Your light on/off flow would test for that variable and only turn on if the level was appropriate.

You could also disaggregate the flows nicely by using MQTT.
