Keyboard backlight timer / store level

I have some issues with the keyboard backlight. It can be adjusted through levels 0-5 by pressing Fn+F4. So the control does work, to some extent.
The problem is that when it’s on, it’s constantly on. Even if the keyboard is left untouched for hours (until pc goes to sleep). I’d like it to go out after some time of inactivity. Actually I wouldn’t mind if it went out even during activity. It’s only really useful when typing something that is not shown on the screen, which is only done for a few seconds at the time. So a timer to turn it off, independent of activity would be good.

The other problem is that keyboard is always lit at boot time, and it keeps being lit until manually switched of. This is also true when resuming from hibernate. A timer to turn it off would solve this.

Is there a way to setup such timer?