Announcement

Collapse
No announcement yet.

Help with scripting

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with scripting

    What is the scripting command the set the cool setpoint?


    hs.ControlThermostat("^12", "CmdSetCool", 84) does not work.

    I get error in the log ControlThermostat cannot be used to control plugin-owned thermostat devices. This device is owned by: BeakerStat. Please use the Thermostat API to control this device via scripts.

    I have searched all over and can not figure this out.

    Thanks for you help.

    Bruce

    #2
    Thermostat API

    The thermostat API is documented here:http://board.homeseer.com/showthread.php?t=114698
    It's also documented in the HomeSeer SDK:http://www.homeseer.com/support/home...lug-In_SDK.htm.
    Last edited by spknapp; June 4, 2012, 04:47 PM. Reason: Added info
    Steve

    (System configuration is in my profile)

    Comment


      #3
      Need Example

      I have read that 10 times and still cant figure it out. Can someone please provide a example how to set a cool setpoint via script.
      Last edited by brbjr; June 5, 2012, 09:22 AM.

      Comment


        #4
        See this post for a script example.
        http://board.homeseer.com/showthread...ght=CmdSetCool
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Error

          Dim pi As Object
          Dim currentCoolSetPoint As Double
          pi = hs.Plugin("BeakerStat")
          currentCoolSetPoint = pi.getCoolSet(1, 1)
          currentCoolSetPoint = currentCoolSetPoint + 1
          pi.cmdSetCool(1, currentCoolSetPoint)

          pi.getCoolSet(1, 1) works correctly

          pi.cmdSetCool(1, currentCoolSetPoint) does not work.
          Here is the error:
          System.MissingMemberException: Overload resolution failed because no accessible 'cmdSetCool' accepts this number of arguments. at Microsoft.VisualBasic.CompilerServices.OverloadResolution.Re solveOverloadedCall(String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.Resolv eCall(Container BaseReference, String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMe thod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCa ll(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) at tenScripting.Test.Main(Object Parms) in Y:\Working code\tenScripting_1_4_2\tenScripting\BruceHome.vb:line 285

          Comment


            #6

            Comment


              #7
              Good find. It appears this plugin didn't fully implement the tstat API.
              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #8
                Originally posted by Rupp View Post
                Good find. It appears this plugin didn't fully implement the tstat API.
                I guess I'm a little confused as to what the problem is. The thermostat API shows that CmdSetCool takes 3 arguments, but the OP was passing two. I implemented according to the API docs. Are you guys saying the third parameter is really supposed to be optional?
                HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
                Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
                Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
                Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

                Comment


                  #9
                  It appears you did it correctly. I was going off what the OP stated when they said:
                  "pi.getCoolSet(1, 1) works correctly"

                  3 parameters is correct.
                  💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                  Comment


                    #10
                    BRBJR - thanks for working through this!

                    I have two momentary push buttons next to my wife's bed on her bedstand, and I want her to be able to press one button to increase the temperature by 1 degree, and press the other to reduce by 1 degree. Do you know how I'd modify this script to accomplish the desired effect? I know my momentary push buttons are good, and can trigger events in HS by pressing either of them. I have the 3M / Filtrete thermostat with BeakerStat. Works great. I appreciate your experience and advice!

                    Adam

                    Dim pi As Object
                    Dim currentCoolSetPoint As Double
                    pi = hs.Plugin("BeakerStat")
                    currentCoolSetPoint = pi.getCoolSet(1, 1)
                    currentCoolSetPoint = currentCoolSetPoint + 1 <- WOULDN"T THIS INCREASE TEMP BY 1 DEGREE?
                    pi.cmdSetCool(1, currentCoolSetPoint, 1)

                    Comment


                      #11
                      Yes, that should work.
                      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                      Comment


                        #12
                        Got it! Works great. I was a bonehead and have been doing everything as .txt. Saw in another post that this needed to be renamed to .vb, and after that... surprise. Rookie mistake.

                        So now I have two momentary pushbuttons, one red and one green on the side of my wife's nightstand (all wires concealed) that she can press to increase or decrease the 3M Wifi thermostat without getting out of bed. She'll appreciate that.

                        As a side note, I also have a 'naughty' mode, that plays the sad trombone sound if she presses the red button, or plays Barry White 'Let's Get it On' when she presses the green button. We'll see how long THAT lasts :-)

                        Comment


                          #13
                          So this was working fine... but I've installed a second thermostat, both of which work great, but it doesn't seem to work any longer. Is there an argument in there that specifies which thermostat is being controlled?

                          Also, is the hs.speak property still allowed in .vb scripts? It seems to completely ignore the command.

                          Here's the code...

                          Sub Main(ByVal parms as Object)
                          Dim pi As Object
                          Dim currentCoolSetPoint As Double
                          pi = hs.Plugin("BeakerStat")
                          currentCoolSetPoint = pi.getCoolSet(1, 1)
                          currentCoolSetPoint = currentCoolSetPoint - 1
                          pi.cmdSetCool(1, currentCoolSetPoint, 1)
                          hs.Speak "Thermostat set to", True
                          hs.Speak (currentCoolSetPoint), True
                          hs.Speak "degrees", True
                          End Sub

                          Thanks!!
                          Adam

                          Comment


                            #14
                            Off the top of my head it's the first 1 in these lines:
                            currentCoolSetPoint = pi.getCoolSet(1, 1)
                            pi.cmdSetCool(1, currentCoolSetPoint, 1)
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment


                              #15
                              Originally posted by Adam12hicks View Post
                              So this was working fine... but I've installed a second thermostat, both of which work great, but it doesn't seem to work any longer. Is there an argument in there that specifies which thermostat is being controlled?

                              Also, is the hs.speak property still allowed in .vb scripts? It seems to completely ignore the command.

                              Here's the code...

                              Sub Main(ByVal parms as Object)
                              Dim pi As Object
                              Dim currentCoolSetPoint As Double
                              pi = hs.Plugin("BeakerStat")
                              currentCoolSetPoint = pi.getCoolSet(1, 1)
                              currentCoolSetPoint = currentCoolSetPoint - 1
                              pi.cmdSetCool(1, currentCoolSetPoint, 1)
                              hs.Speak "Thermostat set to", True
                              hs.Speak (currentCoolSetPoint), True
                              hs.Speak "degrees", True
                              End Sub

                              Thanks!!
                              Adam
                              One of the differences between VBScript (.txt files) and VB.net scripts (.vb) is that some calls require surrounding parentheses. You can also join some parts of the script together so try something like this;

                              hs.speak("Thermostat set to " & currentCoolSetPoint & " degrees", True, "*:*")

                              Whilst the *:* which specifies the host is optional it can't hurt to include it.

                              Comment

                              Working...
                              X