Have a look at 'Weather Switch' (specifically the child app)
The code in there is easy to see and will show how I deal with illuminance
Andy