Announcement

Collapse
No announcement yet.

How to log less frequently

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

    How to log less frequently

    Hello, I have a DHT sensor connected to my HS wich gives me readings several times per minute. I want to log these readings, but it is way to frequent.

    Any idea on how i can log it every 15 minutes? I tried to create another virtual "logging" device and an event that would write the value from the dht every 15 minutes, but I cant get the event to do this.

    Any ideas?

    Whitenoise

    #2
    Originally posted by Whitenoise View Post
    Hello, I have a DHT sensor connected to my HS wich gives me readings several times per minute. I want to log these readings, but it is way to frequent.

    Any idea on how i can log it every 15 minutes? I tried to create another virtual "logging" device and an event that would write the value from the dht every 15 minutes, but I cant get the event to do this.

    Any ideas?

    Whitenoise
    Try this for your event. Substitute your device reference for the 4822. You don't need an intermediate virtual device.

    Click image for larger version

Name:	Screenshot 2021-07-02 072214.png
Views:	204
Size:	22.5 KB
ID:	1482120
    -Wade

    Comment


      #3
      Hello Wade, thank you for you answer. I dont have "Execute the command" as an option in the "action" menu. I only have Run a Script or a command.

      WHere do i put in the "Then" argument?

      Thank you secerely

      Whitenoise

      Comment


        #4
        Originally posted by Whitenoise View Post
        Hello Wade, thank you for you answer. I dont have "Execute the command" as an option in the "action" menu. I only have Run a Script or a command.

        WHere do i put in the "Then" argument?

        Thank you secerely

        Whitenoise
        In HS4:

        1. Add an action ("+")
        2. Action: Run a Script or Script Command
        3. New Script: (insert the writelog command)
        4. Check the box "Immediate Command"
        5. Save.
        -Wade

        Comment


          #5
          Hello again, thank you for your help. It now looks like this:
          Click image for larger version

Name:	Capture.PNG
Views:	212
Size:	166.0 KB
ID:	1482139

          I get no values in the log however. You sure i dont need to define the "Test" as a virtual device?

          Whitenoise

          Comment


            #6
            Originally posted by Whitenoise View Post
            Hello again, thank you for your help. It now looks like this:
            Click image for larger version

Name:	Capture.PNG
Views:	212
Size:	166.0 KB
ID:	1482139

            I get no values in the log however. You sure i dont need to define the "Test" as a virtual device?

            Whitenoise
            "Test" can be any text you wish. It's the "Type" field in the log.

            I see a couple possible issues with your syntax. L in WriteLog is lower case, no space after & before hs.DeviceValue... Here's the working command you can cut/paste to test.
            Code:
            &nhs.WriteLog("AnyText", "Device value is " & hs.DeviceValue(4822).ToString())
            -Wade

            Comment


              #7
              I dont understand what I'm doing wrong here. The device has the following settings:

              Click image for larger version

Name:	m5temp.PNG
Views:	210
Size:	244.7 KB
ID:	1482163

              And the event:

              Click image for larger version

Name:	m5event.PNG
Views:	198
Size:	86.3 KB
ID:	1482164

              Still I get nothing in the log. Thank you for you patience and help.

              Cheers

              Whitenoise

              Comment


                #8
                Sorry, It might be the capital L. My bad

                Comment


                  #9
                  Is Auto-update checked on your log page? I don't have any other ideas. If your syntax were wrong you should be seeing scripting errors in the log. There may be some other global log setting that I'm not thinking of. Maybe check Setup. If none of that helps, hopefully someone else will jump in with suggestions.
                  -Wade

                  Comment


                    #10
                    It was not, I stil get no posts in the log from this.

                    Comment


                      #11
                      Thank you anyway. I will research some more.

                      Whitenoise

                      Comment


                        #12
                        I assume there are no errors in the log.
                        What happens if you run the event with the event run icon?

                        How about trying something simpler:
                        &hs.WriteLog "AnyText",hs.DeviceValue(144)
                        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


                          #13
                          That is correct, there are no errors in log, only spam from a Z-wave node. I even tried this:
                          &hs.WriteLog "Test", "This is a test log entry"

                          And i tried to run it, but nothing in the log. It must be some setting I dont know of...

                          Cheers

                          Whitenoise

                          Click image for larger version

Name:	event.PNG
Views:	189
Size:	207.0 KB
ID:	1482315

                          Comment


                            #14
                            You are running HS4. I have understood that writelog is no longer working as immediate command. You would need to change it to &hs.writelogex("Test", "This is a test log entry". "")
                            Watch the extra parameter. It can be an empty string or a color hex code to color the logline.

                            Wim
                            -- Wim

                            Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                            1210 devices/features ---- 392 events ----- 40 scripts

                            Comment


                              #15
                              Originally posted by w.vuyk View Post
                              I have understood that writelog is no longer working as immediate command. You would need to change it to &hs.writelogex("Test", "This is a test log entry". "")
                              WOW!!

                              Just Wow.

                              Any explanation for why?
                              Is this a bug or is it deliberate?
                              Is anyone keeping a list of the traps the have been set in HS4 for the unsuspecting?

                              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

                              Working...
                              X