<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">But I have an other problem, before I suspend the machine I use to switch of the TV with a irsend command. But when I return from suspend mode the TV is off.</div>


<div class="gmail_quote"><br></div><div class="gmail_quote">I don&#39;t know how to manage this, do I need a special script to run before return from suspend? how could I check if the TV is off?</div><div class="gmail_quote">

<br></div></div></blockquote><div><br></div><div>I would use an IRSEND to power the tv back on when the system resumes from suspend (eg <a href="http://askubuntu.com/questions/141702/how-to-run-a-script-after-the-system-resumes-from-hibernate-suspent-to-disk">http://askubuntu.com/questions/141702/how-to-run-a-script-after-the-system-resumes-from-hibernate-suspent-to-disk</a>)</div>

<div><br></div><div> To determine if the TV is already on, there are several approaches you might take:</div><div>1. do an edid query (should only work if the tv is on)</div><div>2. use a serial cable, if your tv has a db9, and see if you get a response from the set.</div>

<div>3. ping the tv (assuming it has network connectivity)</div><div><br></div><div>I have also read that you could wire the tv&#39;s usb +5v and GND to a serial port&#39;s CTS and GND and sense the CTS status of the port using a python or C program... but that&#39;s far more complicated.</div>

</div>