Announcement

Collapse
No announcement yet.

Write to Log File

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

    Write to Log File

    I am running HS4 in case this makes a difference. I want to write to the log file. So I started out simple, hs.writelog ("temp= "). I does not work. My goal is to print out the actual device temp as well. Any suggestions?

    #2
    The WriteLog function requires two string parameters:

    Click image for larger version

Name:	wrtlog.png
Views:	76
Size:	72.7 KB
ID:	1410949
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      You might run into problems if you follow the example if using vb scripts. You will fare better with

      hs.WriteLog("Error","An error has occurred in my script!")
      Don

      Comment


        #4
        Originally posted by donstephens View Post
        You might run into problems if you follow the example if using vb scripts. You will fare better with

        hs.WriteLog("Error","An error has occurred in my script!")
        I am using a Hometroller Zee S2 and just tried your example verbatim but it doesn't appear in my HS log window.
        Any suggestions? It would be a highly useful feature for my needs.
        -steve

        Comment


          #5
          No error message? Sorry, but I'm out of suggestions.
          Don

          Comment


            #6
            Originally posted by Otto-mation View Post

            I am using a Hometroller Zee S2 and just tried your example verbatim but it doesn't appear in my HS log window.
            Any suggestions? It would be a highly useful feature for my needs.
            -steve
            How are you specifying your WriteLog? Part of a script file? If so, can you show us the complete script?

            If the script is an immediate script, then you would want to precede the hs.Writelog with a "&n". Example:

            Code:
            &nhs.WriteLog("Error", "Error message goes here")

            Comment


              #7
              Originally posted by aa6vh View Post

              How are you specifying your WriteLog? Part of a script file? If so, can you show us the complete script?

              If the script is an immediate script, then you would want to precede the hs.Writelog with a "&n". Example:

              Code:
              &nhs.WriteLog("Error", "Error message goes here")
              Thanks for the example - I did exactly that in the immediate script - as per the screen grab below - I use test events for small pieces before using them in anything bigger.


              Click image for larger version

Name:	screen01.jpg
Views:	46
Size:	25.9 KB
ID:	1412379

              Comment


                #8
                Does the event itself show in the log?
                If there are no error messages, I wonder if there is a filter being applied to your log. (Try resetting the log to be sure no filters are active.)

                This is what I see in the log when I try a test event to write to the log (last entry is at the top):
                Aug-19 8:55:22 AM Test vbs test
                Aug-19 8:55:22 AM Event Running script statement immediately: &hs.WriteLog "Test", "vbs test"
                Aug-19 8:55:22 AM Event Event Trigger "Test Immediate script"
                Aug-19 8:55:22 AM Event Event Test Immediate script triggered by the event page 'Run' button.
                Mike____________________________________________________________ __________________
                HS3 Pro Edition 3.0.0.548, NUC i3

                HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                Comment


                  #9
                  Thanks for the suggestion - I reset the log filter but doesn't appear to have made a difference.
                  Here's the latest log clip and the event itself follows.....




                  Click image for larger version

Name:	screen02.jpg
Views:	39
Size:	46.8 KB
ID:	1412394

                  Click image for larger version

Name:	screen03.jpg
Views:	37
Size:	45.1 KB
ID:	1412395

                  Comment


                    #10
                    Interesting. Just for giggles, try temporarily removing the Speak command and then re-run the event. Maybe the Speak is causing some sort of problem?

                    Comment


                      #11
                      WOW!!! You score!!!
                      I removed the speak command
                      SOLVED!
                      I'm ecstatic and grateful for your suggestion and help!
                      WOOHOOOO!!!


                      Click image for larger version

Name:	screen04.jpg
Views:	33
Size:	17.9 KB
ID:	1412436

                      Comment

                      Working...
                      X