# \[APP\]\[Pro\] Circadian Lighting

**URL:** <https://community.homey.app/t/app-pro-circadian-lighting/74816>\
**Category:** Apps\
**Tags:** advancedflow\
**Created:** [January 9, 2023, 1:35pm UTC](https://community.homey.app/t/app-pro-circadian-lighting/74816 "2023-01-09T13:35:51Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [January 18, 2023, 8:34pm UTC](https://community.homey.app/t/app-pro-circadian-lighting/74816/27 "2023-01-18T20:34:21Z")

</div>

@Niclas Of course 🙂

Save this code as homey script with name"Set Circadian Light Mode" (or something else).  
Find your circadian lighting zone device\_id in homey developer tools and fill it in the script

```auto
//Change mode of Circadian Lighting zone
//possible argument value's: adaptive, night, manual

let a = args[0].split(',')
let mode = a[0].trim();

// Change id to id of your CricadianZone_obj here ------------\
const CircadianZone_obj = await Homey.devices.getDevice({id: '37b....Your_Device_ID_Here......750'});

await CircadianZone_obj.setCapabilityValue('adaptive_mode', mode)
    .then(() => log('OK'))
    .catch(error => log(`Error:`, error));

```

Call this script in a flow with the desired mode (adaptive, night, manual) as argument  
Like this: [Shared Flow | Homey](https://homey.app/f/O8SA6n/)

If you have more circadian lighting zones, duplicate the script for each zone, or make the script more advanced with the name of the zone as extra argument and lookup the device in the script based on the name.

---

_[View the full topic](https://community.homey.app/t/app-pro-circadian-lighting/74816)._
