[APP][Pro] Circadian Lighting

@Niclas Of course :slight_smile:

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

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

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.

1 Like