Announcement

Collapse
No announcement yet.

Getting "Method 'Scheduler.hsapplication.CAPIGetSingleControl' not found."

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

    Getting "Method 'Scheduler.hsapplication.CAPIGetSingleControl' not found."

    I updated HS4 to the latest build and I started getting "Method 'Scheduler.hsapplication.CAPIGetSingleControl' not found."

    I run a script which calls:
    hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRefDimmer,f alse,hs.GetVar(DevRefDimmer),false,true))

    Just to be sure I reinstalled HS4, but I still get this error. Hаs the API changed?

    Thansk!

    #2
    If that (script) was a copy and paste then fix that typo and see if it works :

    hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRefDimmer,f alse,hs.GetVar(DevRefDimmer),false,true))



    Eman.
    TinkerLand : Life's Choices,"No One Size Fits All"

    Comment


      #3
      Thanks! I think it was a weird copy/paste artifact. The script looks OK. I wrote a very simple script and it still gives the same error. The weird thing is that the command itself works and turns the light on. Just to mention I reinstalled HS4 from scratch yesterday, but it hasn't changed anything.

      Code:
      Sub Main(ByVal sParams As String)
          Try
              hs.CAPIControlHandler(hs.CAPIGetSingleControl(1290, false, "50", false, true))
          Catch ex As Exception
              hs.WriteLog("Error 1", ex.message)
              Throw ex 'This will pass the exception up to HomeSeer and error out of the script.
          End Try
      End Sub
      11/14/2021 12:52:03 PM HomeSeer Error 1 Running script Test.vb :Exception has been thrown by the target of an invocation.
      11/14/2021 12:52:03 PM Script Error 1 Method 'Scheduler.hsapplication.CAPIGetSingleControl' not found.
      11/14/2021 12:52:03 PM HomeSeer Device Control Device: Node 48 Guest Bathroom Dimmer to Dim 50% (50) by/from: CAPI Control Handler
      11/14/2021 12:52:02 PM HomeSeer Event Running script in background (Living Room Bathroom Lights Test): Test.vb
      11/14/2021 12:52:02 PM HomeSeer Event Event Trigger "Test Living Room Bathroom Lights Test"

      Comment


        #4
        Uncle Michael or jon00 could help you debug that...


        Eman.
        TinkerLand : Life's Choices,"No One Size Fits All"

        Comment


          #5
          Not a clue. Looks like it might be a bug in HS4. Do you get an error if you don't have try/catch?
          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


            #6
            Originally posted by dkrupenn View Post
            I updated HS4 to the latest build and I started getting "Method 'Scheduler.hsapplication.CAPIGetSingleControl' not found."

            I run a script which calls:
            hs.CAPIControlHandler(hs.CAPIGetSingleControl(DevRefDimmer,f alse,hs.GetVar(DevRefDimmer),false,true))

            Just to be sure I reinstalled HS4, but I still get this error. Hаs the API changed?

            Thansk!
            I expect you are running HS4 on Linux?

            One issue is that Mono has an issue running Homeseer commands directly within another in HS4.

            Try this:

            Change

            Code:
            hs.CAPIControlHandler(hs.CAPIGetSingleControl(1290, false, "50", false, true))
            To

            Code:
            hs.CAPIControlHandler((hs.CAPIGetSingleControl(1290, false, "50", false, true)))
            Does that work?
            Jon

            Comment


              #7
              WOW! That worked:
              hs.CAPIControlHandler((hs.CAPIGetSingleControl(1290, false, "50", false, true)))

              Thank you jon00! What is the general rule when double brackets should be used?

              Seemingly unrelated. I am getting this warning now:
              JowiHue Warning Warning: event action triggered for Living Room Bathroom Dimmer but is icomplete, it needs to address the feature instead

              Comment


                #8
                As I said, nested hs scripting commands may need additional brackets in Linux. Windows is not affected.

                Jon

                Comment

                Working...
                X