Circadian Lighting [Custom Component]

Why is my light still being adjusted for brightness?! This is driving me crazy :slight_smile: All i need CL to take care of is color temp, and leave the brightness setting alone - what am I doing wrong here?

- platform: circadian_lighting
    name: circadian_no_bright
    disable_brightness_adjust: true
    lights_ct: 
      - light.bar_white

Uh, good question - what do the Debug Logs say?

Sure, here it is. At the first log entry I manually dim the light down to bri=17, then 3 mins later, the last log entry, it automatically bounces back to 254 (max).

2020-08-16 14:27:33 DEBUG (SyncWorker_54) [custom_components.circadian_lighting.switch] light.bar_white change from <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=254, color_temp=183.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T14:21:50.369023+03:00> to <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=17, color_temp=183.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T14:21:50.369023+03:00>
2020-08-16 14:27:50 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] now: 2020-08-16 14:27:50.996736+03:00
2020-08-16 14:27:50 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] Astral location: name/region, tz=Europe/London, lat=42.66, lon=23.38
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] today_sun_times: {'sunrise': datetime.datetime(2020, 8, 16, 6, 34, 54, tzinfo=<DstTzInfo 'Europe/Sofia' EEST+3:00:00 DST>), 'sunset': datetime.datetime(2020, 8, 16, 20, 26, 25, tzinfo=<DstTzInfo 'Europe/Sofia' EEST+3:00:00 DST>), 'solar_noon': datetime.datetime(2020, 8, 16, 13, 30, 39, tzinfo=<DstTzInfo 'Europe/Sofia' EEST+3:00:00 DST>), 'solar_midnight': datetime.datetime(2020, 8, 16, 1, 30, 35, tzinfo=<DstTzInfo 'Europe/Sofia' EEST+3:00:00 DST>)}
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] now_seconds: 1597577270.996736
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] sunrise_seconds: 1597548894.0
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] sunset_seconds: 1597598785.0
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] solar_midnight_seconds: 1597530635.0
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] solar_noon_seconds: 1597573839.0
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] h: 1597573839.0
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] k: 100
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] x: 1597598785.0
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] y: 0
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] a: -1.6069344595518494e-07
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] percentage: 98.10725592096446
2020-08-16 14:27:51 DEBUG (SyncWorker_14) [custom_components.circadian_lighting] Circadian Lighting Component Updated
2020-08-16 14:27:51 DEBUG (SyncWorker_7) [custom_components.circadian_lighting.switch] circadian_25 Switch Updated
2020-08-16 14:27:51 DEBUG (SyncWorker_7) [custom_components.circadian_lighting.switch] circadian_no_bright Switch Updated
2020-08-16 14:27:51 DEBUG (SyncWorker_49) [custom_components.circadian_lighting.switch] circadian_50 Switch Updated
2020-08-16 14:27:51 DEBUG (SyncWorker_49) [custom_components.circadian_lighting.switch] circadian_100 Switch Updated
2020-08-16 14:27:51 DEBUG (SyncWorker_5) [custom_components.circadian_lighting.sensor] Circadian Lighting Sensor Updated
2020-08-16 14:27:51 DEBUG (SyncWorker_7) [custom_components.circadian_lighting.switch] light.bar_white CT Adjusted - color_temp: 183, brightness: None, transition: 60.0
2020-08-16 14:30:26 DEBUG (SyncWorker_27) [custom_components.circadian_lighting.switch] light.bar_white change from <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=17, color_temp=183.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T14:21:50.369023+03:00> to <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=254, color_temp=183.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T14:21:50.369023+03:00>

Interesting, what type of light is light.bar_white? In the second to last line you can see that Iā€™m not sending a brightness value, but for that particular light it seems that it goes to 100% if no value is sent. Could you try a manual service call to confirm if thatā€™s the case? (Turn off CL switch so it doesnā€™t interfere, set light.bar_white to some brightness level < 100, go to services tab of developer tools page, choose light.turn_on for the service, put the following for service data)

entity_id: light.bar_white
color_temp: 183
brightness: None
transition: 60.0

@claytonjn, thanks for helping out!

What you suggested as a service call results in error as,obviously, INT is expected instead of string:

2020-08-16 19:24:07 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140636159056624] expected int for dictionary value @ data['brightness']

Itā€™s still rather weird. I did turn off the circadian switch this light is assigned to, yet the component is sending brightness values again! Look at this:

2020-08-16 19:25:59 DEBUG (SyncWorker_32) [custom_components.circadian_lighting.switch] light.bar_white change from <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=254, color_temp=301.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T19:21:57.631490+03:00> to <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=21, color_temp=301.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T19:21:57.631490+03:00>
2020-08-16 19:26:35 DEBUG (SyncWorker_24) [custom_components.circadian_lighting.switch] light.stairs_ikea change from <state light.stairs_ikea=off; is_deconz_group=False, friendly_name=Stairs IKEA, supported_features=41 @ 2020-08-16T19:24:52.310688+03:00> to <state light.stairs_ikea=on; brightness=254, is_deconz_group=False, friendly_name=Stairs IKEA, supported_features=41 @ 2020-08-16T19:26:35.364140+03:00>
2020-08-16 19:26:35 DEBUG (SyncWorker_24) [custom_components.circadian_lighting.switch] light.stairs_ikea Brightness Adjusted - brightness: 254, transition: 1.0
2020-08-16 19:26:36 DEBUG (SyncWorker_16) [custom_components.circadian_lighting.switch] light.entrance_light change from <state light.entrance_light=off; is_deconz_group=False, friendly_name=Entrance light, supported_features=41 @ 2020-08-16T19:19:21.921028+03:00> to <state light.entrance_light=on; brightness=254, is_deconz_group=False, friendly_name=Entrance light, supported_features=41 @ 2020-08-16T19:26:36.350146+03:00>
2020-08-16 19:26:36 DEBUG (SyncWorker_16) [custom_components.circadian_lighting.switch] light.entrance_light Brightness Adjusted - brightness: 254, transition: 1.0
2020-08-16 19:26:38 DEBUG (SyncWorker_13) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=off; min_mireds=153, max_mireds=454, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T12:45:23.172432+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=237, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:26:38 DEBUG (SyncWorker_13) [custom_components.circadian_lighting.switch] light.philips_ambience CT Adjusted - color_temp: 298, brightness: 254, transition: 1.0
2020-08-16 19:26:38 DEBUG (SyncWorker_17) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=237, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=298, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] now: 2020-08-16 19:27:51.913892+03:00
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] Astral location: name/region, tz=Europe/London, lat=42.66, lon=23.38
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] today_sun_times: {'sunrise': datetime.datetime(2020, 8, 16, 6, 35, 7, tzinfo=<DstTzInfo 'Europe/Sofia' EEST+3:00:00 DST>), 'sunset': datetime.datetime(2020, 8, 16, 20, 26, 6, tzinfo=<DstTzInfo 'Europe/Sofia' EEST+3:00:00 DST>), 'solar_noon': datetime.datetime(2020, 8, 16, 13, 30, 37, tzinfo=<DstTzInfo 'Europe/Sofia' EEST+3:00:00 DST>), 'solar_midnight': datetime.datetime(2020, 8, 16, 1, 30, 32, tzinfo=<DstTzInfo 'Europe/Sofia' EEST+3:00:00 DST>)}
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] now_seconds: 1597595271.913892
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] sunrise_seconds: 1597548907.0
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] sunset_seconds: 1597598766.0
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] solar_midnight_seconds: 1597530632.0
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] solar_noon_seconds: 1597573837.0
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] h: 1597573837.0
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] k: 100
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] x: 1597598766.0
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] y: 0
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] a: -1.6091268620025564e-07
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] percentage: 26.0677759054864
2020-08-16 19:27:51 DEBUG (SyncWorker_60) [custom_components.circadian_lighting] Circadian Lighting Component Updated
2020-08-16 19:27:51 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] circadian_25 Switch Updated
2020-08-16 19:27:51 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] light.philips_ambience CT Adjusted - color_temp: 304, brightness: 254, transition: 60.0
2020-08-16 19:27:51 DEBUG (SyncWorker_25) [custom_components.circadian_lighting.switch] circadian_no_bright Switch Updated
2020-08-16 19:27:51 DEBUG (SyncWorker_25) [custom_components.circadian_lighting.switch] circadian_no_bright off - not adjusting
2020-08-16 19:27:51 DEBUG (SyncWorker_25) [custom_components.circadian_lighting.switch] circadian_50 Switch Updated
2020-08-16 19:27:51 DEBUG (SyncWorker_25) [custom_components.circadian_lighting.switch] circadian_100 Switch Updated
2020-08-16 19:27:51 DEBUG (SyncWorker_18) [custom_components.circadian_lighting.sensor] Circadian Lighting Sensor Updated
2020-08-16 19:27:51 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] light.stairs_ikea Brightness Adjusted - brightness: 254, transition: 60.0
2020-08-16 19:27:51 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] light.bedroom_light Brightness Adjusted - brightness: 254, transition: 60.0
2020-08-16 19:27:51 DEBUG (SyncWorker_20) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=298, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=304, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:27:52 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] light.entrance_light Brightness Adjusted - brightness: 254, transition: 60.0
2020-08-16 19:28:01 DEBUG (SyncWorker_34) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=304, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=298, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:28:04 DEBUG (SyncWorker_63) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=298, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=299, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:28:05 DEBUG (SyncWorker_23) [custom_components.circadian_lighting.switch] light.stairs_ikea change from <state light.stairs_ikea=on; brightness=254, is_deconz_group=False, friendly_name=Stairs IKEA, supported_features=41 @ 2020-08-16T19:26:35.364140+03:00> to <state light.stairs_ikea=off; is_deconz_group=False, friendly_name=Stairs IKEA, supported_features=41 @ 2020-08-16T19:28:05.505582+03:00>
2020-08-16 19:28:16 DEBUG (SyncWorker_21) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=299, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=300, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:28:28 DEBUG (SyncWorker_8) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=300, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=301, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:28:36 DEBUG (SyncWorker_53) [custom_components.circadian_lighting.switch] light.entrance_light change from <state light.entrance_light=on; brightness=254, is_deconz_group=False, friendly_name=Entrance light, supported_features=41 @ 2020-08-16T19:26:36.350146+03:00> to <state light.entrance_light=off; is_deconz_group=False, friendly_name=Entrance light, supported_features=41 @ 2020-08-16T19:28:36.380124+03:00>
2020-08-16 19:28:41 DEBUG (SyncWorker_40) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=301, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=302, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:28:53 DEBUG (SyncWorker_41) [custom_components.circadian_lighting.switch] light.philips_ambience change from <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=302, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00> to <state light.philips_ambience=on; min_mireds=153, max_mireds=454, brightness=254, color_temp=304, is_deconz_group=False, friendly_name=Philips ambience, supported_features=43 @ 2020-08-16T19:26:38.482441+03:00>
2020-08-16 19:29:15 DEBUG (SyncWorker_20) [custom_components.circadian_lighting.switch] light.stairs_ikea change from <state light.stairs_ikea=off; is_deconz_group=False, friendly_name=Stairs IKEA, supported_features=41 @ 2020-08-16T19:28:05.505582+03:00> to <state light.stairs_ikea=on; brightness=254, is_deconz_group=False, friendly_name=Stairs IKEA, supported_features=41 @ 2020-08-16T19:29:15.821904+03:00>
2020-08-16 19:29:15 DEBUG (SyncWorker_20) [custom_components.circadian_lighting.switch] light.stairs_ikea Brightness Adjusted - brightness: 254, transition: 1.0
2020-08-16 19:29:50 DEBUG (SyncWorker_35) [custom_components.circadian_lighting.switch] light.bar_white change from <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=21, color_temp=301.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T19:21:57.631490+03:00> to <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=254, color_temp=306.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T19:21:57.631490+03:00>

At 19:27 it reports that the switch is off and it will not adjust:

2020-08-16 19:27:51 DEBUG (SyncWorker_25) [custom_components.circadian_lighting.switch] circadian_no_bright off - not adjusting

yet it does precisely two minutes later:

2020-08-16 19:29:50 DEBUG (SyncWorker_35) [custom_components.circadian_lighting.switch] light.bar_white change from <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=21, color_temp=301.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T19:21:57.631490+03:00> to <state light.bar_white=on; min_mireds=166.6666717529297, max_mireds=333.3333435058594, brightness=254, color_temp=306.0, friendly_name=bar white, supported_features=43 @ 2020-08-16T19:21:57.631490+03:00>

unrelated, but I canā€™t give you enough praise for this addon - by far one of the very few, very meaningful HA extensions!

Oh yeah, I didnā€™t think about thatā€¦Iā€™m not sure how you could simulate the same going from my python code to the frontend services page. :thinking:

So that entry isnā€™t saying that CL sent a change, itā€™s actually just logging what it sees from the state machine. Hereā€™s some explanation:

This is an example of lights being updated on your configured interval:

[...]
2020-08-16 19:27:51 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] circadian_25 Switch Updated
2020-08-16 19:27:51 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] light.philips_ambience CT Adjusted - color_temp: 304, brightness: 254, transition: 60.0
[...]
2020-08-16 19:27:51 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] light.stairs_ikea Brightness Adjusted - brightness: 254, transition: 60.0
2020-08-16 19:27:51 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] light.bedroom_light Brightness Adjusted - brightness: 254, transition: 60
[...]
2020-08-16 19:27:52 DEBUG (SyncWorker_0) [custom_components.circadian_lighting.switch] light.entrance_light Brightness Adjusted - brightness: 254, transition: 60.0

In this case you can see that the switch calculated new values, then it adjusted the 4 lights (ā€œentity_id light type Adjusted - [ā€¦]ā€)

This is an example of a light being updated because a light was turned on:

[...]
2020-08-16 19:29:15 DEBUG (SyncWorker_20) [custom_components.circadian_lighting.switch] light.stairs_ikea change from <state light.stairs_ikea=off; is_deconz_group=False, friendly_name=Stairs IKEA, supported_features=41 @ 2020-08-16T19:28:05.505582+03:00> to <state light.stairs_ikea=on; brightness=254, is_deconz_group=False, friendly_name=Stairs IKEA, supported_features=41 @ 2020-08-16T19:29:15.821904+03:00>
2020-08-16 19:29:15 DEBUG (SyncWorker_20) [custom_components.circadian_lighting.switch] light.stairs_ikea Brightness Adjusted - brightness: 254, transition: 1.0
[...]

In this case you can see that CL detects the state change from off to on and then sends the adjustment (ā€œentity_id light type Adjusted - [ā€¦]ā€)

So based on that excerpt, there was no entries of CL making any changes - it is detecting it change from brightness 254 to 21 (first line) and then change back from 21 to 254 (last line). Interestingly in the last line it also detects a change in color_temp from 301 to 306.

Unless thereā€™s something missing from that log excerpt, it appears that something else is making changes to that light.

@claytonjn, many thanks for the time to look into this! Any pointers on how I can trace further whatā€™s actually triggering the state change? Iā€™m at a loss hereā€¦

Come to think of it, I might have an underlying problem as I have another entity triggering without a good reason as I describe in more detail here - How to trace what triggers an event?

I realize this is turning into off topic, but any help in weeding out this would be much appreciated.

It would be SO cool to have VEML light sensors supported in ESPHOME. Think, youā€™d be able to ā€œreplicateā€ actual ambient outside color temperature in your lightning. Havenā€™t really investigated how that (outside) color temperature info could be used to control lights, but most likely that is trivial in HA world.

Thatā€™d be very natural lightning.

wanted to report back that the issue is solved now.
I moved from deCONZ to zigbee2mqtt and now also the LED controller (dresden FLS-PP) works as it should. funny it works better with zigbee2mqtt in this scenario than with their own software.

anyhow, one more thin: it is a LED controller that exposes two devices. an RGB one and a WHITE one.
it would be nice if you could build support for something like that. what happens now is that even when I say lights_xy: rgb controler entity and lights_brightness: white controller entity, the white part takes over and it is simply too whiteish.

and: it would be nice to configure offsets for each bulb. if you mix manufacturers, they have very different colors for the same setting :slight_smile:

thanks!

Ok hereā€™s a new challenge,
I want all lights to change the warmness? Yes.

But would like one of them -> the hallway light to stay 100 percent full blast (brightness).
What could be done to make that happen?

Through custom config or maybe heck, even tweak the component code just a little?

You just create circadian lighting ā€˜switchesā€™ for lights you want to control and you can then leave the hallway circadian lighting switch off

EDIT: so you want the hallway light to change colour temp but not brightness? If thats the case, then use the advanced config where you can leave the brightness unaffected ( disable_brightness_adjust) No need to modify the python component, Clayton has already thought of this :slight_smile:

But thatā€™s no brightness for all, right?
I do still love to keep the brightness for some, tho. That would be nice.

No, you can setup as many ā€˜circadian lightingā€™ switches as you want, allowing you to turn on/off that setting for individual lights or groups of lights independently

1 Like

Nice,
how about the dimmers,
I guess the ā€œbrightness onlyā€ group can also work with dimmers?
Or has the potential to work with dimmers?

Yes, it works with dimmers too

1 Like

Oh!!!
Very nice!

Hi @claytonjn,

Just wanted to drop by and leave a big thank you for making this custom_component.
I was using the default ā€œdusk/dawnā€ settings within the Lifx app, and they were awful compared to this component that you have put together.

This is a massive upgrade, many thanks

Hi folks, hope youā€™re all well.

As with many of you, Iā€™m loving this component - big thanks to @claytonjn :pray:t2:

I did have an issue I couldnā€™t get my head around, and was hoping someone might be able to please point me in the right direction?

All my bulbs are Hueā€™s - either colour ambiance, or white ambiance.
I have motion sensors that trigger an automation, which in turn calls a script, and my lights come on.

The dream is to have the lights turn on at the right bigness and colour temperature, so they donā€™t need to spend a second or so adjusting.

I thought I had this nailed by including the brightness and hs color values in the initial light.turn on service - see below.

 turn_on_study_spotlights:
   alias: "Turn on the Study Spotlights"
   sequence:
     - service: light.turn_on
       data_template:
         entity_id:
           - light.1st_floor
         brightness_pct: "{{ state_attr('switch.circadian_lighting_study','brightness') | float }}"
         hs_color: 
           - "{{ (state_attr('switch.circadian_lighting_study','hs_color')[0]) | float }}"
           - "{{ (state_attr('switch.circadian_lighting_study','hs_color')[1]) | float }}"

This is fine during the day whilst the colour temp doesnā€™t change, but in the eveningā€™s Iā€™m getting an odd phenomenon.

Motion triggers the light to come on but after a few seconds the colour temperature changes. When motion is detected whilst the lights are on, another light.turn_on command is sent (there are timers etc being reset as well etc), and the colour temperature changes again. A few seconds later, the circadian lighting component corrects the colour temp again. Its a little like an ever changing colour temperature disco!

In short, my brightness and hs_color approach in the script seems to set the lights to a slightly different colour temperature than the circadian lighting component sets them too.

Example switch below.

  - platform: circadian_lighting
    name: Study
    sleep_entity: 'input_select.hassio_alarm_state'
    sleep_state: 'Night'
    sleep_colortemp: 2000
    sleep_brightness: 1
    disable_entity: 'input_boolean.study_override'
    disable_state: 'on'
    initial_transition: 1
    lights_ct:
      - light.study_spotlights
    lights_brightness:
      - light.study_tv_light

What information would be useful in trying to debug this?

Thanks in advance ā€¦ :pray:t2:

I have documented a potential solution to the problem caused by light groups that allows you to keep using the Circadian Lighting component.

1 Like

If youā€™re using Hue lights and your lights are configured under lights_ct (the best option) then you should replace

hs_color: 
  - "{{ (state_attr('switch.circadian_lighting_study','hs_color')[0]) | float }}"
  - "{{ (state_attr('switch.circadian_lighting_study','hs_color')[1]) | float }}"

with

kelvin: "{{ (state_attr('sensor.circadian_values','colortemp') | float }}"

Basically you want your script to use the same method of adjusting the lights as CL, because going between kelvin and rgb/xy/hs all require some estimating with various levels of accuracy.