The tutorial about automatically turning speakers on and off with mpd and the Raspberry Pi shows the basics of responding to mpd’s play, pause, and stop events. By design, that script reacts immediately when mpd’s state changes. This way it remains general and applicable to other situations as well, not just turning speakers on and off. There are, however, cases when you don’t want to act immediately. For example, when you pause the music to answer a phone call, it’s better not to turn speakers off immediately.

Olaf had this exact problem and modified the original script to include a timeout value. Olaf’s modified script will react only if music has been stopped for some time. Thanks for sharing Olaf!