Circadian Lighting [Custom Component]

I pushed out 1.0.5 yesterday with the new values calculation and also I changed the default interval and transition values which should hopefully provide better OOB compatibility.

Sorry, I donā€™t see this listed in the documentation, but what does the sleepmode do?

And how can I get the lights to dim earlier? They still seem to be quite bright when Iā€™m going to bed (long/lat is set correctly).

Basically, it allows you to set a specific colortemp/brightness, if you want to make sure the lights in your bedroom stay at 1% brightness if you get up in the middle of the night, for example.

Brightness adjusts from sunset to sunrise; from sunrise to sunset the lights stay at 100%. The intent is to mimic natural lighting: Twilight - Wikipedia

In reality itā€™s already dark by sunset, but to my knowledge thereā€™s no ā€œastronomical timeā€ before sunset that could be used to better determine when to start dimming. Unless someone knows of a better solution, by best advice would be to set a negative sunset offset to get the lights to start dimming earlier.

1 Like

Is it possible to set a minimum/maximum color temp for each individual light or switch?

I like having my office lights at max 5500, but if I put the max color temperature that high in other areas my wife will freak out.

No, not at the moment.

Would it be possible to set a maximum brightness for during the day (for a room with a ton of natural sunlight) that would then fade to a different (higher) maximum brightness at sunset?

Thatā€™s not possible currently, as of now CL basically adjusts temperature throughout the day and brightness throughout the night. My biggest concern with adding functionality like that is that CL already has a fairly complex set of configuration options and I donā€™t want to make it even more confusing for end-users.

If a room is well lit from natural sunlight, do the lights being full brightness cause an issue? In my experience turning on lights in a well lit room doesnā€™t really have much visual effect and with LED bulbs the difference in electricity usage at different brightness levels should be pretty minuscule.

I like to have all of my lights on as bright as possible most of the day. My wife claims that bright lights (especially high K) on during the day gives her migraines, so she spends most of the day with all of the lights off. When I walk into a room even if it is brightly lit with natural light I get annoyed if the lights are off. But her claim of migraines beats my claim of annoyance.

The best solution for me would be to have the lights on at ~30% at around 3500K during the peak, and have them increase in brightness and warmth as the sun is setting, then go to the normal program of lowering the brightness as the night progresses.

I can definitely sympathize with that, I get migraines as well. Iā€™ll have to think about whether I could implement that without adding too much complexity. You could open an issue in the GitHub repository if youā€™d like, so I donā€™t forget about it.

For now, though, you could write an automation accomplish the behavior you want by using the sensor.circadian_values state and setting brightness based on that.

Okay I think that makes sense. Iā€™ll play around with the settings a bit. I suppose I was after more than just circadian adjustments, and more of a scheduling tool, but now I see the intent here!

Cheers

Pushed out 1.0.6 yesterday. This update removes all of the configured options from the device attributes. The main reason for this change is to remove latitude, longitude, and elevation; so that the sensor.circadian_values entity doesnā€™t show up on the HA map. Based on the survey (here), however, all configured values are removed from attributes.

To be clear, the configuration options did not change - the only thing that changed is that you will no longer see what you configured in the device attributes (when you are on the dev-state page or when you click on an entity in the frontend).

The could be a breaking change if you were using those attributes, however I highly doubt that anyone was.

1 Like

HI, quick question. The circadian_lighting is not working anymore. What i see is that the switch is automatically switching off. When i put it back to on, after a x seconds if will be switch off automatic. Any idea ?

What do you see for circadian_lighting in the logs?

Hi, Iā€™m trying to use disable_entity and disable_state to disable the circadian switch when the light is in color mode since otherwise it gets reset in the next update cicle. Based on multiple searches nobody has tried to do this before or nobody has had issues :slight_smile:

Since disable_state expects a state I created a binary sensor that correctly identifies whether the light is in color mode based on the presense of the rgb_color attribute. However even though I see the binary sensor changing state on the UI the circadian switch still resets the light.

binary_sensor:
  - platform: template
    sensors:
      living_room_rgb:
        friendly_name: "Living Room RGB"
        value_template: "{{ state_attr('light.living_room_aux', 'rgb_color') != None }}"

switch:
  - platform: circadian_lighting
    name: Living Room AUX
    disable_brightness_adjust: true
    lights_ct:
      - light.living_room_aux
    disable_entity: binary_sensor.living_room_rgb
    disable_state: on

Hi, thanks for creating this awesome component.
I managed to get it installed and adjusting my lights.
However as soon as cl is turned on the lights are turned on also.
Iā€™m using tradfri lights.
Is this expected behaviour? Iwas expecting them to stay off until I switched them on and then adjust to the value set by cl.
Any ideas?

Yes, this behaviour was reported before in the thread.
The solution I use is to first turn on the circadian switch, then 500ms later the light. Also, first turn off the switch, then 500ms later the light.

Im using the tradfri remotes for manual turn on/off
Is it possible to turn on cl when a light state changes to on?

It should be possible to create automations for that.

I think Iā€™ve worked that out. Thanks for your help.
Thereā€™s probably a better way but for now Iā€™ve made one automation to turn cl on when the lights are on and another to do the opposite.
This way I just need to walk into the room and the lights come on and adjust automatically.
Just need to wait till night to see how sleep mode works
Iā€™m not too sure what I do to activate sleep mode.
Another switch? What should I do with the sleep entity?

Good job!

About the sleep mode, I think the subject was discussed before, just use the search-button to search in this topic.