So, there was a new function added to a recent Zigbee driver, the RGBGenie Zigbee micro dimmer, that allows you to change the speed at which the startLevelChange command transitions. This isn't a function unique to that device but is a standard zigbee functionality. There has been discussion about expanding that function to other drivers as well. So, hopefully, @mike.maxwell has decided that it's a good idea and is going to do it for the other zigbee dimmer drivers.
I don't understand what is going on in your released part of the rule.
You are changing the direction when you let go of the button for 5 seconds. That is one way to do it. mIne simply waits till you get to the top or the bottom of the dimmer range to change direction, the same way that a device with only a momentary button, like the some of the micro dimmers recently released, works. They go in one direction till they reach the end of the dimming range, then change direction. I think that is a lot easier method than having to re-hold the button in 5 seconds. One isn't more right than the other. But that will not affect the transition time. That is in the startLevelChange command.
The off bit you talk about is to catch if the dimmer dims all the way down to the light being off. If you Don't check for that, the dimmer will go to off and the direction of fade will still be down. Trust me on this one.
What do you mean by you have to do it twice? The first time you hold the button nothing happens? What is the starting state of the light? The issue is going to be that if you have dimmed the light all the way down, so the direction gets changed to up, then set the light to 100%, the direction is going to still be up till you hold the button. To address this, you would have to have two rules and the variable will have to be change to a global one. You would remove everything else from the released part of the rule except for the stop level change. Then you would add a second rule as follows:
Trigger: Switch changing on the light OR dimmer level of the light changing
Action:
IF Light is off or Dimmer level is <5 THEN
Set direction to up
ELSE IF Dimmer level >90 THEN
Set direction to Up
END-IF
Now, there are still limitations with this. If you want to dim till you hit the end of the range and not change direction when you don't repress the button, then these are limitations you are going to have to live with. Most noteably, if the direction is up, because the light was previously going up or was off and you set the light to a level of 88, it will still brighten when you hold the button rather than dimming. Similarly if you are dimming the light and then you set the light to 10, it is still going to dim when you hold the button. This is what happens when you try to use a button to do the job of 2 buttons.
If this doesn't work for you, buy a different button controller. One designed for dimming.