How to setup a brightness trigger?

There is also a community created app available on the forums. (Dim with me)
This app will set brightness levels base upon a switch or a bulb brightness + ON state.