Guessed by Paragliding_Dave

It detects your knock on the door, and counts up how many. The headphones are for telling you when to start knocking, start knocking when it's not beeping to confuse onlookers