3-Step Light dimmer Template for cheap light Power on/off lights

Hey Community,

I need your help.
For the last two months I looked and google everywhere, didn’t find any solution, so here is my question.

Problem:
I want to control a three-Step light with a Shelly
If you turn off and on the power in less than two seconds the brightness steps down from bright to medium, if you repeat that step again, to low and so on. If it’s off for longer than 2 seconds, it goes to 100% if you turn it the next time on.
Bright > Medium > Low > Bright > …

I want a light in Homeassistant with a dimmer slider so 0%-100%, it should choose the closest value for the light 100%; 66%; 33%; off=0%

Because my end goal is two to have them controlled via Voice, as all my other lights.

Has anyone had a similar Problem and how did you solve it.

Thank you very much!

Greeting from Germany
Marvin

Hello Marvin.

Were you able to do this automation?

I want it exactly like this for my bedroom.

No, but when you find a way, I will be interested in it.