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

<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

---

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