Newbie asked ChatGPT for an automatization. Tell me why it doesn't work. One button Toggle on/off and dimming

I removed it, and I may have to review the code. The repeat is there because if I long press, the light would only dim up 10%. so the repeat is there to continue increase the brightness until the button is released. Still, it jumps in 10% steps so it’s not smooth.

I did find a shelly blueprint though. But I can’t manage to get it to work. I’ve been busy with work last week but this week I will have some time over for this.

I’ll try to get the blueprint working, and also find any clues on how I can make the dimming smoother.