[APP][Pro] Circadian Lighting

One flow triggers by circadian zone (with adaptive mode) (maybe an extra condition to execute after a certain time, or indication that you woke up). I think you’ve figured this out and working :wink:
Second flow triggers at a certain moment (for instance a certain time or indication that you go to sleep) and sends the circadian value’s of the other circadian zone (with night mode) to the light (these are variables of that zone that you can use as tag’s in flows)

So i figured out how to use the circadian light values from this app, to set colour of lights that don’t have the “color temperature” capability.

There is this little app that converts colors:

It needs colortemperature in Kelvin as input an converts it to all sorts of other color variant (HSB, RGB) in different ranges (0-1, 0-100, 0-360, 0-255).

I assume the Kelvin range of circadian light is 2700K (Sunset) to 6500K (Noon). The color temperature output from Circadian lighting app is from 1 (Sunset) to 0 (Noon). So with this calculation I calculate the Kelvin value.

{{round(2700+((6500-2700)*(1-[circadian zone color temperature tag])),0)}}

And send that to color tools, which converts it to other color variants, to be used for lights.

It takes two flows to make this work (due to color tools way of working).

Flow one: When circadian value changed (trigger card from Circadian Lighting), then convert Color temperature (converted to Kelvin with calculation above) to color parse event (action card from Color Tools)
Flow two: When color parse event parsed (trigger card from color tools), then set light to color value’s (14 to choose from from color tool parse event card)(action card from your light)

1 Like

Damn, we got a saying here in the Netherlands ‘Not looking any further then your nose’. I was only looking at the first values presented from the list of logic values. Not searching for the actual ‘devices’ circadian zones.

Thank you.

1 Like

Graag gedaan :wink:.

Using the values of the circadian zone device, makes it also possible to set a light to the current circadian values when switching a light on (so you don’t have to wait till first change in values to trigger the current Color).

1 Like

Yeah, I figured that out by using Logic values… (my Circadian Zone Change, changes a Logic Value). That is not needed anymore as well… :upside_down_face:

The developer of Color Tools added 2 flow cards to be used in advanced flows. That way the converted values can be used right away (without parsing it via an event). Nice service @Shakesbeard :wink:

So this is my advanced flow now:

Upper part is for always updating light color values (even if light is not on, so when switching light on, it’s in correct light color immediately)

Lower part is for adjusting brightness when light is on, or when light is switched on. (Notice I use dim level of circadian light zone device, because the trigger cards for switching light on don’t have the local tag for brightness coming from “Circadian values changed”).

3 Likes

Since it’s not possible to switch modes using a flow, does anyone know if that would be possible using Homey Script?

Donate the developer a beer and ask for a flow card :wink:

I would be happy to donate. Haven’t found a donate-link to the developer though.

@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

And a second beer from me :beer:, but first let’s wait on a reaction of the developer if he is willing to look into our feature request’s :wink:

Yes, you are right. The Paypal/donation settings in missing in the app. So there is no donation :heart: on the app page.

Fabulous! Thank you very much @Torch1969! You made my day (and night) :-).

1 Like

I installed the app and I can see that if I add a Circadian Zone and choose the adaptive lightning option, the brightness and color temperature in the zone adjust based on the time of the day. How do I link this to a specific light source in my house? Let’s say I turn on a light source when the sun is up and turn it off late at night. I would like the light source to follow the settings/conditions visible in the circadian zone: dimmer light and warmer temperature as it gets dark outside. Is it possible ‘automatically’ or do I need to trigger a change every 15min for example through a flow?

Use the trigger of your zone device and its tags in a flow and set temperature and dim value of you light. The flow gets triggered when the zome changes.
Use the duration option to get a smooth invisible transition (if supported ba your light/app).
If your light turns on on dim change, just add a condition “and light is on”.

1 Like

@Krzysiek it’s exactly as @RonnyW explains.
Also see my post with advanced flow just above the one you react on :slight_smile:

1 Like

Great, thank you both @RonnyW and @Torch1969!

So would it be something like this? I will test it today in the evening. Just one more question. From your experience, do I need to convert the color temperature values to Kelvins? I think that they are set in Kelvins in my LED strip controllers and I am not sure if they will react correctly if the sent value is in percentages. If not, I will test your proposed solution of converting the value to Kelvins.

Looks good.
The Homey device of your light will use the Homey capability which has the same definition like the tags from the Circadian trigger.

In addition I added a trigger for switching on the light (second trigger). There I set the global tags from the Circadian zone device to dim to current value without waiting for the next dim change.
When switching on with other trigger (Alexa for me), the light will still switch on to the last dim value and dim down/up immediately. I can’t dim the light “in background” because a dim value >0 will switch on the light (Hue).

And you can add a duration (right click on the card and select duration) if this is supported by your lights.

1 Like

Great! I will add those extra triggers as well. Thank you!

That depends on the capabilities and value ranges of your led strip homey device. If they do not correspond, convert them with color tool app.