Announcement

Collapse
No announcement yet.

OK Strange error

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

    OK Strange error

    06/07/2013 16:46:27 Error Running script, script run or compile error in file: Rain Value.txt430:Class doesn't support Automation: 'hs.setdevicevalue' in line 5 More info: Class doesn't support Automation: 'hs.setdevicevalue'
    so this is the script, what is wrong?

    Code:
    Sub Main
    dim x
    
    x=hs.DeviceString ("y8")
    hs.setdevicevalue "y8", x
    
    End Sub
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

    #2
    HS2 or HS3?
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Originally posted by Rupp View Post
      HS2 or HS3?
      Hm ok so now it is advisable to state version, I thought my Sig did that.

      HS2 Pro
      sigpic
      A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

      Comment


        #4
        I just tried hs.SetDeviceValue "B2",66 and it worked. You need to make sure your value is a number. Maybe try adding something like:

        x=cint(hs.DeviceString ("y8"))
        hs.SetDeviceValue "y8", x
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Originally posted by Rupp View Post
          I just tried hs.SetDeviceValue "B2",66 and it worked. You need to make sure your value is a number. Maybe try adding something like:

          x=cint(hs.DeviceString ("y8"))
          hs.SetDeviceValue "y8", x
          Interesting as that script works perfectly in 5 other scripts!

          I wonder if it is because the string is zero "0"
          sigpic
          A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

          Comment


            #6
            Good thought Rupp, opps error
            06/07/2013 19:23:26 Error Running script, script run or compile error in file: Rain Value.txt13:Type mismatch: 'cint' in line 3 More info: Type mismatch: 'cint'
            any other ideas
            sigpic
            A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

            Comment


              #7
              There must be more in the string than a number causing cint to fail. If this is the case you will have to parse the string and see what is a number and what is a character. In vb.net there are functions that can parse an int from a string.
              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #8
                Originally posted by Rupp View Post
                There must be more in the string than a number causing cint to fail. If this is the case you will have to parse the string and see what is a number and what is a character. In vb.net there are functions that can parse an int from a string.
                Spot on Rupp, the string was actually something like "10 inches", solved problem by using
                Code:
                x=(left(hs.devicestring ("y8"),2))
                sigpic
                A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                Comment

                Working...
                X