Light brightness automation

If you are using the Ikea Intergration and have multiple bulbs , you can change the brightness on the group rather than the bulbs , this should give a smooth transition . In your automation you can give a transition to solve the “lightning effect”

service: light.turn_on
data:
  entity_id: light.ikea
  transition: 3
  brightness: 100

There is a bug in Ikea intergration. If your bulbs support hue and brightness they cannnot be changed in the same service call. You need to seperate them into two service requests and put a pause between them longer than the transition.

I have a script moodlight.yaml that give me three different moods from an input.select which transitions without a “lightning effect”. I cannot use scences because of the above error . Also i am changing 6 bulbs at once, and using Light groups which changes each bulb in turn, again giving a less than smooth change.

moodlight.yaml

moodlight:
  sequence:
    - service: light.turn_on
      data_template:
        entity_id: light.all_living_room
        transition: 3
        color_temp: >
          {% if states.input_select.light_state.state == "Dark" %}
            454
          {% elif states.input_select.light_state.state == "Relaxed" %}
            420
          {% elif states.input_select.light_state.state == "Bright" %}
            200
          {% endif %}
    - delay: 00:00:05
    - service: light.turn_on
      data_template:
        entity_id: light.ikea
        transition: 3
        brightness: >
          {% if states.input_select.light_state.state == "Dark" %}
            1
          {% elif states.input_select.light_state.state == "Relaxed" %}
            170
          {% elif states.input_select.light_state.state == "Bright" %}
            254
          {% endif %}

Input select

light_state:
    name: Living Room Light State
    options:
      - "Off"
      - Dark
      - Relaxed
      - Bright
      - Unknown
    icon: mdi:lightbulb

Light.ikea is Ikea Group and light.all_living_room is the group of 6 bulbs in HA.

So the trick is change the hue (color_temp) first wait than change the brightness with the ikea group. This will give a very smooth effect , similar to the Ikea App

Hope this helps