# 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:** 37

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

```

---

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