Circadian Lighting [Custom Component]

Hello,
Really great component here! I’m pretty new with the HA configuration, and I’m having some trouble setting up a little extra functionality, I’m trying to make a control for “Max Brightness”, so I can set that dynamically, as some times I like to have it a bit darker that the default for that time of day, but I also want to to continue darkening to the configured min_brightness. To do that, I’ve created an input_number, which I have working in Lovelace, but when I try to integrate that with the config for CL, I get this error:

Invalid config for [switch.circadian_lighting]: expected int for dictionary value @ data['max_brightness']. Got "{{ states('input_number.cl_max_brightness') | int }}". (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.circadian_lighting/

This is the relevant part of my configuration.yaml:

    # max_brightness: input_number.cl_max_brightness
    max_brightness: "{{ states('input_number.cl_max_brightness') | int }}"
    # max_brightness: '{{ states.input_number.cl_max_brightness | int }}'
    # max_brightness: {{ states.input_number.cl_max_brightness | int }}

and the config for cl_max_brightness:

input_number:
  cl_max_brightness:
    min: 5
    max: 100
    name: 'Max Brightness'
    initial: 100
    icon: mdi:mdi-lightbulb

Otherwise the component works fine, I’ve tried all of the ways that it’s commented out in the code snippet. Any ideas what I’m doing wrong, or is this just not possible with the component?

Thanks!

Not possible currently, I’d have to look into what’s involved with allowing templates in the configuration.

Edit: I created an issue here so I won’t forget to look into this.

1 Like

Manual override:

I have a lot of Hue bulbs controlled by RaspBee / deCONZ. The light is turned on/off using a Hue dimmer, and Circadian Lighting is automatically controlling the brightness and colour via hassio. Overall, I’m really happy with the setup! :slight_smile:

A few times, I have the need to manually override the automatic brightness. But when I do that (either using the Hue dimmer, the lovelace interface, etc), CL is gradually returning brightness to the previous setting over a couple of minutes.

I know I can turn off the CL switch, but it would be nice not having to do that. Is it e.g. possible to use the disable_state option to automatically switch off CL when I have manually adjusted brightness with the Hue dimmer? And then let CL regain control by e.g. turning the lights off/on?

1 Like

Best way to handle this is to write an automation that turns off the CL switch when your dimmer is used. Then you can just re-enable CL with a single tap of ON on the dimmer, or whatever you want.

Hello,

I’m a happy CL user for quite a while now. Thanks for this great component !

I think in the early versions, it was possible to define a sleep_brightness with no sleep_colortemp.
It seems not possible anymore, as when in sleep mode, if colortemp is not set, brightness is not ajusted.

Is that a normal behavior?
If so I will duplicate CL switches as I’d like to keep CL colortemp and just reduce brightness in sleep mode

Hmm, I don’t have it programmed this way intentionally but it also does expect both sleep brightness and sleep colortemp, so if no sleep colortemp is configured it should just adjust brightness. Even if we figure out why it’s not doing that it won’t really work how you want with using the normal colortemp. I opened an issue here and I’ll fix it along with the few other enhancements that should be made as soon as I have time.

Thank you @claytonjn !

I understand that in the past, while it worked, it used the last colortemp then. I haven’t played with sleep mode since month

As a temporary solution, I duplicate my CL switches, and enable/disable day or sleep switch with a boolean

  - platform: circadian_lighting # this one shall not exist
    lights_ct:
      - light.salon_table
    disable_entity: input_boolean.nuit
    disable_state: "on"
    name: Luminothérapie Table

  - platform: circadian_lighting
    lights_ct:
      - light.salon_table
    max_brightness: 2 # shall be sleep_brightness
    disable_entity: input_boolean.nuit # shall be sleep_entity
    disable_state: "off"
    name: Luminothérapie Table (nuit)

Is anyone using this component with version 101

Yes I am. Working fine.

Hi folks :slight_smile:

Totally new to this HA scene, but I’ve got a VM server running with Circadian Lighting controlling our rather dumb IKEA Trådfri lights with the smartness of this component. I have dialed in the temperatures to our liking and now remains managing the brightness a bit more finely and later some type of on/off based on our presence in the apartment/on the wifi.

When I get up at somewhere between 05:45-06:30 I prefer to not be blinded as I was this morning heh… The bulbs where set at 50% brightness and I get that the "Circadian "aspect is a whole thing of deciding what’s best for the human animal but I’m quite sure I’d like to have a say regarding the brigtness of my initial 45 minutes of the day. As far as I grasp my option is to set a lower max_brightness value, but that’s not it really. Maybe an sunrise offset could help as well.

Quick question on the sunrise offset. The instructions states “Sting ((-)HH:MM:SS)” with the minus in parentheses which renders me unsure on the format. Would the following mean, offset by 45 minutes before sun rise? When the sun have technically risen it’s still quite dark, do I want it offset before or after? Not sure now that I’m writing about it hm…

sunrise_offset: -00:45:00

Any thoughts on how I would insert a little exception or a rule that forces a maximum brightness between 05:00-07:00 in the morning. That would really solve it for our bat-family.

Thanks for any tips, help and pointers.

I am trying to set this up with 2 Yeelight bulbs which support white (dimmable / tuneable color) color… my config is:

switch:
  - platform: circadian_lighting
    lights_ct:
      - light.bedroom-j
      - light.bedroom-k

I am seeing the following in my logs:


2019-12-26 16:53:14 ERROR (MainThread) [homeassistant.config] Invalid config for [switch.circadian_lighting]: Entity ID light.bedroom-j is an invalid entity id for dictionary value @ data['lights_ct']. Got ['light.bedroom-j', 'light.bedroom-k']. (See /config/configuration.yaml, line 78). Please check the docs at https://home-assistant.io/integrations/circadian_lighting/

Thanks!

Hi @krock
It looks to me like you misspelled your light entities. Shouldn’t they be with an underscore?
So something like this:

switch:
  - platform: circadian_lighting
    lights_ct:
      - light.bedroom_j
      - light.bedroom_k

Hyphens are not valid characters for entity names

1 Like

@CM000n - thanks! that fixed it :slight_smile:
I found that I had to specify the max and min color to get it to adjust the color temperature (at first it would only adjust the brightness) thanks!!

I have circadian setup for two zones - I’d like to deactivate circadian in one of them when my TV turns on (I have an automation setup to dim lights, etc when Apple TV plays…) could someone please advise how to turn off circadian for one group of lights and not another? Thanks!

You just have to set up a different Circadian Lighting switch for each zone and turn the switch off for whichever zone you want to deactivate.

Thanks @claytonjn - I tried adding another instance of - platform: circadian_lighting after my switch… but I still only see the one circadian switch in HA. could you please advise?..

…edit: I found that if I named the two light groups it gives me 2 switches - thanks!

Is there a way to turn off circadian lighting based on an input from a lutron pico remote?

If the pico remote is integrated with HA then you can either use the disable_entity and disable_state as described here, or you could use an automation triggered by the pico remote to turn on/off the CL switch, or you could use node-red, etc.

Anyone else have an issue when the lights first turn on the brightness is wrong? If I then turn them off and back on the brightness sets properly but it’s really annoying to walk in a room and the brightness on the bulbs is way too low for the time of day. What gets me more is it isn’t consistent some bulbs work fine 1 time then different the next. Any ideas?

edit: nvm see the stuff about ikea bulbs and working on other remedies people have suggested.

Is it possible to make the lights keep the color I choose on my own without disabling the circadian switch for the light? If I have circadian started on a light and try to change to some color like blue, it will just revert back to whatever color I had before by circadian.

If I tell google home to change the lights to blue, it will not work, it will just revert back because the circadian switches is on. It would be awesome to be able to have the switches on and still be able to change color on the lights.

Maybe it can be done by letting circadian sense that the light is chaning color to blue and keep them blue for a specific time in the configuration.yaml?
Even if I have “interval” in the config set to “600”, it will still revert back if I try to change color.