AVM power outlet and Hue dimmer switch

Hi,

I am still a beginner in the field, and have the following problem with the config:
Goal: On switch on the Hue Dimm switch should turn on the AVM outlet. (works)
Socket turns on for 10 min and then off for 4 min (currently 199x) (works).
When the Off button on the Hue Dimm switch is pressed, the outlet should turn off completely. (does not work)
Socket does turn off, but the loop continues.
What am I doing wrong???
Thanks in advance.

alias: Hue with AVM
description: ''
trigger:
  - device_id: XXXXXXXX
    domain: hue
    platform: device
    type: remote_button_short_release
    subtype: turn_on
  - device_id: XXXXXXXXX
    domain: hue
    platform: device
    type: remote_button_short_release
    subtype: turn_off
condition: []
action:
  - repeat:
      count: '199'
      sequence:
        - type: turn_on
          device_id: XXXXXXX
          entity_id: switch.fritz_dect_210_1
          domain: switch
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0
        - delay:
            hours: 0
            minutes: 4
            seconds: 0
            milliseconds: 0
        - type: turn_off
          device_id: XXXXXX
          entity_id: switch.fritz_dect_210_1
          domain: switch
  - wait_for_trigger:
      - device_id: XXX
        domain: hue
        platform: device
        type: remote_button_short_release
        subtype: turn_off
  - type: turn_off
    device_id: XXXX
    entity_id: switch.fritz_dect_210_1
    domain: switch
mode: single