Announcement

Collapse
No announcement yet.

lastX10 Errors - Ideas needed

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

  • lastX10 Errors - Ideas needed

    Hi,

    I have been using a script I wrote that triggers on an incoming X10 event that performs 'scene' changes based on the X10 HCUC and event type (example trigger is <!--StartFragment -->X10 Command C Any Any Command , and each house code gets a similar trigger to the same script). This script uses the hs.lastX10 command to determine the triggering X10 command, and then parses a text-file-database to determine what devices belong to the scene. For non-scene-aware devices that are part of the scene, the script sends X10 commands to set them to the proper value for the scene. But for scene-aware devices, such as Switchlinc devices, the script doesn't need to send a command. It simply updates the switchlinc device status in Homeseer.

    This script has been running fine for ages, since the Homeseer 1.x days. However, things have become problematic in Homeseer 2.x, and I've traced the problems to lastX10 returning invalid data. I'm currently using Homeseer 2.0.2041.0, and the problem exists in this version.

    When Homeseer first starts up, everything is fine. But after a while, if someone in the house triggers too many events too fast, lastX10 seems to return data that is older than the event that just occurred. It seems that the script is not triggered for every X10 received, and that it falls behind. So say, for example, that a user presses the "On" key (which is what I use for all scenes) for C9 10 times in a row really fast. The script may only run 8 times rather than 10. And then later the user presses On for C10. The Homeseer log will show:

    4/2/2006 12:04:03 PM - X10 Received - C10 (...) C On
    4/2/2006 12:04:03 PM - Info - Event Trigger "ExecScene C"
    4/2/2006 12:04:03 PM - Info - Running script in background: smartscene.vb("execScene","")
    4/2/2006 12:04:03 PM - Debug - LastX10Command:C;C9;2;0;

    So, you can see that while C10 is the X10 event that was received, lastX10 returns C9, which matches one of the previous commands that was sent.

    If the user presses C10 again, lastX10 in the script will return C9 again. And then finally, if the user presses C10 a third time, lastX10 in the script will now show C10. However, the C10 lastX10 returned is actually from two events earlier. Basically lastX10 is returning data from 2 events ago - kind of like a FIFO with a two event delay. As an example, consider the following list of Trigger event, and what lastX10 returns (all are "ON" events):

    Event / lastX10
    C9/C9
    C9/C9
    C9/C9
    C10/C9
    C11/C9
    C12/C10
    C9/C11
    C9/C12
    C9/C9

    lastX10 doesn't always trail by 2. I've seen it trail by up to 5. To get the problem to 'go away', I have to shut down HomeSeer (including the service), and then restart it.

    My script runs lastX10 once to extract the received X10 command, and then runs ClearlastX10, but the FIFO-like operation still continues.

    I think the problem is exacerbated by the computer which I have running Homeseer. It is a slow, low power, machine - an 800 mhz Via C3 (which is intentional to save power - 60 watts total!) In addition to Homeseer, it runs my SageTV server, and when they're both busy, Homeseer become very sluggish. So if anyone wants to try to emulate the problem, you're probably going to either need to try on a slow machine, or you're going to have to lower Homeseer's priority, and get some other tasks to use most of the CPU.

    I was looking at other threads, and I haven't seen anyone else talk about this problem. I've seen people talk about lastX10 returning an empty value. And I've seen suggestions for people to use hs.registerStatusChangeCB, which I tried. I'd be happy to do that, but it only registers status CHANGES, and I need something that will trigger with every received X10, even it if is the status stays the same. I saw hs.registerEventCB. The name of it would lead me to believe it was what I was looking for, but it is not intended for use with scripts.

    Does anyone know what is wrong with lastX10? I sure hope it can be fixed in the next release. And how about other methods for triggering scripts on received X10 events that DON'T depend upon the status changing in order to trigger?

    All ideas and help are appreciated.

    Thanks,

    Brook

    <!--StartFragment -->
Working...
X