Homeseer Script/Event Help Needed


I have a security system with devices z1 through z25 which represent various windows, doors, and motion detectors (zones). I want to create an "Arm OK" Homeseer device that lets me know when any of these zones are "faulted". If no zones are in a fault condition I want device z26 to be "on" (indicates OK to Arm). If any zone is faulted I want device z26 to be "off" (overall system fault).

I created the following script (which works for this situation):

sub main()

if hs.ison("z1") or hs.ison("z2") or hs.ison("z3") or hs.ison("z4") or hs.ison("z5") or hs.ison("z6") or hs.ison("z7") or hs.ison("z8") or hs.ison("z9") or hs.ison("z10") or hs.ison("z11") or hs.ison("z12") or hs.ison("z13") or hs.ison("z14") or hs.ison("z15") or hs.ison("z16") or hs.ison("z17") or hs.ison("z18") or hs.ison("z19") or hs.ison("z20") or hs.ison("z21") or hs.ison("z22") or hs.ison("z23") or hs.ison("z24") or hs.ison("z25") then
        hs.execx10 "z26","off",0
end if

if hs.isoff("z1") and hs.isoff("z2") and hs.isoff("z3") and hs.isoff("z4") and hs.isoff("z5") and hs.isoff("z6") and hs.isoff("z7") and hs.isoff("z8") and hs.isoff("z9") and hs.isoff("z10") and hs.isoff("z11") and hs.isoff("z12") and hs.isoff("z13") and hs.isoff("z14") and hs.isoff("z15") and hs.isoff("z16") and hs.isoff("z17") and hs.isoff("z18") and hs.isoff("z19") and hs.isoff("z20") and hs.isoff("z21") and hs.isoff("z22") and hs.isoff("z23") and hs.isoff("z24") and hs.isoff("z25") then
        hs.execx10 "z26","on",0
end if

end sub

The problem I am having is I associate this code to an event, but I want the event to only trigger on "z" house code device changes (any z device change). The only options I see are "any device change", which works, but I feel is triggering this event way more than it needs to. Is there any way to trigger an event on one house code device change?

Also, I have "do not log this event" checked on the z26 device itself as well as the event and it is still logging this event/device in the system log. Why is that?

Thanks for any advice/comments. :huh:

easy, when you configure the event's house and device code, set house code to Z and device to Any (bottom of the list).
Hmmm, the house codes only go to "P". I'm going to bag this idea because it would be to much work to change my security house codes from its current "z".
Didn't realize that Homeseer limited the list to valid x10 codes, makes sense I guess. I don't think this is going to be easy in the current version of Homeseer, you would have to trigger the event every time a housecode was received.
for the "Arm NOT OK" event
Create an event that uses the "by condition" tyep.

then below set If Device z1 (sorry I don't know the name) chanes to on
add that then hit Next OR Group and add yoour next device there. Keep this up until you have added all your dorrs and windows. Then you can set the actions like any other event.

The "Arm OK" event would be a similar except as in the first OR box you would have all deives listed and detected as OFF.

I hope this makes sense.... Cause it's late and I think I confused myself... but I know it can be done as I have done it...
THANKS sbessel, that worked out great!

My next task is to figure out how to make my "Arm Stay" and "Arm Away" buttons visible/invisible based on this value in my Main Lobby display. Any ideas? I don't see a "visible enable" capability for the Main Lobby library buttons.
I wonder if adding all the z device values in a tight loop would be faster, and need only one check? This would only work if the device values were numerical, though.

Something like:

sub main()

ttl = 0
for i=1 to 25
ttl = ttl + hs.devicevalue("z" & cstr(i))

if ttl = 0 then 'or whatever all of them off would equal
hs.exec "z26", on
hs.exec "z26", off 'fault
end if

end sub
Thanks for the reply Gordon. The problem would still be how to trigger that script.

I did the solution sbessel offered and it worked out, speed isn't really an issue in this case.

Thanks again for the reply though, I really appreciate all the ideas (gets me thinking and learning about different options available).