Zigbee2MQTT enOcean PTM 215Z (Friends of Hue) switch

I would say that in most situations loops is not the right solution.

The best way to get a smooth dimming is usually to use some kind build in fading, like “Brightness_move” in zigbee2mqtt:
https://www.zigbee2mqtt.io/devices/LED1623G12.html#moving-stepping

or " Dimmer < > and !" in Tasmota:

1 Like