Announcement

Collapse
No announcement yet.

PHP Status 17?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PHP Status 17?

    The below code shows everything as expected but all the status's show as 17 - unknow. I polled all the devices and they are all working fine. All show off except for one. What am i doing wrong?

    <pre class="ip-ubbcode-code-pre">
    print "&lt;table&gt;";

    for($i=1; $i &lt; $List-&gt;Count() + 1; $i++) {
    $What=$List-&gt;item($i);
    $device="&lt;tr&gt;";
    $device.="&lt;td&gt;$What-&gt;Name&lt;/td&gt;";
    $device.="&lt;td&gt;$What-&gt;Location&lt;/td&gt;";
    $device.="&lt;td&gt;$What-&gt;Status&lt;/td&gt;";
    $device.="&lt;/tr&gt;\n";
    print $device;
    }
    print "&lt;/table&gt;";
    unset($hs);
    ?&gt;
    </pre>

    #2
    I have been working with Dan(xplosiv) to try and solve this and we both think it might be a bug... Im am running version 1.6.200 I even tried setting the statuses with SetDeviceStatus yet my web page shows all 17's

    Comment


      #3
      I don't see "Status" listed as a property of the device class. I wonder if this is a recent change. When I use "Status" to try and get the status I get "0" and "17" as a response. The "17" response is valid for UNKNOWN and "0" seems to be valid for "All units off". I was expecting a 2,3, or 4 value.

      Per the HomeSeer help......

      The device class has the following properties:

      Property
      Type
      Description

      can_dim
      boolean
      true if device dimmable

      dc
      string
      device code as a string (ie: "1")

      hc
      string
      house code as string (ie: "A")

      location
      string
      a string describing the location of the device

      dev_type_string
      string
      a string that is the name of the last device type chosen for this device

      name
      string
      a string, which is the name of the device

      ref
      long
      a device reference used internally. This is unique for every device. Events hold this as a reference to the device. If the device is deleted, all events that reference the device will no longer control it.

      status_support
      boolean
      true if the device supports the X10 status request command

      misc
      long
      a bit field that holds various properties for the device. The field is a long value. The bits are defined as:

      &h1 = device supports the X10 preset dim command

      &h2 = device supports the X10 Extended dim command

      &h4 = smart linc switch

      &h8 = no logging

      &h10 = status only device

      &h20 = hide device from views

      &h40 = device is a thermostat

      &h80 = include device in power fail

      &h100 = value names are selectable from web and Win UI (values assigned with hs.DeviceValuesAdd)

      values
      string
      Holds the name/value pairs as added with the hs.DeviceValueAdd function. See the plug-in SDK for more information.

      buttons
      string
      Holds information about buttons added with hs.DeviceButtonAdd. See the plug-in SDK for more information.

      Comment


        #4
        Squintz,
        I just tried your code in VBScript and it also only returns 0 and 17. I believe you should be using hs.deviceStatus if you want the staus like:

        hs.DeviceStatus(device.hc + device.dc)
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Some of my code got sut off before. This is what i have. Still have not resolved the problem. Funny thing is Dan says it works fine for him
          <pre class="ip-ubbcode-code-pre">
          &lt;body&gt;
          &lt;div id="status"&gt;
          &lt;?php
          $hs = new COM("HomeSeer.Application");
          $List=$hs-&gt;GetDeviceList();

          print "&lt;table&gt;";

          for($i=1; $i &lt; $List-&gt;Count() + 1; $i++) {
          $What=$List-&gt;item($i);
          $device="&lt;tr&gt;";
          $device.="&lt;td&gt;$What-&gt;Name&lt;/td&gt;";
          $device.="&lt;td&gt;$What-&gt;Location&lt;/td&gt;";
          $device.="&lt;td&gt;$What-&gt;Status&lt;/td&gt;";
          $device.="&lt;/tr&gt;\n";
          print $device;
          }
          print "&lt;/table&gt;";
          unset($hs);
          ?&gt;
          &lt;/div&gt;

          &lt;/body&gt;
          </pre>

          Comment


            #6
            I figured this one out... basicly the same as what Rupp said.

            You need to add the line:

            $device .= "&lt;td&gt;".$hs-&gt;DeviceStatus($Device-&gt;hc.$Device-&gt;dc)."&lt;/td&gt;";

            Or something to that effect, then it returns the actual status of the device. Ignore the 'Status' variable, thats a load of rubbish. (as myHABot pointed out, its not mentioned on the help file)

            Comment

            Working...
            X