Script is now informed when the system wakes or sleeps. The Denon AVR-3806 code turns the receiver on and off as appropriate.