#RGB (0,0) into LIGHT TEMPERATURE (Kº) fade accompanied by brightness fade (0-255)

1 messages · Page 1 of 1 (latest)

south elk
#

Hi,
I'm currently using a smart RGB light (MUVIT IO MIOBULB018, through TUYA integration) in conjunction with "Ashley's Light Fader" so I can have a smooth white light temperature (Kº) and brightness fade (0-255) in the mornings.
However, this specific light has 2 separate settings, RGB (0,0) and WHITE LIGHT TEMPERATURE (Kº), and the brightness settings on these varies quite a lot. Since "Ashley's Light Fader" doesn't support RGB (0,0), I've had it always run solely on the white light temperature (Kº) settings of the bulb. The thing is, it's starting brightness is already too strong for my intended purposes (Although I just learned to live with it).

But recently, through testing with the integration "Adaptive Lighting" I was able to get a smooth RGB (0,0) into WHITE TEMPERATURE (Kº) fade accompanied by a smooth brightness transition (0-255).
Seeing that it's possible, I've been scouring the forums for different scripts similar to "Adaptive Lighting" but for a per case basis.

I've come across some scripts such as the one bellow but it fails to achieve the transition btw RGB (0,0) and White light (Kº).
I myself don't really understand how "adaptive lighting" does it.. I'm really not a coder, nor do I understand code languages on an intuitive level. I was really hopping to find a more comprehensive script...
Thank you for your time

#
alias: Sunrise
sequence:
  - variables:
      start_brightness: 1
      end_brightness: 255
      start_x: 0.7
      end_x: 0.25
      start_y: 0.3
      end_y: 0.25
      duration_minutes: 5
      delay_seconds: 2
      increment_brightness: "{{ (end_brightness - start_brightness) / duration_minutes }}"
      increment_x: "{{ (end_x - start_x) / duration_minutes }}"
      increment_y: "{{ (end_y - start_y) / duration_minutes }}"
  - data:
      xy_color: "{{ start_x }},{{ start_y }}"
      brightness: "{{ start_brightness }}"
    entity_id: light.a65_bulb
    action: light.turn_on
  - delay: "{{ delay_seconds }}"
  - repeat:
      count: "{{ duration_minutes }}"
      sequence:
        - data:
            xy_color: >-
              {{ state_attr('light.a65_bulb', 'xy_color')[0] | float +
              increment_x }},{{ state_attr('light.a65_bulb', 'xy_color')[1] |
              float + increment_y }}
            brightness: >-
              {{ state_attr('light.a65_bulb', 'brightness') | int +
              increment_brightness }}
          entity_id: light.a65_bulb
          action: light.turn_on
        - delay: "{{ delay_seconds }}"
mode: single
icon: mdi:sun-clock