# DIY circadian rhythm based lighting

**URL:** <https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348>\
**Category:** Developers\
**Tags:** app, homeyscript, flow\
**Created:** [August 7, 2020, 1:17pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348 "2020-08-07T13:17:53Z")\
**Posts on this page:** 1\
**Showing post:** 25

<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:** [August 22, 2021, 11:47am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/25 "2021-08-22T11:47:50Z")

</div>

Hi @GaryOz,

sorry, but I can’ t explain everything because I didn’ t program the script and I’ m not a programmer. Also, my process is a bit different from the one described by the author.

> [@GaryOz](#):
>
> What is the ? in the flows??

Don’t know, sorry. And I don’t know why they calculate to 2 digits after the decimal point, because the script does it automatically.

> [@GaryOz](#):
>
> “Circadian 75% dimmed” and “Circadian 75% dimmed” are required to be created in Homey Logic as number variable, In take it?

Yes

> [@GaryOz](#):
>
> I have created number variables for “CircadianRhythm\_\_brightness” and “CircadianRhythm\_\_brightness”

Please change the name of the variables as follows (only with one underscore):  
CircadianRhythm\_brightness  
CircadianRhythm\_temperature

This is how my solution looks like:

**Script**  
Found in post [#16](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/16)

**Numeric variables in better logic app**  
CircadianRhythm\_brightness  
CircadianRhythm\_temperature

**Numeric variables in Homey**  
(more → logic; you can name the variables as you like)  
CircadianDim  
CircadianTemp

**Flow 1**  
(to set the BL variables into Homey variables)

 ![Bildschirmfoto 2021-08-22 um 13.22.34](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/8/880c9cd1bdf8282bc0c830ea516e1640b9eee94b.png)

**Flow 2**  
(turn on lamp with the current logic values)

 ![Bildschirmfoto 2021-08-22 um 13.36.42](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/a/4a2281768440217d6fecaf896c434b18de5e46e5.png)

**Flow 3**  
(change of temperature when the lamp is on. The same for brightness)

 ![Bildschirmfoto 2021-08-22 um 13.39.57](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/7/8708e73e844e029b2f25132baf50dd70280c2917.png)

**The result**  
(Insights graph, 24 h)

 ![Bildschirmfoto 2021-08-22 um 13.30.11](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/b/fbaa476d25cbb455b8d209301756cc4f3e6431ae.png)

Info:  
You can change these parameters in the script according to your own needs.

```auto
const MIN_BRIGHTNESS = 0.35;
const MAX_BRIGHTNESS = 0.75;
const MIN_TEMPERATURE = 0.3;
const MAX_TEMPERATURE = 0.8;

```

I hope it is a little bit helpful.

---

_[View the full topic](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348)._
