Automate a sunrise (slow sliding brightness)

Is it possible to automate a slow sliding brightness to replicate the sun rising?

At the moment I have my Automation Actions as
Turn brightness to 10
Delay 10 seconds
Turn brightness to 15
Delay 10 seconds
Turn brightness to 20 … etc

Is there a more natural method?

1 Like

If your light’s firmware supports the transition feature, you can use that.

No transition feature.

this is what I use for my deck light:

automation:
  - alias: LC Deck Light Fade On at Dusk
    id: lc_deck_light_fade_on_at_dusk
    initial_state: 'on'
    mode: restart
    trigger:
      - platform: sun
        event: sunset
        offset: "+00:07:00"
    condition:
      - condition: state
        entity_id: light.deck_light
        state: 'off'
    action:
      - service: light.turn_on
        data:
          entity_id: light.deck_light
          brightness: 5
      - repeat:
          sequence:
            - service: light.turn_on
              data:
                entity_id: light.deck_light
                brightness: "{{ state_attr('light.deck_light', 'brightness') | int + 1 }}"
            - delay: 2
          until:
            condition: or
            conditions:
              - condition: template
                value_template: "{{ state_attr('light.deck_light', 'brightness') | int >= 254 }}"
              - condition: state
                entity_id: light.deck_light
                state: 'off'

There’s also this for more advanced uses, but probably best to start simple.

I don’t know what screenshot that is but Home Assistant’s transition isn’t typically listed as an “effect”. For example, my Philips Hue lights support Home Assistant’s transition but it’s not listed as an effect.

I suggest you simply try it and see if it works or not. Go to Developer Tools > Services, select “Light: Turn On”, click the Choose Entity button and pick your light, checkmark the Transition option and specify a value in seconds (like 30), then click the Call Service button.

1 Like

Ok I found transition Setting in Zigbee2MQTT and it works great. But the problem is this transition Setting is permanent. Would also like to be able to have the lights instantly go off and on then the switch is used.

Just a sunrise for my morning automation.