Announcement

Collapse
No announcement yet.

Scripting problems

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

    Scripting problems

    I run the following script that keeps a light on for 10 mins and get this error:
    It is in the form of a dialog box that says "The script you are executing is taking longer than expected to run". The dialog option's are click to End or continue.
    The same script just on or off is fine.
    Heres the script:
    hs.Plugin("pjcComfort2"). TransmitX10 "C",04,05,00
    hs.waitsecs 600
    hs.Plugin("pjcComfort2"). TransmitX10 "G",04,07,00

    I also get a log error:
    10/03/2008 23:13:34 - Error - Running script, script run or compile error in file: comfort Turn on C7.txt-2147467259: in line 2 More info: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
    Help please...

    #2
    I would recommend creating an event with a script action and a delay and then another script action.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Using hs.waitsecs with a vbs (txt) script for that length of time is a big no no. You are using a portion of HS that is single threaded and will cause a bottleneck.

      You could convert this to a VB.NET script however it would be far better if you used event timing to do this.
      Jon

      Comment


        #4
        What you want is something like this:

        hs.NewTimeEvent("Niche Light Delayed Off",timevalue(DateAdd("n",10,Now)),datevalue(DateAdd("n",10 ,Now)),1,1,1,1,1,1,1,"G4:Off",true,"")

        It all goes on one line. What it does is create an event to turn the light OFF in 10 minutes. The "n" in the DateAdd is minutes, there are other letters for seconds, etc. The device code is G4 in this case. The NewTimeEvent command requires both a time and date, and the timevalue and datevalue supply these. Not really elegant, but it works.

        Comment


          #5
          Hi,

          Anogee
          Thanks for the response, I am still a little confused I have put in the script now to turn off B1 using my interface, not sure if I have done this correct however.
          Are you saying that the neweventtime need and time and DATE! THe date is whenever the motion sensor gets activated..
          Can you edit the attached to show me a real life example?
          I also take it that what you have given me is the action in a new event? And "Niche Light delayed off" is the device?

          hs.NewTimeEvent("Niche Light Delayed Off",timevalue(DateAdd("n",10,Now)),datevalue(DateAdd("n",10 ,Now)),1,1,1,1,1,1,1,
          hs.Plugin("pjcComfort2"). TransmitX10 "B",01,07,00,
          true,"")

          Jon,
          If you mean by "use the event timing" - Device Value Change - Off - For at Least - xx mins, that works with some sensors ... However with the Hawkeyes these will only react to Device Status Change and that will not allow a similar selection of time off in the same way.

          Thanks and apologies for my total lack of understanding.
          Last edited by Davidj; March 13, 2008, 06:13 PM.

          Comment

          Working...
          X