Announcement

Collapse
No announcement yet.

How to have event write a message to the log?

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

    How to have event write a message to the log?

    Is there a built-in way or a plugin that I can use in an Event action (not in a script) to write a message to the log (to use for debugging purposes)?

    #2
    "Run a script or script command"
    "Execute immediate script command:"
    Attached Files

    Comment


      #3
      Ok this is great. I was thinking about events, since I can't script. This is easy enough! Thanks
      Tom
      baby steps...starting again with HS3
      HS3Pro: Z-NET & 80 Z wave Devices,
      HSTouch: 4 Joggler (Android Kitkat), 2 iPhone, 3 iPads
      Whole House Audio: 5 SqueezePlay Jogglers w Bose Speakers
      In The Works: 10 Cameras Geovision, new Adecmo/Envisalink Alarm, Arduinos
      System: XP on Fanless Mini-ITX w/ SSD

      Comment


        #4
        Originally posted by MPodlin View Post
        "Run a script or script command"
        "Execute immediate script command:"
        super!! What are the 2 parameters - the 2nd is obviously the message to write, but the 1st "Test" is what?

        Comment


          #5
          Originally posted by mlevin77 View Post
          super!! What are the 2 parameters - the 2nd is obviously the message to write, but the 1st "Test" is what?
          It's the Type/Error column, you can put whatever you want there, usually something to identify what placed the message in the log.
          Mike

          Comment


            #6
            Sorry to bring back an old tread but I would like to use this simple interface to write some data to the log,similar to how send status emails. The email interface allows for macro expansion so I can get a wealth of informtion into in email in a template like format. The log function doesn't do that.

            Code:
            &hs.WriteLog("Test","Hallway Temp  = $$DSR:265:")
            Just writes out the raw text. Is there something like ExpandMacros() that would allow something like this:

            Code:
            &hs.WriteLog("Test", ExpandMacros("Hallway Temp = $$DSR:265:"))
            Or even better something like this that expands macros for you:

            Code:
            &hs.WriteLogExpand("Test", "Hallway Temp = $$DSR:265:")

            It is my preference to make this a "one-liner" for ease of use within the homeseer web interface.

            Comment


              #7
              Originally posted by hucker233 View Post
              Sorry to bring back an old tread but I would like to use this simple interface to write some data to the log,similar to how send status emails. The email interface allows for macro expansion so I can get a wealth of informtion into in email in a template like format. The log function doesn't do that.

              Code:
              &hs.WriteLog("Test","Hallway Temp  = $$DSR:265:")
              Just writes out the raw text. Is there something like ExpandMacros() that would allow something like this:

              Code:
              &hs.WriteLog("Test", ExpandMacros("Hallway Temp = $$DSR:265:"))
              Or even better something like this that expands macros for you:

              Code:
              &hs.WriteLogExpand("Test", "Hallway Temp = $$DSR:265:")

              It is my preference to make this a "one-liner" for ease of use within the homeseer web interface.
              Unfortunately the HS replacement variables have limited places they can be used, this is one of the places you can't use them. Because that script is essentially VB.net then you can include most .net functions. You have a couple of options but the quickest might be;

              Code:
              &hs.WriteLog("Test","Hallway Temp  = " & hs.replacevariables("$$DSR:265:"))
              hs.replacevariables is going to return the string status for that input in much the same way it would be replaced in a text to speech field.

              Comment


                #8
                I think you could also use
                &hs.WriteLog("Test","Hallway Temp = " & hs.DeviceString(265))
                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 help. This is what I settled on:


                  Code:
                  &hs.WriteLog("MyLog", hs.ReplaceVariables("status = $$DSR:143:, $$DSR:144:"))
                  This works well for me because when logging some of the data I have several varaibles that I need saved, this makes it pretty get multiple values in log with one simple line of code.

                  Comment

                  Working...
                  X