Announcement

Collapse
No announcement yet.

Updating device from script does not trigger plugin

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

  • Updating device from script does not trigger plugin

    I have various plugins installed in my HS3 instance. This situation exists for all of the plugins so I know it is not just the way a single plug-in was written by the author.

    Whenever I change the status of a device through an event, that triggers the plug-in associated with that device to do its thing based upon the new device status. However whenever I update the device status via a script the plugin is not similarly triggered.

    I have tried:

    hs.setdevicevalue
    hs.setdevicestring
    hs.setdevicestatus (actually, I couldn't get this one to execute... bug??)


    It seems to me that the event is simulating the Press of a control button on the device screen but the script is simply updating the device value behind the scenes and not executing the control.

    Is there a different script I should be using which would actually "control" the device and in turn would then trigger the associated plug-in?

    I have found a workaround which is to create an event that will re-update the device status ( and thusly trigger the plugin)... but it seems silly that I need to create an event on top of my script. Moreover considering the number of combinations that are potentially involved in all of this it is not realistic for me to do that. It is much easier to write an if statement through a script then having to create hundreds of events.

  • #2
    Got it to work!! :-)

    hs.CAPIControlHandler(hs.CAPIGetSingleControl(DeviceRef,true ,"On",false,true))

    Comment

    Working...
    X