Announcement

Collapse
No announcement yet.

tenScripting Now Available for HS3

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

    Originally posted by donstephens View Post
    Hi Ed:

    Can't pull my scripts from HS3 in tenscripting. The attached image shows that the paths are incorrect. I looked at your web site and can not find where to change these.

    The program works well, actually really well, just would like to get the paths correct. The HsComputer IP address is incorrect, as is the ExportDirectory and DebugLogPath. However, I can connect to HS3 from the computer running tenscripting.

    Thanks
    Note: The settings displayed in the VS settings dialog are only DEFAULT settings that are used until the program sets them.

    The actual settings are stored in a folder something like:

    c:\Users\??????\AppData\Local\tenWare\tenScripting3.vshost.e xe_Url_xxxxxxxxxxxxxxxxxxxxxxx\3.20.0.0\user.config

    tenholde
    tenholde

    Comment


      Originally posted by beerygaz View Post
      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
      Looking at the import function. Here are my thoughts:

      Move all Imports statements within each script being imported to the front of the CLASS definitions.

      Merge with any existing Imports statements in the File.

      Eliminate duplicates


      While not trivial, this should work. Make sense to you?

      tenholde
      tenholde

      Comment


        Originally posted by RBergquist View Post
        I am getting this same error running tenScripting 3.20, HS3 3.0.0.208, VS 2015 Community, Win 10. HS3 runs, it just seems to be making unneeded log entries.
        Could you put a breakpoint at HSPI.HsEvent beginning and single step through to see if you can help determine what might be generating the GDI error? I cannot reproduce it.

        tenholde
        tenholde

        Comment


          Originally posted by tenholde View Post
          Looking at the import function. Here are my thoughts:




          Move all Imports statements within each script being imported to the front of the CLASS definitions.



          Merge with any existing Imports statements in the File.



          Eliminate duplicates






          While not trivial, this should work. Make sense to you?



          tenholde

          Ed, it makes sense to me and everything should work. I know unnecessary imports statements have little effect but to keep things really neat, what about adding two more steps:

          Comment out the existing imports statements in situ (as well as moving them to the top) then remove the comment when writing back the individual files, keeping only the relevant statements for each script?

          Hmm, thinking as I type this makes adding 'new' imports statements awkward as the user would need to add them to the top of the file as well as the 'special commented' version lower down in the right place - not sure my idea doesn't just create a new problem.


          Sent from my iPhone using Tapatalk
          Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

          Comment


            Originally posted by tenholde View Post
            Could you put a breakpoint at HSPI.HsEvent beginning and single step through to see if you can help determine what might be generating the GDI error? I cannot reproduce it.

            Re:
            Mar-10 10:03:35 Error Calling HSEvent in plugin tenScripting, Instance :A generic error occurred in GDI+.

            I am getting this same error running tenScripting 3.20, HS3 3.0.0.208, VS 2015 Community, Win 10. HS3 runs, it just seems to be making unneeded log entries.
            tenholde
            Via Debug & HomeSeer log, I tracked down the problem to a set of Jon00Graphing devices I was using that somehow must have gotten corrupted. Deleted & they got recreated. Problem has gone away.

            Thanks.

            Comment


              Great, thanks for letting me know.

              tenholde
              tenholde

              Comment


                Exception within a few seconds of starting tenScripting3

                I'm setting up a new Windows 10 system with VS2015 Community Edition and tenScripting3 and I'm getting the following exception:

                "System.Runtime.InteropServices.ExternalException occurred in System.Drawing.dll"

                I'm able to connect to the HS3 system but I get this exception before I even get a chance to test any of the sample scripts.

                Any thoughts on what might be causing this or how to track it down?

                Windows 10 Home
                HS3Pro 3.0.0.297
                tenScripting3 3.20
                VS2015 Community Edition

                Thanks,
                Ken
                "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

                Comment


                  Originally posted by kenm View Post
                  I'm setting up a new Windows 10 system with VS2015 Community Edition and tenScripting3 and I'm getting the following exception:

                  "System.Runtime.InteropServices.ExternalException occurred in System.Drawing.dll"

                  I'm able to connect to the HS3 system but I get this exception before I even get a chance to test any of the sample scripts.

                  Any thoughts on what might be causing this or how to track it down?

                  Windows 10 Home
                  HS3Pro 3.0.0.297
                  tenScripting3 3.20
                  VS2015 Community Edition

                  Thanks,
                  Ken
                  I'm sorry that you are experiencing problems. When do you get the exception? Can you run the project successfully? If so, do the drop down lists properly show the files/scripts/Entry Points? Does it fail when you try to actually run one of the scripts?

                  tenholde
                  tenholde

                  Comment


                    I can start the project and just let it sit there and I'll get the exception anywhere from a few seconds to almost 5 minutes. I've just started debugging it and it looks like it's crashing in tenscripting.vb at UpdateDevices and the devicecode (dc) is always "91". It is always at Case &H40. (string change). I'm off to go figure out how to set a breakpoint on a variable value so stay tuned for more info.

                    Thanks,
                    Ken
                    "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

                    Comment


                      I suspect you have a device defined by a plugin that stores data in the ExtraData construct using non-standard objects. This is a known problem, and plugin authors should be advised to not do this.

                      IF THIS IS THE PROBLEM (Note: IF) What happens is if another plugin is running remotely (tenScripting3) and tries to reference the device object for such a device, the class definition for the stored object within the ExtraData fields is not available, and the interface processing fails.

                      First, are you running tenScripting3 on a different computer than HS3 (remotely)?

                      If so, one solution is to run tenScripting3 on the same HS3 computer. Not the best solution.

                      Another, is to determine which device is causing the problem, and copy the plugin's .exe file to the same remote folder where tenScripting3 is installed. Much better solution.

                      The best solution is to ask the plugin writer to revise their plugin to resolve this problem.

                      How to determine if this is the issue? One, try tenScripting on HS3 computer.

                      If the problem is an offending device, I've written a quick utility that tries to retrieve device information for every possible DefRef value. It will fail retrieving the offending device, and display an error.

                      Utility: http://tenholder.net/temp/findbaddevice.zip

                      Load the project into VS and run it. Make sure the VS project is running remotely.


                      Let me know what you find out,

                      tenholde
                      tenholde

                      Comment


                        Hi tenholde,

                        I think you nailed it. I've got several devices that use ExtraData. Several of the things you suggested aren't exactly what I was seeing so I need to collect up all of my notes and document what I was seeing. I'll follow up with another post tomorrow.

                        Thanks,
                        Ken
                        "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

                        Comment


                          Hi tenholde,

                          Let me start by saying thanks for the support and quick replies. As it turns out this problem was being caused by some Jon00VDGraphing devices I had first created years ago. I deleted each of the devices one at a time and the failing "dc" would become the next device until I got to the devices created with the latest version of Jon's scripts. It looks like he stopped using ExtraData a long time ago but the old devices may have still had data hanging around in that field. I probably missed the fact that I was supposed to delete the old devices and allow the updated scripts to recreate them.

                          As an aside I wanted to point out that I am running tenscripting3 on the same machine as HS3 but it still appears to connect as a remote plugin if you specify the HS3 machine's real IP address in the Connection dialog instead of 127.0.0.1.

                          Since these devices are created by and managed by an encrypted script there's no .exe file to move to a remote machine so that wasn't an option.

                          Finally, it looks like Jon "fixed" the problem awhile back but the devices have to be deleted and recreated to get rid of the old ExtraData.

                          Thanks again for your support,
                          Ken
                          "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

                          Comment


                            Error not showing

                            I'm just getting into converting my 106 scripts from HS2 to HS3.
                            One of my scripts was giving me this error.

                            Running script blSpeech_PreSpeak_3.vb :Exception has been thrown by the target of an invocation.->Does entry point Main exist in script? at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Obj ect obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at A.c17b105f989efe61e5979e67bec1ef734.cffd66cb0782c50126727e3f a75582d7a()

                            I discovered that this line in my script was the problem:
                            Select Case hs.DeviceValue("R50")

                            I changed it to:
                            Select Case hs.DeviceValueEx(132)

                            and the script ran without error.

                            No problem. My bad. That's the learning process. I climbed a little higher on the learning curve here as I discovered that the parameter in the function hs.DeviceValue has to be dvRef not the code assigned to the device.

                            I am wondering why tenScripting didn't catch this and show it as an error in visual studio? Maybe I don't have things set up right? It does show other errors, for example, like where I don't include all the required parameters in a function call.

                            Comment


                              Code:
                              I am wondering why tenScripting didn't catch this and show it as an error in visual studio? Maybe I don't have things set up right? It does show other errors, for example, like where I don't include all the required parameters in a function call.
                              Although the HS function is expecting an integer as a parameter, vb.net will do a lot of automatic type casting. For instance, if you specify "123" it will be converted to an integer of value 123.

                              The tenScripting VS project uses some fairly lenient defaults in order to not flag scripts that would run under HS3 as in error.

                              I would suggest you experiment with changing some of the project properties by right clicking on the project in the project explorer and selecting 'Properties/Compile Options'. Look at changing the following:

                              Option Strict --> On
                              Implicit Conversion --> Warning
                              Implicit Type, Object assumed --> Warning

                              Let me know what you think,

                              tenholde
                              Last edited by tenholde; October 27, 2016, 07:19 PM.
                              tenholde

                              Comment


                                Hi Ed:

                                I'm having trouble connecting to my HS Server from my Dev machine. I had the connection dialog box come up, where I put my conncetion settings in but the program stalls saying it can't connect. The log shows this.

                                Oct-27 1:33:48 PM Warning Cannot access remote plugin tenScripting
                                Oct-27 1:33:48 PM Info Plugin tenScripting with instance: has disconnected
                                Oct-27 1:31:47 PM tenScripting InitIO called, plug-in is being initialized...
                                Oct-27 1:31:47 PM Info Plugin tenScripting has connected. IP:192.168.0.110:60310


                                Did I miss something obvious?

                                My HS Server is located at xxx.xxx.xxx.109 not xxx.xxx.xxx.110, but I can't bring the connection dialog box up again to change this.

                                Thanks
                                Don

                                Comment

                                Working...
                                X