Bruce was already was asked about this and posted something...
Here:
To here:
The example app tracks light usage...we're almost there.