ZHA IKEA On/Off Dimming Control Only

blueprint:
  name: ZHA - IKEA Tradfri On/Off Dimming Control Only
  description: 
    "Dimming-Only control with IKEA Tradfri on/off switch
    Single click on/off should be handled by other automations to allow cycling between light configurations/modes"
  domain: automation
  input:
    remote:
      name: Remote
      description: The remote that will control the lights
      selector:
        device:
          integration: zha
          manufacturer: 'IKEA of Sweden'
          model: 'TRADFRI on/off switch'
    light:
      name: Light
      description: The lights that will be controlled
      selector:
        target:
          entity:
            domain: light
mode: restart
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'remote'
action:
- variables:
    command: "{{ trigger.event.data.command }}"
    cluster_id: "{{ trigger.event.data.cluster_id }}"
    endpoint_id: "{{ trigger.event.data.endpoint_id }}"
- choose:
  - conditions:
    - "{{ command == 'move_with_on_off' }}"
    - "{{ cluster_id == 8 }}"
    - "{{ endpoint_id == 1 }}"
    sequence:
      repeat:
        while:
        - condition: template
          value_template: "{{ repeat.index < 10 }}"
        sequence:
        - service: light.turn_on
          target: !input 'light'
          data:
            transition: 1
            brightness_step_pct: 15
        - delay: 1
  - conditions:
    - "{{ command == 'move' }}"
    - "{{ cluster_id == 8 }}"
    - "{{ endpoint_id == 1 }}"
    sequence:
      repeat:
        while:
        - condition: template
          value_template: "{{ repeat.index < 10 }}"
        sequence:
        - service: light.turn_on
          target: !input 'light'
          data:
            transition: 1
            brightness_step_pct: -15
        - delay: 1
  - conditions:
    - "{{ command == 'stop' }}"
    - "{{ cluster_id == 8 }}"
    - "{{ endpoint_id == 1 }}"
    sequence:
    - service: light.turn_on
      target: !input 'light'