Announcement

Collapse
No announcement yet.

Trying to Turn Device Off

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

    Trying to Turn Device Off

    I am trying to turn off a device in HS3 with this command:

    if hs.IsOff(89) then objCAPIControl = hs.CAPIGetSingleControlByUse(175,ePairControlUse._Off)

    I then got this error:

    Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Phone_Speakers_Back.vb: 'objCAPIControl' is not declared. It may be inaccessible due to its protection level.

    Is there something else I need to put into the script to help this along? Is there an easier way to control devices based on the values of other devices?

    Thank you.

    #2
    Do you have a line in the script that defines objCAPIControl?

    tenScriptAid is a useful tool for identifying the proper form of CAPI commands.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      No I don't. I will be looking into the tenScriptAid soon as I have seen it mentioned a lot since I have been looking for answers in other posts.

      Thanks.

      Comment


        #4
        In vb.net all variables have to be declared prior to use, hence your error.

        Dim objCAPIControl As Object

        added to your script prior to the CAPI command may solve your immediate problem - or reveal additional errors.
        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.548, NUC i3

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

        Comment

        Working...
        X