Circadian Lighting [Custom Component]

Hi

Great component. I was wondering if I am doing something wrong.

I have Ikea lights that are both

  1. Ikea colour and white spectrum opal white
  2. Ikea white spectrum
  3. Philips Hue white

1 and 3 work as expected. 2 Ikea white spectrum do not change their color temp at all. In fact, I am able to self adjust them, where the others will force themselves back to position. I have also tried the lights_xy for these.

The 1 I have the following config:

  • platform: circadian_lighting
    name: “Circadian Lights”
    lights_brightness:
    • light.kitchen_island1
    • light.kitchen_island2
    • light.kitchen_island3
    • light.main_bedroom_hans_bedside_lamp
    • light.main_bedroom_shannon_bedside_lamp
      lights_ct:
    • light.olivia_bedroom_lamp
    • light.livingroom_hutch_lamp_1
    • light.livingroom_hutch_lamp_2
      lights_rgb:
    • light.livingroom_tv_lamp
    • light.main_bedroom_lamp

I hope that’s the case, if you don’t remember to five feedback it’s probably because everything’s working perfectly :smiley:

1 Like

@Hans_van_der_Drift in your example config you have the lights listed under lights_brightness which means that CL will only adjust brightness, not color temperature. You said you tried lights_xy - XY adjustment is meant for color lights and my guess is that because the white spectrum bulbs only change color temperature but not color that they don’t implement XY adjustment. Have you tried listing the Ikea White Spectrum bulbs under lights_ct?

You are correct. I was testing at that moment to see if I could get it working under different settings.

Here is my actual config, (the only lights not working correctly are the ones listed under CT)
On the CT lights I cannot move brightness scales (works correctly) but the colortemp I can adjust freely

- platform: circadian_lighting
  name: "Circadian Lights"
  lights_brightness:
    - light.kitchen_island1 #White Hue Light
    - light.kitchen_island2 #White Hue Light
    - light.kitchen_island3 #White Hue Light
    - light.main_bedroom_hans_bedside_lamp #White Hue Light
    - light.main_bedroom_shannon_bedside_lamp #White Hue Light
  lights_ct:
    - light.olivia_bedroom_lamp #Ikea White with The colour temperature can be switched between 2200 Kelvin (warm glow), 2700 Kelvin (warm white) and 4000 Kelvin (cool white).
    - light.livingroom_hutch_lamp_1 #Ikea White
    - light.livingroom_hutch_lamp_2 #Ikea White
  lights_rgb:  
    - light.livingroom_tv_lamp #Ikea Full Color
    - light.main_bedroom_lamp #Ikea Full ```

Oh sorry I missed that there was a lights_ct and lights_rgb section in the config you posted due to for the forum formatted it. Putting it in the code block helped a lot, and thanks for adding the comments describing each entity.

In the comment you put “The colour temperature can be switched between 2200 Kelvin (warm glow), 2700 Kelvin (warm white) and 4000 Kelvin (cool white).” Does that mean that those bulbs can only be set to exactly one of those three values (2200k, 2700k, 4000k) or could you set the bulbs to, for example, 3500k?

No, it can be adjusted granular on a slider

As per this image

image

The blurb is just from ikeas website.

Your component auto pilots the brightness but not the color temp. That is adjustable

Got it, thanks for clarifying. Can you try turning on debug logging and post the logs for CL after calling the circadian_lighting.values_update service? (Make sure to remove any location info if you don’t want that public). Instructions for enabling debug logging are here.

@claytonjn I have added the log lines to my config. Here are the results

https://paste.ubuntu.com/p/MsqHhZX7TH/

and another version

https://paste.ubuntu.com/p/mNgXtMkKR7/

and a third after sunset (the big one)

https://paste.ubuntu.com/p/XMBhWKSSNY/

This is my config:

circadian_lighting:
  min_colortemp: 2200 
  max_colortemp: 4000

Another piece to my puzzle.

These are the attributes from my ikea lights:
min_mireds: 153
max_mireds: 500

In the first log, CL sets the colortemp to 342 mireds (line 20) and the command appears to be successful (line 21). In the second log CL sets colortemp to 349 mireds (line 18) and I don’t see the pydeconz.utils success but I suspect it was further down. In the third log CL tries to set to 454 mireds. All three of those values are within the 153-500 range of the lights, so that’s not the issue.

I suspect the problem lies in the default transition value of 900. I’ve been experimenting with the following configuration with good results:

circadian_lighting:
  interval: 300
  transition: 60

I would try that (this is the main circadian_lighting configuration, not the individual switch configuration(s).

1 Like

I spent a fair bit of time looking at previous threads. A common factor is I have the following

  1. IKEA Lights
  2. Deconz using a zigbee network

It seems to have been an issue in the past. Some solutions I have red did not help. However, one that I sort of tested was using node red to control my light. The link I have not yet made is taking the sensor output and connecting it to my node red control.

You have mentioned using node red before. Do you have an example flow? I just need to see how you take the values outputted and convert them to mireds (value between 153 and 500) and brightness between 1 - 100.

I only use Node-RED for a very complex occupancy flow so I don’t have any examples. To get mireds it should just be 1000000/kelvin. Brightness you can pull from the attributes of the CL switch.

I would much prefer to figure out why CL isn’t working for you, adding Node-RED is just going to add another point of failure and additional overhead. Did you try playing with the transition and interval values like I suggested?

This is the current config and testing:

circadian_lighting:
  min_colortemp: 2200
  max_colortemp: 4000
  interval: 300
  transition: 60

- platform: circadian_lighting
  name: Circadian Colour
  lights_ct:
    - light.test_lamp

The fact that the sliders can/can’t move is not necessarily an indication that CL is/isn’t working properly. If you move your test lamp to the extreme warm side and run the circadian_lighting.values_update service does the color of the test lamp change? If you call the service light.turn_on with the following data does the test lamp change?

{
  "entity_id": "light.test_lamp",
  "color_temp": 349,
  "brightness": 255.0,
  "transition": 900.0
}

I’ve been testing the 1.0.5 update for a while.

The update seems to work fine over here, at my second attempt, I noticed nothing out of the ordinary, function-wise.

At my first attempt, I did notice some problems with HA after the update: restarting would take a long time and many time-related errors in the HA-log. After rolling the change back, all was OK again.
I don’t really have a clue what was/is going on, related to this error. It could be related to my particular setup, as I am constantly modding, extending it :slight_smile:

At my second attempt, I changed the version-text inside the file to 1.0.4, to not confuse the Update-Tracker. After the restart, this time there was no problem and my system has run smooth since, which was 2 days ago.

1 Like

It seems to be an Ikea issue with sending 2 commands simultaneously.

This works

{
  "entity_id": "light.test_lamp",
  "color_temp": 349,
  "transition": 900.0
}

This also works

{
  "entity_id": "light.test_lamp",
  "brightness": 255.0,
  "transition": 900.0
}

But not both. :frowning:

Okay perfect, at least we know what’s going on. My best advice would be to set up two CL switches for each of those particular lamps; one with disable_brightness_adjust set to true and one with the lights listed under lights_brightness. That way one switch will control color temperature and one will control brightness, sending two separate commands.

IKEA tradfri hub is problematic for the circadian light component. Besides not being able to accept both brightness and temperature in the same call, it is very prone to getting flooded with calls, then becoming unresponsive and requiring a hub restart. Better get some Hue if you want to do circadian lights without the headaches.

I can’t agree with this more. I got started with “smart home hubs” (first SmartThings, now HA) specifically because I wanted to be brand agnostic and just be able to use whatever product was best for a specific implementation, regardless of ecosystem. I have direct and indirect experience with a number of smart lights and switches, and at this point there would have to be an extremely compelling reason for me to get anything other than Hue. Especially now with the power-on behavior setting and the two new FOH switches, all complaints I could have made in the past are gone. I personally have more than 40 hue lights and they just work. I know they aren’t the cheapest option, but honestly I would recommend people save a little longer for Hue; I’ve been saving to replace the last few non-Hue lights still left in my household.

1 Like

One more update from me on the testing of the 1.0.5 update: I have traced back the issues that I reported before to another custom_component. Now with that one disabled, the 1.0.5 has been running reliably without any issue.

1 Like