How to use cluster command in automation?

Hi

It seems like I need a cluster command:
endpoint id: 11
cluster id: 8
command: 1
when I want to implement smooth dimming.
This command has 2 arguments:
move_mode up/down and
rate: 0-255.
I am able to execute this cluster command under manage zigbee device → clusters → commands.
The light is doing what it should, it starts with smooth dimming.

Now I want to use this in an automation. The yaml looks like this:

alias: Bathroom Ceiling Light Dimming
description: Bathroom Ceiling Light Dimming
trigger:
  - device_id: $id_of_remote
    domain: zha
    platform: device
    type: remote_button_long_press
    subtype: dim_up
    id: dim-up-cont
condition: []
action:
  - action: zha.issue_zigbee_cluster_command
    metadata: {}
    data:
      cluster_type: out
      ieee: 01:23:45:67:89:12:34:56
      endpoint_id: 11
      cluster_id: 8
      command: 1
      command_type: client
      args:
        - 0
        - 50
mode: single

When I press the button on the remote for a long time the script is executed but the bulb doesn’t react. I’m new to home assistant and a little bit lost now.
How can I debug this issue?

Is there another way for smooth dimming? Increasing the brightness in 10% steps in a loop doesn’t look good.

Thank you very much.

Try this. I use it on two dimmers and it’s quite smooth, could probably be even smoother if you adjust it.

action:
  - choose:
      - conditions:
          - condition: trigger
            id: dim-up-l1
        sequence:
          - repeat:
              while:
                - condition: trigger
                  id: dim-up-l1
              sequence:
                - data:
                    brightness_step: 5
                  target:
                    entity_id: light.yourlight
                  action: light.turn_on
                - delay:
                    hours: 0
                    minutes: 0
                    seconds: 0
                    milliseconds: 200
      - conditions:
          - condition: trigger
            id: dim-down-l1
        sequence:
          - repeat:
              while:
                - condition: trigger
                  id: dim-down-l1
              sequence:
                - data:
                    brightness_step: -5
                  target:
                    entity_id: light.yourlight
                  action: light.turn_on
                - delay:
                    hours: 0
                    minutes: 0
                    seconds: 0
                    milliseconds: 200
mode: restart

Thank you for your proposal.

That’s very close to what I’ve found in the web. For some reason it’s not working, the light won’t stop to dim.
Also this is the solution with steps.
Before with iobroker I used a different approach:
push button: start dimming with move command.
Now the bulb continues to dim without any further command. That constinues until 0% or 100% is reached.
On release of the button dimming is stopped with move “zero”.
That’s what I try to archieve with home assistant too.