Concise and flexible programming of wireless sensor networks door