<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 11/01/2012 09:14 PM, Joseph Fry
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAAJE3SvbYEhK5-t-a5HFWgfAbuqVyVjXe-BRvqHcyRcWxGBrrA@mail.gmail.com"
      type="cite"><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'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 moz-do-not-send="true"
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>&nbsp;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's usb +5v and
          GND to a serial port's CTS and GND and sense the CTS status of
          the port using a python or C program... but that's far more
          complicated.</div>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
    Most modern TV support discrete codes for on and off as well as
    toggle power.&nbsp; You just need to figure out the code for on and
    always transmit it when resuming.&nbsp; Then you don't care about whether
    the TV is already on or off.<br>
    <br>
    Michael<br>
    <br>
  </body>
</html>