Implemented a warning flash when falling back to a dimmer state. Also added some optional debug output.
Fixed state and timer handling, so all state transitions work.