Announcement

Collapse
No announcement yet.

Script won't steer output - Fixed!

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

    Script won't steer output - Fixed!

    Hello,

    I'm quite net in scripting and i'm afraid I will doe something wrong, but here's the situation:

    I just created a simple test script:
    Sub Main(parms As Object)

    hs.SetDeviceValueByName("LedStrip Blauw", 90)
    hs.speak("Ledstrip blue is " & (hs.DeviceValueByName("LedStrip Blauw")))
    hs.WaitSecs(2)
    hs.SetDeviceValueByName("LedStrip Blauw", 10)
    hs.speak("Ledstrip blue is " & (hs.DeviceValueByName("LedStrip Blauw")))
    End Sub

    When I run the script I don't het any errors. The values in the Homeseer 'device management' change from 90 to 10, this will also be 'told by the HS-voice'. But that's it, the output physically doesn't change anything.

    Do I have to de something more before homeseer realy dends something to it's physicaly devices?

    Jaco

    #2
    Setting the device value does not control the device. You must use CAPI to control the device directly, or use hs.triggerEvent to trigger an event that controls the device.

    ie
    hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRe fByName("Living Room Lights"), True, "on", False, True))

    See CAPI in the HomeSeer3 help files. There are also several examples on the message board.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      This is quite a common trap with HS3, unless the plugin is written a certain way (which does not seem to be that common) this will not work. Devices are in the main controlled now by something called CAPI, if you do a search you will find loads of threads about this very topic. Yes in answer to your question, you have to do more to control the device.

      Comment


        #4
        Thank you both so much for the answers.

        With the following code I can turn the device on:

        Code:
         
         Sub Main(parms As Object)
         hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRefByName("LedStrip Blauw"), True, "on", False, True))
         End Sub
        With this one I can turn it off:

        Code:
         
         Sub Main(parms As Object)
         hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRefByName("LedStrip Blauw"), True, "off", False, True))
         End Sub
        But the device is a dimmable device, how can I change the output value for example 40%?

        P.s. I really tried to read the 'HomeSeer HS3 - End User Documentation' to find the solution by myself, I also read the forum, but I can't find it.

        Comment


          #5
          Hi Jaco,

          You can use the following:

          Code:
          hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRefByName("LedStrip Blauw"),false,targetDim,false,true))
          Where targetDim is a string with the dim value.

          Cheers
          Al
          HS 4.2.8.0: 2134 Devices 1252 Events
          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

          Comment


            #6
            YES.... it works great.

            Thanx for the help everybody......!

            Comment

            Working...
            X