Announcement

Collapse
No announcement yet.

HS3 Migration Ongoing Project.

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

  • #46
    Originally posted by Wadenut View Post
    This is just a midnight observation.
    I know that at one time, way back when, in HS2 I'd used Include files in scripts using the #Include statement. Perhaps back then I was using VB6 scripts, I don't remember.

    It seems though that NET no longer (or perhaps never did) supports that handy facility, and there's really no way to efficiently implement something to get around this.

    I'm using a subroutine in virtually all my scripts now that replaces hs.ExecX10, and/or hs.Transmit which often appears dozens of times in dome of my files. It's about 8 lines and I've improved it several times this past week, meaning I've had to open and re-edit every single script for consistency.
    It's too bad this was omitted in VB.NET.
    Check out this thread: https://forums.homeseer.com/forum/ho...mon-subroutine
    Jon

    Comment


    • #47
      Originally posted by jon00 View Post
      Well now, isn't that special? I tried exactly that (as I'd always done before) the other day and got errors. Then I searched the net for the subject and found nothing but negative results. Now, that was back on 3....500, so now it might well work. I'll try later..
      Real courage is not securing your Wi-Fi network.

      Comment


      • #48
        I've been including other script files for ages, including on .500 with no issues. Not sure why it was not working for some in the thread that Jon referenced.

        Code:
        #Include includes/isholiday.vb
        
        Sub Main(ByVal Parms As String)
        HS 3.0.0.548: 1976 Devices 1156 Events
        Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

        Comment


        • #49
          I haven't tried today, but I just realized, perhaps it's the difference between \ and /. Perhaps tomorrow I'll try again. Took today off.
          Real courage is not securing your Wi-Fi network.

          Comment


          • #50
            I'm thinking either / or \ would work on Windows but that / would be needed for linux.

            EDIT: Just tried it here with the slash the other way and work fine (on Windows) that way too.
            HS 3.0.0.548: 1976 Devices 1156 Events
            Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

            Comment


            • #51
              Just tried. No go. No matter, I can live without it for now.
              Real courage is not securing your Wi-Fi network.

              Comment


              • #52
                Strange. Do you get the same errors as Don in the other thread?
                HS 3.0.0.548: 1976 Devices 1156 Events
                Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                Comment


                • #53
                  I do actually.
                  Real courage is not securing your Wi-Fi network.

                  Comment


                  • #54
                    Do you have a "Sub Main" in the file you are trying to include? Looking at mine, I don't have a Sub Main and also declare every function/subroutine as "Private":

                    Code:
                    Private Function FullMoon(whichday)
                    HS 3.0.0.548: 1976 Devices 1156 Events
                    Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                    Comment


                    • #55
                      Just ran into this too trying to play back a phone message:
                      File does not exist: C:\Program Files (x86)\HomeSeer HS3\html\hspw
                      Checked. No such file or folder. Likely something I haven't set up when I configured HSPhone.
                      Real courage is not securing your Wi-Fi network.

                      Comment


                      • #56
                        Originally posted by sparkman View Post
                        Do you have a "Sub Main" in the file you are trying to include?
                        No.

                        The file was this:

                        Sub Test(Parm as Object)
                        hs.Writelog("TST","Include worked")
                        End sub


                        Real courage is not securing your Wi-Fi network.

                        Comment


                        • #57
                          Originally posted by Wadenut View Post
                          Just ran into this too trying to play back a phone message:
                          File does not exist: C:\Program Files (x86)\HomeSeer HS3\html\hspw
                          Checked. No such file or folder. Likely something I haven't set up when I configured HSPhone.
                          Yes, there is no such file or folder, but if HS Phone is running, it should generate a web page when you go to http://www.xxx.yyy.zzz/hspw
                          HS 3.0.0.548: 1976 Devices 1156 Events
                          Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                          Comment


                          • #58
                            Try this:

                            Code:
                            Private Sub Test(Parm as Object)
                            hs.Writelog("TST","Include worked")
                            End sub

                            HS 3.0.0.548: 1976 Devices 1156 Events
                            Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                            Comment


                            • #59
                              Mine works without the Private as well:

                              Code:
                              #Include includes/test.vb
                              
                              Sub Main(ByVal Parms As String)
                                  hs.Writelog("TST","Did include work?")
                                  Test("123")
                              End Sub
                              Code:
                              Sub Test(Parm as Object)
                                  hs.Writelog("TST","Include worked")
                              End Sub
                              Mar-26 4:35:20 PM TST Include worked
                              Mar-26 4:35:20 PM TST Did include work?
                              Mar-26 4:35:19 PM Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/testinclude.vb
                              HS 3.0.0.548: 1976 Devices 1156 Events
                              Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                              Comment


                              • #60
                                Originally posted by sparkman View Post

                                Yes, there is no such file or folder, but if HS Phone is running, it should generate a web page when you go to http://www.xxx.yyy.zzz/hspw
                                OK, it does that, but can't play the message neither thri speaker clients or web page. Thought it might be related.
                                . So this error is expected then?
                                Real courage is not securing your Wi-Fi network.

                                Comment

                                Working...
                                X