basnijholt / adaptive-lighting

Adaptive Lighting custom component for Home Assistant
https://basnijholt.github.io/adaptive-lighting/
Apache License 2.0
1.71k stars 128 forks source link

adaptive_light.apply does not use color temp when light is in sleep mode #790

Open asolochek opened 10 months ago

asolochek commented 10 months ago

Home Assistant Adaptive Lighting Issue Template

Bug Reports

If you need help with using or configuring Adaptive Lighting, please open a Q&A discussion thread here instead.

Before submitting a bug report, please follow these troubleshooting steps:

Please confirm that you have completed the following steps:

Required information for bug reports:

Please include the following information in your issue.

Issues missing this information may not be addressed.

  1. Debug logs captured while the issue occurred. See here for instructions on enabling debug logging:
[adapt_error.log](https://github.com/basnijholt/adaptive-lighting/files/12641442/adapt_error.log)
  1. Your Adaptive Lighting configuration:
[adaptive_lighting_living_room.txt](https://github.com/basnijholt/adaptive-lighting/files/12641463/adaptive_lighting_living_room.txt)
  1. (If using Zigbee2MQTT), provide your configuration files (remove all personal information before posting):
    • devices.yaml
    • groups.yaml
    • configuration.yaml ⚠️; Warning REMOVE ALL of the PERSONAL INFORMATION BELOW before posting ⚠️;
      • mqtt: server:
      • mqtt: user:
      • mqtt: password:
      • advanced: pan_id:
      • advanced: network_key:
      • anything in log_syslog if you use this
    • Brand and model number of problematic light(s)


4.  Describe the bug and how to reproduce it:

When calling adaptive_lighting.apply service on a light that is in sleep mode, the light gets set to the sleep mode RGB color, despite it being configured to use the color temperature. This is the service call I'm using:

- service: adaptive_lighting.apply
    data:
      lights:
      - light.living_room_ceiling
      entity_id: switch.adaptive_lighting_living_room
      adapt_color: true
      prefer_rgb_color: false
    enabled: true

For testing I set the RGB sleep color to green, and the sleep color_temp is 2500. If I toggle the sleep switch manually, the lights will change to the correct color (although still at 100% brightness, which I think is a different bug), but if I then call the above service the lights turn green. 

5. Steps to reproduce the behavior: