Announcement

Collapse
No announcement yet.

Learn to create script:

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

    #16
    Rupp, where do you get the idea that vb.net is that hard to learn?

    If learning a simple language as vb.net is discouraging and very hard to understand, then VBS has to be equally hard. And then perhaps scripting isn't for you.
    HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
    Running on Windows 10 (64) virtualized
    on ESXi (Fujitsu Primergy TX150 S8).
    WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

    Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

    Comment


      #17
      Like most others here, VB.NET is the only way to go for scripts. That said, you also need to know some VBS or the syntax differences between the two.

      Homeseer is still back wards when it comes to the immediate script commands for events (i.e. it only supports VBS) and the example given by Stipus would never work. Homeseer also still promotes the startup and shutdown scripts using VBS (.txt) even with the latest version. I find this odd since VB.NET support has been provided for some time by the use of startup.vb and shutdown.vb but never used??

      One thing that does still promote the use of VBS in my opinion is writing web pages for Homeseer. This always promotes debate but the speed of pages served by Homeseer is so much faster using asp rather than aspx due to its memory architecture.
      Jon

      Comment


        #18
        Originally posted by Rupp View Post
        I believe you are mixing the beginner world with the advanced world. Most beginners aren't looking to do multi-threading, they simply want to have HS speak a variable for example. I would completely agree if you are going to use a lot of HomeSeer scripts and spend the time to learn a full blown language then .net is the only way to go but most of you guys must have forgotten how it was to get started. The beginner isn't even going to know how to load tenScripting let alone use visual studio. The issue I've seen over and over is the beginner gets discouraged and quits. .vbs is a quick and dirty way to get going quick and have some instant success.
        Mutli-Threading is simply a valuable by-product of using VB.NET.

        So, you would rather help users speak some text, write to a log, update a device variable using notepad or equivalent with no syntax checking? That will quickly lead to discouragement.
        HS4Pro on a Raspberry Pi4
        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

        HSTouch Clients: 1 Android

        Comment


          #19
          Originally posted by jon00 View Post
          Homeseer is still back wards when it comes to the immediate script commands for events (i.e. it only supports VBS) and the example given by Stipus would never work. Homeseer also still promotes the startup and shutdown scripts using VBS (.txt) even with the latest version. I find this odd since VB.NET support has been provided for some time by the use of startup.vb and shutdown.vb but never used??
          I've spent hours wondering about the same, and it always annoys me when I have to use the Control for immediate script commands.

          Why can't this be optional (for old and stubborn(?) users)?
          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
          Running on Windows 10 (64) virtualized
          on ESXi (Fujitsu Primergy TX150 S8).
          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

          Comment


            #20
            Originally posted by Moskus View Post
            And that is something that is wrong with VBS. The sooner people learn to declare their variables, the better. It just makes more readable code (especially when the code gets complicated, which probably is going to happen if you like HomeSeer ).

            Developing .NET scripts with tenScripting is extremely easy!
            Just download VB.NET Express and off you go!
            I mostly agree. But, although my earlier rant was deliberately exaggerated, I still think it is much easier to start with VBS for simple scripts. VBS was designed for casual programmers. Learning to use it is mostly a learn by example process. Because it is limited in scope, the pertinent examples are relatively easy to capture in a guide book of approachable size.

            Vb.net is clearly much more structured and much more capable than VBS, and I've converted nearly all my VBS scripts to vb.net thanks in large part to tenScripting. (A godsend! Without it, I would still be at square -1. ) That said, I still find that opening a separate application to create a simple script is not that appealing, and I usually start by trying to adapt an existing script in Notepad when I need to create something new. I also find the class structure very confusing. I usually cannot predict which class contains which functionality, and have not found any guides that have been useful - except to ask on this board for help.

            That is really my point. If you are dedicated to programming and study vb.net closely, I'm sure it becomes second nature. For those of us who come to HA from other fields, and who see scripting as a necessary evil to accomplish something we consider useful, it is not transparent at all. We still need concrete examples to get started. But, vb.net is so powerful and so comprehensive it is overwhelming for simple tasks. It feels like driving a tractor trailer to get to the corner store.

            Once your script is working correctly, ONLY THEN do you export it into your HomeSeer Script directory for production use.
            Unfortunately, either I don't fully understand how to use the tool or I'm really incompetent (or both ), but I find that my most annoying errors are those that involve interactions within the HS environment, and they only surface AFTER I've installed the script and run in for a few cycles - maybe over a few days or weeks - to discover the subtle bugs in my logic. Unfortunately, vb.net didn't change that.
            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


              #21
              Originally posted by Moskus View Post
              Rupp, where do you get the idea that vb.net is that hard to learn?

              If learning a simple language as vb.net is discouraging and very hard to understand, then VBS has to be equally hard. And then perhaps scripting isn't for you.
              I deal with new scripters on a daily basis and see it first hand. We can agree to disagree on this and move on. Look at this thread in general, it's opionions from a group of scripters so it's hardly a fair assesment. Ask newbies.
              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #22
                I prefer VB.Net over VBS... however my prefered language is c# .Net.

                That's why I originaly created the Script Connector plugin. To be able to write my HomeSeer scripts using c# !
                --
                stipus

                Comment


                  #23
                  Originally posted by Rupp View Post
                  IWe can agree to disagree on this and move on.
                  Sure.

                  I will still claim that scripting with tenScripting and Visual Basic Express is much easier to learn than scripting in VBS directly in HomeSeer.

                  Why?

                  The answer is simple:
                  IntelliSense and automatic syntax checking!


                  In my opinion there is nothing that can help a newbie more than that (except perhas combined with the help file ).

                  OK. Yeah. You have to start an external program. But so what? The advantages can't be beat.


                  When I started scripting I tried to do it direclty in HS. That was so painful it was not funny. I then moved on to Visual Studio. To me that was much easier. I had to add the references to the DLLs myself, but Intellisense was worth it.

                  Much to late I discovered tenScripting. IMHO the HS team should support the developer and add this as a top alternative to scripting directly. The only thing missing in tenScripting is moving a script directly to the \Script folder.. That's my dream, though.
                  HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                  Running on Windows 10 (64) virtualized
                  on ESXi (Fujitsu Primergy TX150 S8).
                  WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                  Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                  Comment


                    #24
                    Originally posted by Moskus View Post
                    The only thing missing in tenScripting is moving a script directly to the \Script folder.. That's my dream, though.
                    tenScripting has an EXPORT function that moves your script directly to the HomeSeer script folder (over your network share if your are testing on a different PC).

                    tenholde
                    tenholde

                    Comment


                      #25
                      Moskus - to echo what tenholde said, you can deploy your scripts from within tenScripting directly to your script folder - with or without UNC paths. It really works great for developing on a different machine, then deploying to HS.
                      HS4Pro on a Raspberry Pi4
                      54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                      Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                      HSTouch Clients: 1 Android

                      Comment


                        #26
                        I'm probably way over my head here, but when you screw up with VBS you get pointed pretty much to offending row. I have been struggling with NET and the error messages make me want to patronize the nearest pub. But, I also see the advantage of the studio environment.

                        I think I'll revisit tenscripting again, but to me nothing is easier than vbs.
                        Don

                        Comment


                          #27
                          http://msdn.microsoft.com/en-us/libr...7y(VS.85).aspx is a good reference for vbscripts as well as a jumping off point for javascript (very useful for web interfaces).

                          http://technet.microsoft.com/en-us/s.../dd823314.aspx is another helpful link for vbscripting.

                          My favorite resource for vbscripting is the Microsoft Scripting Doc 5.6 windows help file. http://www.microsoft.com/downloads/d...displaylang=en

                          For many things, vbscript is good enough and quick to develop, test, and deploy. For some things, vb.net is better, especially if it's more complicated, or has functions/methods/procedures etc. built in that you'd normally have to code manually in vbscript.

                          The great thing about the windows scripting docs for me is I can find the right syntax rather quickly and don't have to guess what methods may suddenly appear when I push the '.' key hoping the right thing pops up in visual studio.

                          VB.NET is so complicated by comparison that it's overwhelming to get the first script to work, you know, one that does more than just say hello. The error generated obviously points to the wrong spot within the actual vb.net script for homeseer, which complicates debugging. tenholde scripting system greatly improves the development process, but it does have the initial learning curve and does not work for what I think are most novice homeseer users/programmers who simply want to get something working with as little learning curve as possible.

                          I think Rupp is right on when suggesting new homeseer users use vbscript. I think others are right on when they suggest the bonus' available for vb.net.

                          Where you fall within the learning curve of vbscript vs. vb.net/c# is something only you can answer. I still develop in vbscript, and if it's going to do something I think might work better multi-threaded, or take a long time to complete, I'll port to vb.net.

                          I use many different tools, but I started with vbscript and I think most new homeseer users would benefit from that process as well. Many would be quite happy with the results and not have to learn an extirely new environment (visual studio).

                          Hopefully I've actually stayed on topic and provided useful information to the original poster.
                          huggy_d1

                          Automating made easy

                          Comment


                            #28
                            Originally posted by tenholde View Post
                            tenScripting has an EXPORT function that moves your script directly to the HomeSeer script folder (over your network share if your are testing on a different PC).
                            tenholde
                            That's just it. I don't want to share my \Script folder...

                            Originally posted by rmasonjr View Post
                            Moskus - to echo what tenholde said, you can deploy your scripts from within tenScripting directly to your script folder - with or without UNC paths. It really works great for developing on a different machine, then deploying to HS.
                            Can it actually be done without sharing the \Script folder?



                            Originally posted by huggy_d1 View Post
                            The great thing about the windows scripting docs for me is I can find the right syntax rather quickly and don't have to guess what methods may suddenly appear when I push the '.' key hoping the right thing pops up in visual studio.
                            If you push the . key and wait for whatever methods to suddenly appear, I think you have misunderstood the point of IntelliSense...


                            Originally posted by huggy_d1 View Post
                            The error generated obviously points to the wrong spot within the actual vb.net script for homeseer, which complicates debugging.
                            Yeah, the debugging for .NET in HS could be better. But this should be solvable if someone actually took a look at it...
                            HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                            Running on Windows 10 (64) virtualized
                            on ESXi (Fujitsu Primergy TX150 S8).
                            WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                            Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                            Comment


                              #29
                              Originally posted by Moskus View Post

                              Can it actually be done without sharing the \Script folder?
                              Yes, I use Tenscripting to create and debug...

                              Then i copy/paste the working code into a notepad doc.. which i can then put in the script directory....

                              Although... i am not sure why i don't share my /Script Directory... i'm not concerned about security behind my router/fire wall.... (maybe i'm naive?)

                              I'll have to take a look at that..
                              Regards,

                              Andrew B.

                              Comment


                                #30
                                Originally posted by ArbWare View Post
                                Yes, I use Tenscripting to create and debug...

                                Then i copy/paste the working code into a notepad doc.. which i can then put in the script directory....
                                Ah! That's what I'm doing now.
                                I thought you guys where doing something magical in tenScripting that would let me access the scripts in HS directly...
                                HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                                Running on Windows 10 (64) virtualized
                                on ESXi (Fujitsu Primergy TX150 S8).
                                WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                                Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                                Comment

                                Working...
                                X