Slowly dim up a Sonoff D1 dimmer

I’m trying to have a transition effect on a Sonoff D1.
But since the transition does not work I try to make my own using an automation.

alias: Taklampan på morgonen
description: ''
trigger:
  - platform: state
    entity_id: light.taklampa
    to: 'on'
    from: 'off'
condition: []
action:
  - service: light.turn_on
    data:
      brightness: 1
    entity_id: light.taklampa
  - delay: '2'
  - repeat:
      until:
        - condition: template
          value_template: '{{states.light.taklampa.attributes.brightness == 255}}'
      sequence:
        - service: light.turn_on
          data:
            brightness_step_pct: 1
          entity_id: light.taklampa
        - delay: '2'
mode: single

The thought is to dim slowly on the morning, but that condition is removed for debugging purpose.
What happens is that it sets the value to 1, then goes to 3 then 255.
Anyone that can see the problem?

Hi!
I had the same problem cos the build in transition option dosn’t work. I made an automation for this job that works. Here it is:

alias: Slowly dim up lamp at 7.00
description: ''
trigger:
  - platform: time
    at: '07:00'
condition: []
action:
  - service: light.turn_on
    data:
      brightness: 0
    target:
      entity_id: light.sonoff_1000fc9c64
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - repeat:
      until:
        - condition: numeric_state
          entity_id: light.sonoff_1000fc9c64
          attribute: brightness
          above: '254'
      sequence:
        - service: light.turn_on
          data:
            brightness_step_pct: 1
          target:
            entity_id: light.sonoff_1000fc9c64
        - delay:
            hours: 0
            minutes: 0
            seconds: 1
            milliseconds: 0
mode: single

Hope it will help you :slight_smile: and maybe anyone having problem like this.

1 Like