What about some monitoring camera and "computer vision" software that counts and measure the people who goes in and out.. ?
What about cameras and motion detection software, combined with sensor on the door.. when nobody is inside, then inside nobody is moving.. it will bi sign to turn off the light.. if someone get inside, then the sensors on the door will detect the man.. and it will be sign to turn on the light...
sorry, i don`t seen that this is an old topic