Announcement

Collapse
No announcement yet.

Start up script

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

    Start up script

    I am getting a error on my start up script. I use to start up the speaker and now its now. Help desk tried to help me, but talked way above my head, even asking them to try to come down to my level, I still got a confusing answer. Could someone look at this and tell me what is going on. It has never spoke "Welcome to homeseer" which I think would be so cool. This is the error I am getting
    2/1/2008 10:32:20 PM - Error - Running script, script run or compile error in file: startup.txt1016:Expected 'Sub' in line 9 More info: Expected 'Sub'



    ' this is the startup script
    ' it is run once when HomeSeer starts up
    '
    ' this is a good place to default status on some devices
    '
    sub main()
    hs.WriteLog "Startup","Scripting is OK"
    hs.IsApplicationRunning("Speaker")
    hs.Launch hs.GetAppPath & "\HomeSeer 2\Speaker.exe","","",0 end if

    ' if speaker client is not running, start it
    if not hs.IsApplicationRunning("Speaker") then
    hs.Launch hs.GetAppPath & "\HomeSeer 2\Speaker.exe","","",0

    end if
    ' speak
    hs.speak "Welcome to Home-Seer"
    'add calls startup scripts and function calls here
    'i_ret = hs.RunEx("WAF-NetCallerID.vbh","open_ncid","")
    hs.runex "NetCallerID_funcs.vb","NCID_open_port",""





    end sub
    danielbo

    #2
    I think I see the problem now.
    Try
    sub main()
    hs.WriteLog "Startup","Scripting is OK"

    ' if speaker client is not running, start it
    if not hs.IsApplicationRunning("Speaker") then
    hs.Launch hs.GetAppPath & "\HomeSeer 2\Speaker.exe","","",0
    end if
    ' speak
    hs.speak "Welcome to Home-Seer"

    'add calls startup scripts and function calls here
    'i_ret = hs.RunEx("WAF-NetCallerID.vbh","open_ncid","")

    hs.runex "NetCallerID_funcs.vb","NCID_open_port",""

    end sub
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Try this...

      I've made some changes to your script and it works now. You can compare it to your original to see the differences. I also commented out your NetCallerID because I don't have that code. Try it with it commented out first to see if it works then take out the comment.

      Code:
      Sub Main()
          hs.WriteLog "Startup","Scripting is OK"
      ' if speaker client is not running, start it
          if not hs.IsApplicationRunning("Speaker") then
              hs.Launch hs.GetAppPath & "\Speaker.exe","","",0
              'give speaker a couple of seconds to start up
              hs.waitsecs(3)
          end if
      ' speak
          hs.speak "Welcome to Home-Seer"
          
      'add calls startup scripts and function calls here
      'hs.runex "NetCallerID_funcs.vb","NCID_open_port",""
      End Sub
      James

      Running HS 3 on Win10 .

      Comment


        #4
        Thank you, out of town right now, will try it tomorrow.
        I am grateful for your help and hope it will work.
        Danielbo
        danielbo

        Comment


          #5
          Originally posted by Rupp View Post
          I think I see the problem now.
          Try
          sub main()
          hs.WriteLog "Startup","Scripting is OK"

          ' if speaker client is not running, start it
          if not hs.IsApplicationRunning("Speaker") then
          hs.Launch hs.GetAppPath & "\HomeSeer 2\Speaker.exe","","",0
          end if
          ' speak
          hs.speak "Welcome to Home-Seer"

          'add calls startup scripts and function calls here
          'i_ret = hs.RunEx("WAF-NetCallerID.vbh","open_ncid","")

          hs.runex "NetCallerID_funcs.vb","NCID_open_port",""

          end sub
          Rupp the hs.GetAppPath will include the "\homeseer 2" directory and because of that the launch will fail. Is that correct?
          James

          Running HS 3 on Win10 .

          Comment


            #6
            I did do it remotely and looks fine. I dont have the little speaker icon on the bottom, does that mean anything. I being not there, I dont know if the homeseer computer speakers is working. Does the speaker Icon need to be showing?
            danielbo

            Comment


              #7
              The speaker Icon...

              The speaker Icon should be there. If there wasn't any errors in the log there is a possibility that it did work. Try this startup script and it will write to the log if it is or isn't running.

              Code:
              Sub Main()
                  hs.WriteLog "Startup","Scripting is OK"
              ' if speaker client is not running, start it
                  if not hs.IsApplicationRunning("Speaker") then
                      hs.Launch hs.GetAppPath & "\Speaker.exe","","",0
                      'give speaker a couple of seconds to start up
                      hs.waitsecs(3)
                  end if
              ' speak
                  hs.speak "Welcome to Home-Seer"
                  if hs.IsApplicationRunning("Speaker") then
                      hs.writelog "Startup", "Speaker app is running"
                  else
                      hs.writelog "Startup", "Speaker app is not running"
                  end if
              'add calls startup scripts and function calls here
              'hs.runex "NetCallerID_funcs.vb","NCID_open_port",""
              End Sub
              James

              Running HS 3 on Win10 .

              Comment


                #8
                This is directly from the delivered version of HS's startup file.

                if not hs.IsApplicationRunning("Speaker") then
                hs.launch hs.GetAppPath & "\Speaker.exe", "Main", , 0
                end if

                If you do not see the speaker icon you can use the task manager to see if it's running?
                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                Comment


                  #9
                  Rupp's version does seem to be more correct. It seems when you add the "main" it keeps the application visible. You can cut and paste the "hs.launch" line from Rupps example and use the "Immediate Script" section of "Control Device" page to test it out. It worked for me.
                  James

                  Running HS 3 on Win10 .

                  Comment


                    #10
                    Ok thanks guys, I am going to have to wait till I get home to play with it more and see what working and whats not. I am getting a differant error message now for some reason. The one great thing is I see the speaker in the task menu. But I didnt see it pop up and say welcome to homeseer. I did on one of the scripts. I might be saying it, the log says it is, but of course since I am not there I cant here it.
                    But now I am getting a new error. Its another story.

                    2/1/2008 11:30:36 PM - Error - In OpenComPort, error opening port: Unable to obtain a handle to the COM port

                    2/1/2008 11:30:36 PM - debug - NCID: Error opening COM1: Error: Unable to obtain a handle to the COM port

                    2/1/2008 11:30:36 PM - Warning - Attempt to send to COM port 1, port is not open

                    This has something to do with my net id.
                    danielbo

                    Comment


                      #11
                      The funny thing is we didnt change anything there, wonder why am I getting this error. I looked at the original compared to this one. We still didnt change anything. Just wonder way it is showing now?
                      danielbo

                      Comment


                        #12
                        If you do not use the wafNetcaller device you need to comment out this like:
                        'hs.runex "NetCallerID_funcs.vb","NCID_open_port",""
                        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                        Comment


                          #13
                          Originally posted by Rupp View Post
                          If you do not use the wafNetcaller device you need to comment out this like:
                          'hs.runex "NetCallerID_funcs.vb","NCID_open_port",""
                          That's not from the WAF package, that is from my script package.

                          Dan,
                          It doesn't look to me like it's related to your original problem (which seems like you just had the wrong path for the speaker ap), but if you are having some issues with my NetCID stuff let me know.
                          Steve

                          Comment


                            #14
                            I was getting other error and yours was fine. We got the other problem fixed and now I have this error. I looked and nothing had changed on yours. What do you think it could be or should I do to get this error fix? It funny, I wasnt getting it before. Do you think maybe it was never getting down to that part of the start up script. Now that it is, it might not have ever worked the way it is suppose to. I never thought I had a problem with it. But why else would I be getting it now?

                            Originally posted by stevea View Post
                            That's not from the WAF package, that is from my script package.

                            Dan,
                            It doesn't look to me like it's related to your original problem (which seems like you just had the wrong path for the speaker ap), but if you are having some issues with my NetCID stuff let me know.
                            Steve
                            danielbo

                            Comment


                              #15
                              Dan,

                              I suspect it wasn't getting that far down in the script. But you've been using my stuff for months, right? It was doing announcements of the Caller ID?

                              The error looks like it is trying to open COM1 and can't. Is that the right COM port for the NetCallerID Box? Check your NCID.ini file and make sure all the settings are correct.

                              If you continue to have problems, let's work it via email (since I don't think it is the subject of this thread any more).

                              Steve

                              Comment

                              Working...
                              X