Announcement

Collapse
No announcement yet.

Virtual devices and script

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

    Virtual devices and script

    Can a virtual device refer to a script - if so how? What does the script look like?
    Thanks

    #2
    Can you elaborate a bit more on what you are trying to accomplish. I'm a bit lost on the question.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Sorry, Yes I have a Very basic script that turns on a device. I want to turn on another device only if that script is not running.
      It was suggested that I achieve this by way of a virtual device....
      I assumed what was meant was to create a virtual device which refered to the script. I may have totally misenterpreted though.
      Thanks

      Comment


        #4
        I don't think you can "test" if the script is running.

        The suggestion probably meant to create a virtual device, and turn that device ON as part of the script, and Off when the script was done. i.e. - add a line right at the beginning of the script that turns the virtual device ON on, and add another line at the end of the script that turns it off.

        Then your other device can check to see if the virtual device is on (the script is running).

        Although - I think we'd all be curious of the scenario - maybe there's a different way to accomplish your goal.

        Comment


          #5
          You can check to see if a script is running from another script:

          if hs.IsScriptRunning("myscript.txt") then
          ' do something
          end if

          That said, unless the script is run in VB.NET with its own thread, it is not recommended that scripts should be running for any length at all and events should be doing the timing.
          Jon

          Comment


            #6
            Ok Thanks, I'll try to work another way around it.

            Comment

            Working...
            X