Here’s a quick hack I through together to prevent jerks from ringing my doorbell late at night.
At first I wanted to do something complicated like setting up a timer or light sensor. In the end I decided to do the simplest thing possible. As illustrated all I did was attach a switch to the doorbell. In practice we leave it off most of the time, so it would be nice for a little automation to keep us from forgetting about it. Aside from that it gets the job done.