Updated to support smooth dimming.

Ref post 21 : http://community.smartthings.com/t/how-to-dim-lights-on-and-off-smoothly/5303/20?u=beckwith