Announcement

Collapse
No announcement yet.

Few more questions

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Few more questions

    First, let me say that after some struggles, I am very happy with this solution. There were some dark moments that took some time to resolve, but I now seem to have a pretty decent, stable solution. I am still getting the occasional checksum error but it doesn't seem to affect the performance as it did when I first set the system up... I guess time will tell, I have only had it running about a day. But, it is much more responsive than it was.

    Here are my questions:

    1) Is there a way for a script to determine when the plugin is loaded and working? I have a background script (enclosed) to check the state of all my ALC devices (and a few others) every 5 seconds and move these results to MailLobby variables. I have to do this because of the device naming problem - devices are using special characters that MainLobby cannot handle ([, ], etc). When I first start HS, I get a bunch of subscript out of range problems until HS populates and updates. I am calling zones by number so I suspect those arrays are not populated until the plugin does its thing. Once the plugin is happy, no more errors.

    2) Is there a way to have 1 trigger script if ANY HAI unit changes? If this is possible, I can forego #1 running every 5 seconds and simply setup that trigger to run when a unit has a state change and save cycles. Given I have several dozen ALC devices, I fret setting up that many triggers to accomplish this.

    3) Any suggestions for a better solution? I only have 10 units programmed in the script now -- I fear that with 50+ devices polling every 5 seconds, my system will be wasting a lot of cycles just to populate the variables that "rarely" change.

    I enclosed my script for those who have a similar need.

    Thanks,
    Attached Files

    #2
    Originally posted by rileydogmi
    1) Is there a way for a script to determine when the plugin is loaded and working?
    There are a few ways - you can set a variable equal to just hs.Plugin("HAI_System") and then test to see if the variable is a valid object or not - if not, then the plug-in is not loaded at all. Another less difficult way is to just call something like the plug-in's Version or InterfaceStatus functions. If you get nothing back, then the plug-in is not loaded. Your script can use On Error Resume Next, Err.Clear and check for Err.Number <> 0 to help with any of these methods.

    Originally posted by rileydogmi
    I have a background script (enclosed) to check the state of all my ALC devices (and a few others) every 5 seconds and move these results to MailLobby variables. I have to do this because of the device naming problem - devices are using special characters that MainLobby cannot handle ([, ], etc). When I first start HS, I get a bunch of subscript out of range problems until HS populates and updates. I am calling zones by number so I suspect those arrays are not populated until the plugin does its thing. Once the plugin is happy, no more errors.
    First, there is no reason for you to have to populate ML variables and to tax your HS system by updating them so frequently. Devices were added to this plug-in SPECIFICALLY for ML, TouchPad, and Media Center as they are so device centric. Work with Krumpy as something is not right here - he can handle any variable address type, and if it is the name of the device that his plug-in does not like, then you should know that I created the device support in the HAI plug-in such that you can rename and move the devices to your liking. e.g. If you have an ALC light for the family room, then rename the device and move it to the Family Room location and the HAI plug-in should still like it just fine. To the second part, yes you need to give the plug-in time to talk to the panel and discovery how many zones/units are in the system, how many you are using, read the names, etc.

    Originally posted by rileydogmi
    2) Is there a way to have 1 trigger script if ANY HAI unit changes? If this is possible, I can forego #1 running every 5 seconds and simply setup that trigger to run when a unit has a state change and save cycles. Given I have several dozen ALC devices, I fret setting up that many triggers to accomplish this.
    No - there is a special device for zone changes, but not for unit changes. You should not have to set this up in the first place, but if you decide to go through with it, setting up the event and then copying it should make the job much easier as you will then only have to change the trigger device.

    Originally posted by rileydogmi
    3) Any suggestions for a better solution? I only have 10 units programmed in the script now -- I fear that with 50+ devices polling every 5 seconds, my system will be wasting a lot of cycles just to populate the variables that "rarely" change.
    Yes - don't poll. It is bad enough that HAI forces the plug-in to do it - you should not poll the plug-in as the weakness of the HAI protocol is definitely going to cause the thing to collapse in on itself! On the plus side, polling from the plug-in returns the value from memory so it does not hit the panel, but it is grossly inefficient! I think the answer lies with working with Krumpy on the ML side - I know he can give you a better solution.
    Regards,

    Rick Tinker (a.k.a. "Tink")

    Comment


      #3
      Unfortunately, this is a back and forth issue - Krumpy says that there is nothing that can be done at this time because it is this HAI plugin that creates the devices - is there anyway to support the gBaseCode entry in the ini file? Or, simply stay away from special characters that can whack other programs... [, ], %, etc...

      Krumpy said that he is waiting for HS to open up the ability for a 3rd party to add additional configurations to the device configuration screen. Then, he can let us choose the variable name in Main Lobby - problem solved. Since ML uses the device in the variable, the variables are useless.

      See this thread: http://board.homeseer.com/showthread.php?t=107074

      Just one minor hurdle to a perfect solution!

      Thanks.

      Comment


        #4
        Well, Krumpy is quite mistaken - I will contact him.
        Regards,

        Rick Tinker (a.k.a. "Tink")

        Comment


          #5
          Please let me know what you two come up with. I am dead in the water as you are indeed correct - after about 10 hours or so, the server crashes from what I believe is the scripts overwhelming the system.

          Given I can't use the ML variables, I am hoping you 2 wizards can come up with a solution.

          Thanks,

          Comment


            #6
            I spoke with Krumpy and he cleared up the confusion - I thought his plug-in could not handle plug-in created devices, but it is in fact ML which cannot have certain special characters on the command line for the widget that you have on the ML screen. He did, however, mention that there is a translation table of some sort that takes care of that, so it sounds like you should contact him again about this. He probably never reads this forum.
            Regards,

            Rick Tinker (a.k.a. "Tink")

            Comment

            Working...
            X