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:	721
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 | 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:	655
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 | 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:	646
Size:	46.8 KB
ID:	1412394

                  Click image for larger version

Name:	screen03.jpg
Views:	659
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:	605
Size:	17.9 KB
ID:	1412436

                      Comment


                        #12
                        Originally posted by Otto-mation View Post
                        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:	605
Size:	17.9 KB
ID:	1412436
                        I know this is an old thread, but were you able to write to the log file as such and not have the "event writing to the log file" in the log file? It sort of is redundant.
                        HS3 Pro Edition 3.0.0.435 (Windows Server 8.1 on ESXi box)

                        Plug-Ins Enabled:
                        Z-Wave:,RaspberryIO:,AirplaySpeak:,Ecobee:,
                        weatherXML:,JowiHue:,APCUPSD:,PHLocation:,Chromecast:,EasyTr igger:

                        Comment


                          #13
                          Originally posted by wpiman View Post

                          I know this is an old thread, but were you able to write to the log file as such and not have the "event writing to the log file" in the log file? It sort of is redundant.
                          Click on "do not log this event" on the event options.

                          Comment

                          Working...
                          X