I wrote serialserver-for-linux to turn my tv and stereo on and off using rs-232 a few years ago; has been made slightly redundant by CEC support but I can do everything already just using scripts triggered by lirc (and irexec) and by certain cron jobs.  Unfortunately only a few manufacturers have serial ports so it only supports LG and Sharp TVs as well as Denon and Marantz amplifiers.<div>
As such, it is my frontend that controls the TV through its remote (not the other way round) and it can suspend itself once it has shut the TV and stereo off.  With a wake on USB capable remote the same remote can turn the frontend back on and the frontend then turns the TV (etc.) back on using the pm-suspend hooks.</div>
<div><br><div>I also use PLCBUS modules that control my lights (and some appliances) with plcbus-daemon-for-linux; as such when I push power on my remote the TV and Amp turn off, and if it is late enough, my living room lights dim down till they are off.  Totally unnecessary, but it still makes me smile.</div>
</div><div><br></div><div>Cheers</div><div>Wayne</div>