# 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:** 20\
**Page:** 2

<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:** [July 19, 2021, 5:24pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/21 "2021-07-19T17:24:02Z")

</div>

Does anyone know if it is possible to use the build-in logic functions instead of the BetterLogic app.  
I use the BetterLogic app only for this use case and would like to delete the app.

---

<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:** [August 17, 2021, 10:24am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/22 "2021-08-17T10:24:41Z")

</div>

Advantage is, they can be easy viewed in the flow editor in the HomeyWeb App, handy when testing flow.

---

<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 17, 2021, 10:41am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/23 "2021-08-17T10:41:23Z")

</div>

Yes, this is an advantage from BL app, but I don’t need it.

---

<div class="post-metadata">

**Author:** ![GaryOz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garyoz/32/43146_2.png) [@GaryOz](https://community.homey.app/u/GaryOz)\
**Post date:** [August 21, 2021, 2:32pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/24 "2021-08-21T14:32:09Z")

</div>

Hi @DirkG

Do you mind sharing what you worked out?  
What is the ? in the flows??  
“Circadian 75% dimmed” and “Circadian 75% dimmed” are required to be created in Homey Logic as number variable, In take it?

I have created number variables for “CircadianRhythm\_\_brightness” and “CircadianRhythm\_\_brightness” in better logic and executed the scrip. But the values of the variables are stuck on 0 and not updating on executing script…

Thanks

---

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

---

<div class="post-metadata">

**Author:** ![GaryOz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/garyoz/32/43146_2.png) [@GaryOz](https://community.homey.app/u/GaryOz)\
**Post date:** [August 22, 2021, 3:00pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/26 "2021-08-22T15:00:12Z")

</div>

Thanks mate!  
That helps.

To answer your question  
“I don’t know why they calculate to 2 digits after the decimal point, because the script does it automatically.”  
They do this, as Homey calculates brightness by decimal and not percentage. (0.50 = 50%, 0.14 =14%)

---

<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, 4:57pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/27 "2021-08-22T16:57:37Z")

</div>

I’m glad to hear that.

In generally I know why it has to be calculated to 2 digits.  
But I don’t know why they calculate in this case, because the output of the script is calculated to 2 digits already.

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [October 2, 2021, 2:48pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/28 "2021-10-02T14:48:13Z")

</div>

It should be relatively simple to turn this in to an app, just wondering if anyone has done that yet?

---

<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:** [October 2, 2021, 3:15pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/29 "2021-10-02T15:15:00Z")

</div>

The [Sun Events](https://homey.app/en-us/app/com.cyclone-software.sunevents/Sun-Events/) app takes “Sunlight Change” into account. With this value it’s possible to adjust the light temperature and brightness depending on the current position of the sun as explained in [this](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/17) post.  
So it’s not exact the same behavior of the light as done with the script, because “Sun Events method” takes into account the seasons.

Circadian Rhythm Light as @iotnerd wanted could probably have been realized with the app [Splines](https://community.homey.app/t/app-splines/40884), but the app is no longer available.

Otherwise, I don’t know of any other app.

---

<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 14, 2022, 9:46am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/30 "2022-04-14T09:46:19Z")

</div>

With the new beta Homey firmware release v7.4.0.-rc22 **logic** and **notification** permission for HomeyScript is added. According to this, the script should now be modifiable so that the Better Logik app is no longer needed, right?  
Does anyone have a hint how the script should be changed?

As mentioned before, I’m not a software programmer and I don’t know how to write a HomeyScript, so I would appreciate for any hints.

Info: I haven’t installed the beta firmware myself yet, so I couldn’t try a modified script at the moment.

---

<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 14, 2022, 4:34pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/31 "2022-04-14T16:34:31Z")

</div>

Hi Dirk,  
Yes, I also understood we can finally _write_ to logics variables on the v7.4.0RC version  
In theory this should work:  
In the **example-flowcard-list.js** script output, you can search for homey:manager:logic

Example

```auto
await Homey.flow.runFlowCardAction({  
  "uri": "homey:manager:logic",
  "id": "variable_set_string",
  "args": [
    {
      "name": "MyStringVariable",
      "type": "autocomplete",
      "title": "Text Variable"
    },
    {
      "name": "value",
      "type": "Hello World",
      "title": "Text"
    }
  ]});

```

This results in a Rejection error on pre-v7.4.x firmware

- all THEN cards:

```auto
Set [[variable]] to [[value]]

{
  "uri": "homey:manager:logic",
  "id": "variable_set_string",
  "args": [
    {
      "name": "variable",
      "type": "autocomplete",
      "title": "Text Variable"
    },
    {
      "name": "value",
      "type": "text",
      "title": "Text"
    }
  ]
}

-----------

Set [[variable]] to [[value]]

{
  "uri": "homey:manager:logic",
  "id": "variable_set_number",
  "args": [
    {
      "name": "variable",
      "type": "autocomplete",
      "title": "Number Variable"
    },
    {
      "name": "value",
      "type": "number",
      "title": "Number"
    }
  ]
}

-----------

Calculate [[variable]] as [[value]]

{
  "uri": "homey:manager:logic",
  "id": "variable_set_number_math",
  "args": [
    {
      "name": "variable",
      "type": "autocomplete",
      "title": "Number Variable"
    },
    {
      "name": "value",
      "type": "text",
      "placeholder": "Number"
    }
  ]
}

-----------

Set [[variable]] to [[value]]

{
  "uri": "homey:manager:logic",
  "id": "variable_set_boolean",
  "args": [
    {
      "name": "variable",
      "type": "autocomplete",
      "title": "Yes/No Variable"
    },
    {
      "name": "value",
      "type": "checkbox",
      "value": true,
      "title": "Yes/No"
    }
  ]
}

-----------

Flip [[variable]]

{
  "uri": "homey:manager:logic",
  "id": "variable_toggle_boolean",
  "args": [
    {
      "name": "variable",
      "type": "autocomplete",
      "title": "Yes/No Variable"
    }
  ]
}

-----------

Make a HTTP [[method]] request to [[url]] with headers [[headers]] and body [[body]]

{
  "uri": "homey:manager:logic",
  "id": "http",
  "args": [
    {
      "name": "method",
      "type": "dropdown",
      "values": [
        {
          "id": "get",
          "title": "GET"
        },
        {
          "id": "post",
          "title": "POST"
        },
        {
          "id": "put",
          "title": "PUT"
        },
        {
          "id": "delete",
          "title": "DELETE"
        }
      ],
      "title": "Method"
    },
    {
      "name": "url",
      "type": "text",
      "title": "URL",
      "placeholder": "https://www.athom.com"
    },
    {
      "name": "headers",
      "type": "text",
      "required": false,
      "placeholder": "Content-Type: application/json",
      "title": "Headers"
    },
    {
      "name": "body",
      "type": "text",
      "required": false,
      "placeholder": "{ \"your\": \"value\" }",
      "title": "Body"
    }
  ]
}

```

- all AND cards:

```auto
[[droptoken]] is !{{|not}} exactly [[comparator]]

{
  "uri": "homey:manager:logic",
  "id": "equal",
  "args": [
    {
      "name": "comparator",
      "type": "text",
      "placeholder": "Value"
    }
  ],
  "droptoken": [
    "string",
    "number"
  ]
}

-----------

[[droptoken]] is equal to !{{`yes`|`no`}}

{
  "uri": "homey:manager:logic",
  "id": "equal_boolean",
  "droptoken": [
    "boolean"
  ]
}

-----------

[[droptoken]] !{{contains|doet not contain}} [[comparator]]

{
  "uri": "homey:manager:logic",
  "id": "contains",
  "args": [
    {
      "name": "comparator",
      "type": "text"
    }
  ],
  "droptoken": "string"
}

-----------

[[droptoken]] is !{{|not}} less than [[comparator]]

{
  "uri": "homey:manager:logic",
  "id": "lt",
  "args": [
    {
      "name": "comparator",
      "type": "number"
    }
  ],
  "droptoken": "number"
}

-----------

[[droptoken]] is !{{|not}} greater than [[comparator]]

{
  "uri": "homey:manager:logic",
  "id": "gt",
  "args": [
    {
      "name": "comparator",
      "type": "number"
    }
  ],
  "droptoken": "number"
}

-----------

Continue with a chance of [[chance]]

{
  "uri": "homey:manager:logic",
  "id": "random",
  "args": [
    {
      "name": "chance",
      "type": "number",
      "min": 0,
      "max": 100,
      "placeholder": "50%"
    }
  ]
}

-----------

[[variable]] is !{{|not}} equal to [[value]]

{
  "uri": "homey:manager:logic",
  "id": "var_equal",
  "args": [
    {
      "name": "variable",
      "type": "autocomplete",
      "title": "Variable"
    },
    {
      "name": "value",
      "type": "text",
      "placeholder": "value to compare to"
    }
  ]
}

-----------

[[value1]] [[operator]] [[value2]] is !{{true|false}}

{
  "uri": "homey:manager:logic",
  "id": "equation",
  "args": [
    {
      "name": "value1",
      "type": "text",
      "placeholder": "Value 1"
    },
    {
      "name": "operator",
      "type": "dropdown",
      "values": [
        {
          "id": "eq",
          "title": "is equal to"
        },
        {
          "id": "neq",
          "title": "is not"
        },
        {
          "id": "lt",
          "title": "is less than"
        },
        {
          "id": "gt",
          "title": "is more than"
        },
        {
          "id": "lte",
          "title": "is less than or equal to"
        },
        {
          "id": "gte",
          "title": "is more than or equal to"
        }
      ],
      "title": "Operator"
    },
    {
      "name": "value2",
      "type": "text",
      "placeholder": "Value 2"
    }
  ]
}

-----------

HTTP [[method]] to [[url]] with headers [[headers]] and body [[body]] is !{{|not}} equal to status code [[statusCode]]

{
  "uri": "homey:manager:logic",
  "id": "http_status_code_equals",
  "args": [
    {
      "name": "method",
      "type": "dropdown",
      "values": [
        {
          "id": "get",
          "title": "GET"
        },
        {
          "id": "post",
          "title": "POST"
        },
        {
          "id": "put",
          "title": "PUT"
        },
        {
          "id": "delete",
          "title": "DELETE"
        }
      ],
      "title": "Method"
    },
    {
      "name": "url",
      "type": "text",
      "title": "URL",
      "placeholder": "https://www.athom.com"
    },
    {
      "name": "headers",
      "type": "text",
      "required": false,
      "placeholder": "Content-Type: application/json",
      "title": "Headers"
    },
    {
      "name": "body",
      "type": "text",
      "required": false,
      "placeholder": "{ \"your\": \"value\" }",
      "title": "Body"
    },
    {
      "name": "statusCode",
      "type": "number",
      "min": 100,
      "max": 599,
      "title": "Response status code"
    }
  ]
}

```

---

<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:** [April 14, 2022, 5:21pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/32 "2022-04-14T17:21:04Z")

</div>

Yes you can, using it now for the current moon fase:  
Won’t be updating the entire script for circadian, but I guess this tip will at least help getting it along:

`await Homey.logic.updateVariable({id: 'VARIABLE_ID', variable: { value: VALUE } })`

You can retrieve the Variable ID(s) by pre-running a small command in Homey Script:  
`Homey.logic.getVariables().then(r => log(r))`  
Value should be the type the variable is, so do make sure the value is a number if the type is of the logic is also a number, I don’t think it will auto change

---

<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 16, 2022, 1:16pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/33 "2022-04-16T13:16:28Z")

</div>

Thx to @Peter_Kawa and @Caseda.

@Peter_Kawa, in my **example-flowcard-list.js** there is no homey:manager:logic. Maybe because I’m still on v7.3.0. Btw., I don’t see anything nearly similar in the examples to the current script with the Better Logic app, so I’m completely out of my depth with it.

This is the relevant part (I guess) of the actually script:

```auto
// use Better Logic app to store values and use later in Flows
let BLApp = await Homey.apps.getApp({ id: 'net.i-dev.betterlogic' });

// color temperature transitions from 1 to 0 to 1 during the day
temperature = roundDecimals((MAX_TEMPERATURE - (MAX_TEMPERATURE - MIN_TEMPERATURE) * getTemperaturePoint(dayProgress)));
console.log(`${VARIABLE_PREFIX}_temperature:\t`, temperature);

// brightness transitions from MIN to MAX to MIN during day
brightness = roundDecimals((MIN_BRIGHTNESS + (MAX_BRIGHTNESS - MIN_BRIGHTNESS) * getBrightnessPoint(dayProgress)));
console.log(`${VARIABLE_PREFIX}_brightness:\t`, brightness);

BLApp.apiPut(`${VARIABLE_PREFIX}temperature/${temperature}`);
BLApp.apiPut(`${VARIABLE_PREFIX}brightness/${brightness}`);

```

@Caseda, this looks much better for me… 😉  
So I guess that I had to create two numeric variables with equal names.  
And the I have to change the line

```auto
let BLApp = await Homey.apps.getApp({ id: 'net.i-dev.betterlogic' });

```

into

```auto
await Homey.logic.updateVariable({id: 'VARIABLE_ID', variable: { value: VALUE } });

```

right?  
Info: Actually I’m not able to get the right Variable ID because I’m still on v7.3.0 as already mentioned.

But what about the rest of the entries that relate to the BL app?

---

<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 16, 2022, 1:46pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/34 "2022-04-16T13:46:03Z")

</div>

> [@DirkG](#):
>
> in my **example-flowcard-list.js** there is no homey:manager:logic.

YW. That’s odd, Dirk. I’m on v7.3.0 as well.  
Ahh, I think you didn’t run the script and searched for it in the results.  
That’s what I meant with

> [@Peter\_Kawa](#):
>
> In the **example-flowcard-list.js** script output, you can search for homey:manager:logic

---

<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, 2022, 6:29am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/35 "2022-04-17T06:29:09Z")

</div>

Ahh, okay, now I understand. But this is too complicated for me to understand. I understand that these are the possible commands, but I don’t know how to use them.

---

<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 21, 2022, 11:29pm UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/36 "2022-04-21T23:29:36Z")

</div>

> [@Caseda](#):
>
> You can retrieve the Variable ID(s) by pre-running a small command in Homey Script:

This returns the ID (and the value) when you input your var name 🙃

```auto
// Replace MyVar with your var name
let varName = "MyVar"
const logicVars = await Homey.logic.getVariables();
for (var iLogicVar in logicVars){
  if (logicVars[iLogicVar].name == varName)
log("Variable: " + logicVars[iLogicVar].name + "\nValue:\t " + logicVars[iLogicVar].value + "\nID:\t " + logicVars[iLogicVar].id)
}

```

> ![Screenshot from 2022-04-22 03-19-53](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/9/79d63f22d39867655636611ae9e9cb150f3d8d2c.png)

.

> [@DirkG](#):
>
> Actually I’m not able to get the right Variable ID because I’m still on v7.3.0 as already mentioned.

This is possible on 7.3.0 also @DirkG  
just like `Homey.logic.getVariables().then(r => log(r))`  
which returns all of your variables & ID’s

---

<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 22, 2022, 1:11am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/37 "2022-04-22T01:11:30Z")

</div>

> [@DirkG](#):
>
> And then I have to change the line
> 
> ```auto
> let BLApp = await Homey.apps.getApp({ id: 'net.i-dev.betterlogic' });
> 
> ```
> 
> into
> 
> ```auto
> await Homey.logic.updateVariable({id: 'VARIABLE_ID', variable: { value: VALUE } });
> 
> ```
> 
> right?

It should be something like this with Logics variables. (First create the variables, and then go [find the variable ID’s](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/36) )

```auto
// This is not needed anylonger, so comment out or remove
//let BLApp = await Homey.apps.getApp({ id: 'net.i-dev.betterlogic' });

//BLApp.apiPut(`${VARIABLE_PREFIX}temperature/${temperature}`);
await Homey.logic.updateVariable({id: '1a164078-63fc-470c-ac76-9da7f113445e', variable: { value: temperature } })
// The example ID should be the ID from var '${VARIABLE_PREFIX}_temperature'

//BLApp.apiPut(`${VARIABLE_PREFIX}brightness/${brightness}`);
await Homey.logic.updateVariable({id: '1a164078-63fc-470c-ac76-9da7f113445e', variable: { value: brightness } })
// The example ID should be the ID from var '${VARIABLE_PREFIX}_brightness'

```

---

<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 25, 2022, 10:27am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/38 "2022-04-25T10:27:56Z")

</div>

Just installed rc.22 and adjusted the script accordingly your (@Peter_Kawa and @Caseda) suggestion.  
First try seems to look good. The (new) Homey logic variables are filled with the correct values.  
Tomorrow I will let you know, if it worked correct.

Thank you very much for your efforts!

**EDIT**  
It worked like it should.

 ![IMG_0845.PNG](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/2/32b268c03c5f012888c4e80489cdcea9c3a61a27.jpeg)

So thank you very much for helping out @Caseda and @Peter_Kawa! And @iotnerd of course for the grate script! 👍🏼

---

<div class="post-metadata">

**Author:** ![skeppet\_varvare\_0j](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/skeppet_varvare_0j/32/54514_2.png) [@skeppet\_varvare\_0j](https://community.homey.app/u/skeppet_varvare_0j)\
**Post date:** [April 29, 2022, 8:10am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/39 "2022-04-29T08:10:20Z")

</div>

Hi!

Just got my Homey and have been eager to set up circadian lighting (amongst a lot of other things, of course…).

May I ask for the entire updated script and some guidance on which variables I should create and where to put their ID’s in the script?

Best regards.

---

<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 29, 2022, 8:49am UTC](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/40 "2022-04-29T08:49:10Z")

</div>

You wrote “updated script”, but it depends on Homey firmware. So for which Homey firmware? v7.3.0 (or lower) or v7.4.x (experimental)?  
“Tutorial” for firmware v7.3.0 (or lower) please see post [#25](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/25).

Btw, it is not recommended to install an experimental firmware on production systems.

[Previous page](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348.md?page=1)

[Next page](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348.md?page=3)
