For any interested:
On my web site I have documented how to make a cheap sensor to detect if a TV (or stereo) is on or off.
I use it to mute microphones in my voice controlled house, but it will easily interface to a Ocelot SECU16 or a powerflash interface which can send X-10.
These will let your home automation software know if a TV or stereo are on of off, so you can handle the IR accoringly.
[Link: james.lipsit.com][Link: james.lipsit.com][Link: james.lipsit.com]Hope this helps,
Jim Lipsit