Announcement

Collapse
No announcement yet.

Help with Script Command

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

  • Help with Script Command

    I am trying to run a BLLED command as an immediate script command in an Event versus in a script. The command I am trying to have run is:

    hs.PluginFunction("BLLED", "", "SetDateTime", new Object(){1})

    When I type the statement into the Event HS adds the "&" in front but when I execute the event I get the following error in the log:

    Running script(2) &hs.PluginFunction("BLLED", "", "SetDateTime", new Object(){1}), init error: Expected end of statement

    I also tried it without the outer parenthesis but that just resulted in a syntax error as well.

    Any suggestions on what obvious thing I am doing wrong? Thanks!

  • #2
    See this bug report (and resolution).

    Cheers
    Al
    HS 3.0.0.548: 1990 Devices 1172 Events
    Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

    Comment


    • #3
      Thanks Al!

      I think I'll try to get fully transitioned to HS3 and somewhat stable before I venture into the beta's to get that working. Will just use a script call for now instead of an immediate command.

      Comment


      • #4
        Having trouble with scripts

        I don't know much about scripts so I don't know if I am doing something wrong or it is a bug yet with HS3. Below is my script for led sign 2 for a hard reset. and then the error the log shows. Can someone help me?

        Sub Main()

        hs.PluginFunction("BLLED", "", "Reset", new Object(){2,TRUE})
        End Sub


        Error Running script, script run or compile error in file: C:/Program Files/HomeSeer HS3/scripts/LED.txt1025:Expected end of statement in line 3 More info: Exception from HRESULT: 0x800A0401

        Comment


        • #5
          Originally posted by Larryguy50 View Post
          I don't know much about scripts so I don't know if I am doing something wrong or it is a bug yet with HS3. Below is my script for led sign 2 for a hard reset. and then the error the log shows. Can someone help me?

          Sub Main()

          hs.PluginFunction("BLLED", "", "Reset", new Object(){2,TRUE})
          End Sub


          Error Running script, script run or compile error in file: C:/Program Files/HomeSeer HS3/scripts/LED.txt1025:Expected end of statement in line 3 More info: Exception from HRESULT: 0x800A0401
          Do you have a .vb extension on the script? If so the script needs to look like this.
          Sub Main(parm as object)
          hs.PluginFunction("BLLED", "", "Reset", new Object(){2,TRUE})
          End Sub
          -Rupp
          sigpic

          Comment


          • #6
            I am thinking that the script is not correct:
            Try this:

            If you are using multiple instances, make sure you specify your instance
            This example uses no instance

            Code:
            Sub Main(ByVal parm As Object)
                hs.PluginFunction("BLLED", "", "Reset", new Object(){2,True}) 
            End Sub
            Cheers,
            Bob
            Web site | Help Desk | Feature Requests | Message Board

            Comment


            • #7
              It was the file extension that caused the problem. I left it as a txt and it worked when changed to vb.

              Comment

              Working...
              X