Announcement

Collapse
No announcement yet.

tenScripting Now Available for HS3

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

    Trouble Installing

    Hi:

    I have been trying to install your tenscripting3 for HS3. It seems like it would be extremely useful. I have been following your video but when I try to run the project the first time I get the following 2 windows.

    What have I done wrong?
    Attached Files
    jjsmd@yahoo.com

    Comment


      Sorry this one as well
      Attached Files
      jjsmd@yahoo.com

      Comment


        If you look in all of the files that have an extension of ".vb" in the project folder you will probably see more than one occurrence of a ToggleDeviceSample sub. Cannot do that.

        If you cannot find that, zip up the entire project folder and sub folders and post it.

        tenholde
        tenholde

        Comment


          Script runs in tenScripting, not in HS3

          I could use some guidance. I wrote a weather script to speak the weather, and it speaks great for both methods from tenScripting, but won't in a HS3 event that calls the methods, and I'm not sure why.

          It's a short script with 2 subs. One sub is Main, one is 'detailed_forecast'. Neither require any parameters. I have 2 events, one to run each of the 2 methods. But both throw the same error to the HS3 log: "Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Weather_Underground.vb: Exception has been thrown by the target of an invocation.". I'll include the script & event screen-captures for your reference...

          PHP Code:
          Class Weather_Underground
              Dim Forecast0_LO 
          As String hs.DeviceString(531)

              Public 
          Sub Main(Parm As Object)
                  
          Dim Short_Forecast_Today As String hs.DeviceString(534)
                  
          Dim Short_Forecast_Tonight As String hs.DeviceString(539)
                  
          Dim Forecast0_Precip_Day As String hs.DeviceString(537)
                  
          Dim Forecast0_Precip_Night As String hs.DeviceString(538)
                  
          Dim Forecast0_HI As String hs.DeviceString(530)

                  
          hs.Speak("Today, " Short_Forecast_Today " and " Forecast0_HI)
                  
          hs.Speak("Tonight, " Short_Forecast_Tonight " with a low of " Forecast0_LOTrue"")
                  If 
          Forecast0_Precip_Day Forecast0_Precip_Night Then
                      hs
          .Speak("Chance of precipitation for today & tonight is " Forecast0_Precip_Day "%"True"")
                  Else
                      
          hs.Speak("Chance of precipitation is " Forecast0_Precip_Day "% Today, and " Forecast0_Precip_Night "% tonight."True"")
                  
          End If
              
          End Sub

              
          Public Sub Detailed_Forecast(Param As Object)
                  
          Dim Forecast_Today As String hs.DeviceString(535)
                  
          Dim Forecast_Tonight As String hs.DeviceString(540)
                  
          Dim Forecast_Tomorrow As String hs.DeviceString(546)
                  
          Dim Forecast_Tomorrow_Night As String hs.DeviceString(549)

                  
          hs.Speak("Today, " Forecast_TodayTrue"")
                  
          hs.Speak("Tonight, " Forecast_TonightTrue"")
                  
          hs.Speak("Tomorrow, " Forecast_Tomorrow ", Tomorrow's low, " Forecast0_LOTrue"")
              
          End Sub

          End 
          Class 
          Attached Files

          Comment


            HS3 does not like the DIM statement before the first SUB.

            No idea why, but HS3 scripting environment is a little strange.



            Solution: move the DIM statement to the first statement in each SUB


            tenholde
            tenholde

            Comment


              That fixed it - thank you! I wouldn't have guessed that, without your help.

              Comment


                Has anyone used tenScripting in combination with Visual Studio 2015 Community Edition?

                Kind regards,

                Remko.

                Comment


                  Yes I do, with no specific problem from first release.
                  The only trouble I had once was when I forgot to synchronise dlls from HS in the VS project package. Since then it works like a charm.

                  W10, VS2015 Community, X64, HS3 206, ZW 130

                  Jean

                  Comment


                    Thanks!

                    I'll try it also

                    Remko

                    Comment


                      startup trouble

                      when trying to run tenscripting, I get the following and it will not connect

                      I did add all the references, but I can't figure out how to get past this point.

                      Any help would be appreciated.

                      Thanks
                      Attached Files

                      Comment


                        Originally posted by zsima View Post
                        when trying to run tenscripting, I get the following and it will not connect

                        I did add all the references, but I can't figure out how to get past this point.

                        Any help would be appreciated.

                        Thanks
                        comment out the hsp= statement


                        tenholde
                        tenholde

                        Comment


                          tenholde, firstly thanks fora fantastic tool and all the best for 2016.

                          I see the "import scripts" functionality still does not add a CRLF par between "End Sub" and "End Class" meaning you need to go through the import and manually correct.

                          Also, a number of my scripts have "Imports <assembly>" statements, when they are pulled in to a single class, those "Imports" statements need to be at the top of the class before any other statements. How do you handle each script needing different "Imports" statements and where to place them?

                          Gavin
                          Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

                          Comment


                            Upon export, all import statement get added to each exported file/script. Extra imports should do no harm.

                            I'll look at the import function to see what is going on. Should move all import statements to the front of the targeted .vb file

                            tenholde
                            tenholde

                            Comment


                              I was looking for a simple way to connect my own Phidgets VB.NET stuff to HS3 like I do with HS2. This is really great stuff.
                              Thank you.!

                              Gerard

                              Comment


                                Originally posted by beerygaz View Post
                                tenholde, I just fired up your HS3 version 3.15 and am seeing the following in the HS3 log:
                                Mar-10 10:03:35 Error Calling HSEvent in plugin tenScripting, Instance :A generic error occurred in GDI+.

                                Comment

                                Working...
                                X