Announcement

Collapse
No announcement yet.

Assigning a Script to a Device Button - Single Instance Option is the default

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

    Assigning a Script to a Device Button - Single Instance Option is the default

    I have a script which creates a Homeseer Device that has buttons assigned to the execution of a script. In other words, if you hit the "On" button, it executes a script; you hit the "Off" button, it executes the script, etc.

    There are multiple devices that execute the same script, so you could hit the "On" button on multiple devices in quick succession.

    Everything works well EXCEPT if I hit the buttons too quickly, the HS event log throws an error saying:

    Not running script since its already running: WPSControl.vb Single instance option enabled in event properties
    Since this event is triggered from a button press and not the event screen, there is no option to uncheck the "Only allow a single instance to run at a time".

    I can't find any Device Creation properties that would allow this to be set.

    Does anybody have a way to do this?

    Here is the code snippet for creation of the device:

    Code:
      
    DT.Device_API = DeviceTypeInfo.eDeviceAPI.Script 'Sets DeviceType to Script
    DT.Device_Type = 3                             
      
    dv.ScriptName(hs) = "WPSControl.vb"
    dv.ScriptFunc(hs) = DeviceFunction
    dv.Status_Support(hs) = True
    dv.Can_Dim(hs) = False
    dv.MISC_Set(hs, Enums.dvMISC.SHOW_VALUES)
    Thanks,
    Scott

    #2
    I doubt this will get resolved unless you submit this to Bugzilla.

    You could fudge this by changing the script name & function to:

    dv.ScriptName(hs) = "WPSControlrun.vb"
    dv.ScriptFunc(hs) = "Main"

    Then have a script called WPSControlrun.vb with the following code:

    PHP Code:
    Sub Main(ByVal Parm As Object)
    RunScriptFunc("WPSControl.vb","DeviceFunction"Parm"False""False")
    End sub 
    WPSControl.vb would be very fast to run with these parameters and allow multiple instance of WPSControl.vb to run.
    Jon

    Comment


      #3
      Thanks! I will enter a "bug" and will give your suggestion a shot.

      Scott

      Comment


        #4
        There have been a few developments behind the scene. HST are now going to add control button functionality directly to run scripts (much like hs.devicebuttonadd in HS2) so hopefully the single instance issue will be resolved.
        Jon

        Comment


          #5
          Does anyone know if this issue is resolved? I have the same issue. Created devices that call a script and I have to delay the changes to these devices to prevent more than one instance of the script.

          Comment


            #6
            Jon00,


            Do you know if the devicebutton_add function already works? I have difficulties implementing this in my script.

            get these errors;
            target of an invocation.Public member 'DeviceScriptButton_Add' on type 'hsapplication' not found.

            Also tried the the Deviceclass, no luck Im still on v.54


            regards

            Bart
            Regards Bart
            ------------------------------------------
            Win7 64Bit on Intel NUCI7 with SSD
            HSPRO 3.
            Devices; 1370 Events; 691

            Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

            Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

            Comment


              #7
              It has not been announced but I would assume it will be available with the next version of HS3.
              Jon

              Comment


                #8
                Hi all,

                Can someone confirm that this function has been implmented in the .68 release of homeseer?

                thanks in advance


                bart
                Regards Bart
                ------------------------------------------
                Win7 64Bit on Intel NUCI7 with SSD
                HSPRO 3.
                Devices; 1370 Events; 691

                Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

                Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

                Comment


                  #9
                  I just tried it and this new feature is in. See my sample script here:

                  http://board.homeseer.com/showthread.php?t=166257

                  Comment

                  Working...
                  X