Human Centric Lightning (HCL)

There is this Lightning Concept “Human Centric Lightning” where the brightness and the color temperature gets adjusted during the day.

There are some KNX Dimemrs that can output HCL values just by checking a box. Like the MDT AKD-0424R2.

I was wondering if anyone here did something like this in openhab
via rule
or script
or has a formula
that could be used to pre calculate the values for a tunable white spot.

There is somewhere a thread where the color temperature is adjusted during the day.

HCL isn’t really about absolute brightness values, that depends on the local light sources and their placement.
Color temperature in turn is fairly simple because most tunables won’t allow for setting exact numbers but will offer a set of predefined levels.
So make it as cold as possible in the morning (6500+ K), as warm as possible in the evening (~2700 K), daylight inbetween (~4000-6000 K).

See e.g. https://www.licht.de/fileadmin/Publications/licht-wissen/1809_lw21_E_Guide_HCL_web.pdf
page 20f

I have written a scene based lighting automation called Eos that can sort of do what you want if you provide the values. I have some tuneable bulbs in my kitchen that I do this with using different scenes for morning, daytime, and evening. I also vary the brightness based on light level in the room.

3 Likes

The Wiki link at the bottom is broken (the menu one is ok)

Just flipped trough the wiki and it sounds great.

Thanks for that

1 Like

@mstormi Interesting, I used a relative link and it does not work as expected. I will fix it when I have a minute. Thank you for reporting.

@Dibbler42 Let me know if you have questions, issues, etc. User base is small (might just be me still) so I don’t have a lot of feedback. There may be things I haven’t found in my usage yet.

1 Like

Thank you for all your answers.

EOS Scripts are very interesting.

And since HCL is only one outcome they might be also part of the solution for my house automation plan, where I would like to set up a dataset for every room with all according items (triggers, lights, audio, scenes, shutters, …) in it. More or less like it is done there.

Looks like I finally have to install python in OpenHAB :stuck_out_tongue_winking_eye:

1 Like

For reference, here is my Eos config for the lights I was referring to. They are Sonoff RGBWW bulbs (B1 if I recall) running Espurna, configured to think it has only RGB channels, I manage the WW and CW channels manually using separate items. The channels are 0-255 and not 0-100.

FYI I don’t have any real light level sensors right now, so in the backend I am using values from Astro and the weather to approximate outdoor light level and then scaling per room based on sun angle. So if the lux values look strange it’s because they aren’t real.

I have moved to using Jython scripts that run before any other rules (they are named 210_xxx.py and my other rules have a prefix of 300 or higher) to assign the metadata when openHAB starts. I have found this more manageable than using the Eos Editor because I am using git to manage my entire openHAB config. The example below is an excerpt from my 210_kitchen.py file.

from core.metadata import set_metadata

set_metadata("kitchen_light_island_warmwhite", "eos",
    {
        "morning": {
            "alias_scene": "soft"
        },
        "day": {
            "alias_scene": "soft"
        },
        "evening": {
            "alias_scene": "soft"
        },
        "bright": {
            "level_high": 800,
            "state_low": 150,
            "level_low": 400
        },
        "soft": {
            "level_high": 1000,
            "state_low": 175,
            "level_low": 200
        },
    },
    value="True",
    overwrite=True
)

set_metadata("kitchen_light_island_coldwhite", "eos",
    {
        "bright": {
            "level_high": 800,
            "level_low": 400
        },
        "soft": {
            "level_high": 1000,
            "state_low": 45,
            "level_low": 200
        }
    },
    value="True",
    overwrite=True
)
1 Like

I have implemented live HCL on the ESPHome platform.

You need two white LED stripes with different color temperatures, for example 6.000K and 2.700K, which then can be mixed to give the intermediate color temperatur values.

If you want to replicate your outside conditions, you have to calculate the sun*s color temperature from the actual sun elevation in degrees for your location. This is a function of the air mass between your location and the sun. Aproximately (Pseudo code):

      float suncolor = 2700 
      if (sunelevation > 0) { 
        suncolor += sin(sunelevation * PI / 180.0) * 3800  }

Then drive your two LED’s to give the calculated sun color temperature.