Dim light depending on the time in timer

The question is: How could I get time remaining from the Timer? And is it possible to add the dim function into this rule or should it an additional rule?