Announcement

Collapse
No announcement yet.

tenScripting Now Available for HS3

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

    When I load your project into VS, I get multiple syntax errors and warnings. If you run the project, and tell it to ignore the errors, the project will run, but because of the errors in the modules that contain your scripts, it is not compiled and hence cannot be loaded when tenScripting tries to run it, hence the error.

    Does this make sense?

    If you correct the items marked as errors, it should compile, and the running tenScripting should be able to load it.

    tenholde
    Attached Files
    tenholde

    Comment


      Originally posted by tenholde View Post
      When I load your project into VS, I get multiple syntax errors and warnings. If you run the project, and tell it to ignore the errors, the project will run, but because of the errors in the modules that contain your scripts, it is not compiled and hence cannot be loaded when tenScripting tries to run it, hence the error.



      Does this make sense?



      If you correct the items marked as errors, it should compile, and the running tenScripting should be able to load it.



      tenholde

      Comment


        Thanks so much, back in business. Is it usual for tenscripting to cause homeseer to crash? I think I remember this way back and it happens invariably when I close tenscripting either by hitting the x on the gui or hitting stop on the debugger in visual studio. Homeseer completely goes away and I have to start it up again.

        Comment


          Does this happen every time? I have not heard of this being a problem. The tenScripting program itself can fail on exit and you might get an error in log that hs could not access the hsevent routine, object not found, but that is an hs3 bug that they have been slow to fix.
          tenholde

          Comment


            Originally posted by tenholde View Post
            Does this happen every time? I have not heard of this being a problem. The tenScripting program itself can fail on exit and you might get an error in log that hs could not access the hsevent routine, object not found, but that is an hs3 bug that they have been slow to fix.
            Sorry for the late response. But yes, it seems to happen everytime and after running various scripts, so not just one in particular. Usually, after I close tenscripting there will be a delay and then homeseer will be done. It's weird because there will be no mention in the homeseer log about shutting down or any errors, etc. It just stops. It doesn't seem to matter if I hit the x on tenscripting or just stop debugging.

            Comment


              Originally posted by jayman13 View Post
              Sorry for the late response. But yes, it seems to happen everytime and after running various scripts, so not just one in particular. Usually, after I close tenscripting there will be a delay and then homeseer will be done. It's weird because there will be no mention in the homeseer log about shutting down or any errors, etc. It just stops. It doesn't seem to matter if I hit the x on tenscripting or just stop debugging.
              I uploaded a new version, tenScripting 3.26, that now provides a checkbox that allows you to tell tenScripting not to register for HS Device Change and Log Record Events. This will take effect after you restart tenScripting.

              Would you install this release, turn OFF event processing, and see if HS still terminates when you terminate tenScripting?

              There have been bugs in HS3 related to plugins that register for events and then terminate and restart. HS provides no way of unregistering for the events you registered, and does not properly clean this up when a remote plugin disconnects and terminates. Then, HS tries to call the plugin's HsEvents routine and there is no plugin to process it. In my and other's experience, HS just logs an error (reference to a null object) and continues. The problem usually manifests itself in that when you rerun tenScripting to continue debugging your code, HS does not call into the new instance of the plugin. I have not seen/heard of HS terminating before, but I suspect that your HS is terminating because of this issue. That's why I'd like to see if turning off Event registration resolves this for you.

              tenholde
              tenholde

              Comment


                Originally posted by tenholde View Post
                I uploaded a new version, tenScripting 3.26, that now provides a checkbox that allows you to tell tenScripting not to register for HS Device Change and Log Record Events. This will take effect after you restart tenScripting.

                Would you install this release, turn OFF event processing, and see if HS still terminates when you terminate tenScripting?

                There have been bugs in HS3 related to plugins that register for events and then terminate and restart. HS provides no way of unregistering for the events you registered, and does not properly clean this up when a remote plugin disconnects and terminates. Then, HS tries to call the plugin's HsEvents routine and there is no plugin to process it. In my and other's experience, HS just logs an error (reference to a null object) and continues. The problem usually manifests itself in that when you rerun tenScripting to continue debugging your code, HS does not call into the new instance of the plugin. I have not seen/heard of HS terminating before, but I suspect that your HS is terminating because of this issue. That's why I'd like to see if turning off Event registration resolves this for you.

                tenholde
                Thanks. It appears after I turned off event processing, homeseer hasn't been shutting down. I am going to do more testing tonight to be sure as sometimes there is a little delay after shutting down tenscripting where homeseer then crashes. So far so good.

                Comment


                  Hi, I'm new to HS and I'm really happy that I found out about tenScripting. I've noticed that you've discussed C# few months ago. I'm about to start using tenScripting, is there any update about C# support? So I don't have to "learn" VB...

                  Comment


                    I've looked at supporting c# several times, but the syntax checking would have to significantly rewritten, and I don't anticipate that happening anytime soon.
                    tenholde

                    Comment


                      This looks very interesting but it's gong to force me to add Parallels to my Mac so I can run Windows 7 Oh, Well, such is life
                      HomeSeer Version: HS3 Standard Edition 3.0.0.548
                      Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                      Number of Devices: 484 | Number of Events: 776

                      Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                      3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                      4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                      3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                      Z-Net version: 1.0.23 for Inclusion Nodes
                      SmartStick+: 6.04 (ZDK 6.81.3) on Server

                      Comment


                        Originally posted by Timon View Post
                        This looks very interesting but it's gong to force me to add Parallels to my Mac so I can run Windows 7 Oh, Well, such is life
                        Hi TImon,

                        Give VirtualBox a try. I find it to be much less resource hungry than Parallels and it's free. The only thing I've run into is a problem with bridged networking if you happen to be running Symantec anti-virus. Symantec sees the VB shim as an Arp-poisoning attack if you set networking to bridged. If you use NAT it works fine.

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

                        Comment


                          Merry Christmas tenholde . I have a question for you about the the Parms field on the Manage Triggers screen.
                          I am triggering on a value change to a selected device. What would I enter in the Parms field to have my script passed the device status change object that is generated by HS? i.e. I'd like to pass into my script the Parm Object containing [Code, Address, NewVal, OldVal, Ref], but not with static values I've made up but rather the actual values triggered due the the value change.

                          Is this possible? Thanks for you help.

                          Comment


                            HS only allows you to pass a single string parameter to a script, and as tenScripting attempts to simulate that environment, the same is true. You could pass a DevRef to the device that you are interested in and have your script obtain all of the information about that device.

                            tenholde

                            Comment


                              Hi,

                              I'm stuck on a Visual Basic script issue, and hope someone can help.
                              The script runs fine from within tenScripting3, but fails with a compilation error when I run it directly in HomeSeer.

                              In tenScripting3, I have an UpdateSensorColor.vb script which contains (at a high level):

                              Class UpdateSensorColor

                              Class AlertDevice
                              ...
                              Public Sub Dump()
                              hs.WriteLog("Info", "This statement causes a compilation error.")
                              End Sub
                              End Class

                              Public Sub Main(ByVal param As Object)
                              hs.WriteLog("Info", "This statement does not cause any trouble.")
                              ... use Class AlertDevice...
                              End Sub

                              End Class

                              This script works just fine within tenScripting3. However, if I export to HomeSeer and run it directly from HomeSeer, every call to hs.<member>" (such as hs.WriteLog) from within Class AlertDevice results in the error:

                              Compiling script... Reference to a non-shared member requires an object reference

                              Why can't I call hs functions from within Class AlertDevice? If I run the script from tenScripting3, it works just fine.

                              Thanks,

                              Comment


                                Can you post what is in your .VB files(s) in the HS script folder
                                tenholde

                                Comment

                                Working...
                                X