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

  • madmax
    replied
    I just tried it and this new feature is in. See my sample script here:

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

    Leave a comment:


  • bartbakels
    replied
    Hi all,

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

    thanks in advance


    bart

    Leave a comment:


  • jon00
    replied
    It has not been announced but I would assume it will be available with the next version of HS3.

    Leave a comment:


  • bartbakels
    replied
    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

    Leave a comment:


  • madmax
    replied
    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.

    Leave a comment:


  • jon00
    replied
    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.

    Leave a comment:


  • scott12v
    replied
    Thanks! I will enter a "bug" and will give your suggestion a shot.

    Scott

    Leave a comment:


  • jon00
    replied
    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.

    Leave a comment:


  • 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
Working...
X