Circadian Lighting [Custom Component]

Indeed, that was it. Thanks!

Hello guys, I want to setup a cold temperature and a minimum bright at night, simulating a moon or stars. How can I achieve this? I’m relatively new, but I’m a coder so.

There are configuration options for sleep_colortemp and sleep_brightness, will those work for your use-case?

Hi,

I’m starting with Circadian Lighting and I’ve the following config:

circadian_lighting:
    sunset_time: "20:30:00"
    sunrise_time: "08:00:00"

This does change the ‘Circadian Values’ sensor, but I think it’s off by an hour or two:

The jump is where I changed the sun timing, but I would expect the jump to be downward.

Should I supply the time values in UTC? Or is this a bug?

Thanks in advance.

Kind regards,

Remco Poelstra

I can’t really say without more information. What time is sunrise and sunset in your location? What time did it hit -100? (it looks like ~4:00 but hard to tell) and what times was it at 0?

Sunrise and set are here around 5:55 and 21:35. It did hit 0% at these times before I changed the configuration.
After configuration it hit 0% at 10.00 and 22.30. Exactly two hours later than I would expect. I didn’t check the ±100% times.

I really enjoy this integration, it really works well in my house. I also want to thank the people who invested a lot of time in it (especially @claytonjn)

I want to bring the following strange behavior to all of your attention. I have a group of lights in my living room, with this code:

- platform: circadian_lighting
  name: "Woonkamer"
  lights_rgb:
    - light.woonkamer_grotebol
    - light.woonkamer_lichtbalk
    - light.woonkamer_lichtslang
    - light.woonkamer_tafellamp
    - light.woonkamer_stalamp
  min_brightness: 30
  max_brightness: 100
  sleep_entity: input_boolean.slaapkamer_slapen
  sleep_state: "on"
  sleep_colortemp: 2000
  sleep_brightness: 2

When I use transition to switch off all the lights (I use the whole group ‘Woonkamer’), all but one light switch off.

The light that does not switch off, is from another integration (LIFX Color), all other lights are via Zigbee.

This light supports transition, so that is not the problem. When I specifically target this light to switch off in transition, I can see that the light decreases in brightness, to go back to full brightness immediately.

This is when I started to think that it has to do with the Circadian Lighting integration. I switched off the Switch for the whole ‘Woonkamer’ group (the Circadian Lighting switch), and now when I target the specific light to dim out (transition), it slowly switches off, and it functions as designed.

I am a bit confused where I should start trying to solve this problem. Any help is welcome!

@jm1066 I was having the same problem and realized it was being caused by the interval setting I had added under the circadian_lighting configuration. I had it set like this:

circadian_lighting:
  min_colortemp: 2200
  max_colortemp: 6500
  interval: 1

I guess that interval value was too low, or it just didn’t work well with my integration (Phillips Hue). When I deleted the interval: 1 line, everything started working properly again. If you have that attribute set, try deleting it. Or if you don’t have it set, maybe try setting it to some different values?

This got lost in the black hole of my email inbox, I’m very sorry for not following up. Are you still having this issue?


If I had to guess, there is probably a difference in behavior in regards to what point in the transition causes the state to change in Home Assistant. Likely the Zigbee lights change state to off before the transition actually finishes, but the LIFX does not change state until the transition is completely done. If that’s the case, and Circadian Lighting triggers when the LIFX light is transitioning off but still reports as on in Home Assistant, it has no way of knowing that the light shouldn’t be adjusted. Unfortunately there’s not much that can be done there. The suggestion from @ccbell42 to reduce the interval is probably the best solution, but you’ll still encounter times where the interval just so happens to fall during the off transition
the longer the interval and shorter the off transition the less likely that is to happen, but there will always be some possibility.

To note, interval: 1 is pretty crazy :slight_smile: That means that every second Circadian Lighting would be making adjustments to lights, and with rounding the majority of those adjustments wouldn’t be actually doing anything at all. The default is 300 seconds (5 minutes), and with that the adjustments are still so fine that I have never in 5 years looked at a light and noticed it adjusting; I doubt even with 900 seconds (15 minutes) that adjustments would be noticeable.

Can anyone hint me towards what to do, where to look if outright nothing seems to work? I installed the comp via HACS, added the min configuration and can’t see it working, nor anything in the system logs. No sign of life. Thinking back, I think it never worked although installed one or two years ago.

circadian_lighting:
    transition: 60

My system:

Home Assistant 2023.10.3
Supervisor 2023.11.3
Operating System 10.2
Frontend 20231005.0 - latest

Thanks!

You need to specify which light(s) Circadian Lighting should control, by configuring one or more Circadian Lighting switches: GitHub - claytonjn/hass-circadian_lighting: Circadian Lighting custom component for Home Assistant

I remember from the old days that the important switches were in the off-state after the installation. When I turned them on manually, every started to work :slight_smile:

Thanks for the tips @claytonjn and @bouwew ! Both of you were right! Adding lights was not sth. that I interpreted as “optional” according to the docs, but mandatory, and second, the switch was off, I had to add it to a dashboard and turn it on. In the meantime I figured that just reloading the configuration does not suffice, I needed a restart!

Hi All,

Quick question I hope: Does the initial transition respect the disabled_entity and disabled_state? i.e. if the disabled condition matches and then the light or the circadian switch is turned on, does the component still apply the light adjustment?

This is the behaviour I seem to be seeing and just want to confirm if this is expected.

If the disabled condition matches and the light is turned on it definitely should not apply the adjustment - if it does that’s a bug. If the CL switch is turned on and the disabled condition matches I believe it should not apply the adjustment although this could be up for debate on what the expected behavior should be.

Hello All,

Is there a way of having the switch brightness attribute update sooner after a restart of HA?

Is it possible to configure the component multiple times for different locations?

I have a hydroponics grow light and it would be neat to have the light pinned some equatorial location vs the rest of my home lights which I want using my actual location.

What’s the preferred way to reduce brightness? I don’t want to reduce max_brightness or min_brightness, but instead I’d like to shift the transition down. So for example right now I’m at 86% brightness, but I’d prefer it to be down to 40% already.

Is there a dedicated configuration option for this?