Announcement

Collapse
No announcement yet.

Logging HS3

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

    Logging HS3

    I have asked before but did not get any responses. Is there a way to turn off logging in HS3? I have tried the check box "do not log this device" but it only works for a few of my devices. I have 2 Aeon Energy Meters. Every day I get 7300 log entries just from these two devices. Other plugins generate thousands more lines. This is really excessive!

    Steve Q
    HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
    2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

    #2
    I don't think you can turn off logging completely as you will never control what plugins wish to put in the log. If you want to kill all device logging then this is a script I wrote to turn off all the logging from my Z-Wave devices,

    Code:
    Sub Main(ByVal Parm As Object)
    
        Try
            'run through the enumerator, remove the location two strings
    
            Dim dv As Scheduler.Classes.DeviceClass
            Dim EN As Scheduler.Classes.clsDeviceEnumeration
    
            EN = hs.GetDeviceEnumerator
    
            Do
                dv = EN.GetNext
                If dv Is Nothing Then Continue Do
    
                If dv.Interface(Nothing).ToLower = "z-wave" Then
                    hs.writelog("Log Device Stop", "Device: " & dv.Name(Nothing))
                    dv.MISC_Set(hs, Enums.dvMISC.NO_LOG)
                End If
    
            Loop Until EN.Finished
    
        Catch ex As Exception : hs.writelog("Device Clear", "Exception: " & ex.message)
        End Try
    
    End Sub
    Removing the dv.interface check would disable it for every device in the HS DB.

    Comment


      #3
      Thanks, MrHappy, where would I put this script? How is it called?

      There is a setting on the HS3 "General" settings tab that apparently turns off all logging. But I don't want everything turned off, just the verbose plugins.

      Steve Q


      Sent from my iPad using Tapatalk
      HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
      2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

      Comment


        #4
        Just run it once from an event and you can then get rid of the event, script goes in the normal place in the scripts directory. If you have stuff that is not from devices (IE the log does not say something like 'Device: Kitchen Motion Sensor Status Set to Off/Closed/No Motion') then you are probably limited in what you can do, for your Aeon energy sensors I hope that these warnings would be suppressed by the above script.

        Comment


          #5
          I use Adam's script and it works great. I have two technology interfaces that can generate a lot of traffic - Z-Wave and Arduino. Most of the time I do not need to see chatter from these devices, but occasionally I might want to see the traffic for debugging. I wanted to easily be able to turn the logging on or off on all of the devices, so I altered the script to eb able to set or clear the logging attribute and to apply to either technology. I use two virtual devices to trigger running the scripts. That way I can keep my log clear of chatter unless/until I need it. There is still the ability to enable or disable logging on a single device but the virtual devices will do a mass change on either group.

          .
          Attached Files
          HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

          Comment


            #6
            Logging HS3

            This is great! Have needed this too. Thanks Adam & Randy.

            ps- there needs to be a thread with all these hidden gems for HS. Couple weeks ago finally learned how to input a statement in the log. Good good stuff!!

            Sent from my iPhone
            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


              #7
              Randy,
              Not sure how I missed it, but how do you start the logging again. In the screen shot the only difference I saw in the script between log and no log was start, stop respectively.

              Also are z-wave errors left out of the log after the stop z-wave log srcipt is run?
              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


                #8
                Anyone know how to turn z-wave device logging back ON after this script is run. Trying to track down a problem with a device, but I'm not sure how to turn logging back so... thanks in advance.
                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


                  #9
                  Tom, change

                  dv.MISC_Set(hs, Enums.dvMISC.NO_LOG)

                  to

                  dv.MISC_Clear(hs, Enums.dvMISC.NO_LOG)

                  And it should re-enable it

                  Comment


                    #10
                    You're the best Adam!!
                    Thanks. I see this now in Randy's pics above, but couldn't tell the slight difference in the script on initial review.

                    So when log script is turned on(no logging), will z-wave errors like communication, and z-net issues show?
                    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


                      #11
                      Originally posted by TomTom View Post
                      You're the best Adam!!
                      Thanks. I see this now in Randy's pics above, but couldn't tell the slight difference in the script on initial review.

                      So when log script is turned on(no logging), will z-wave errors like communication, and z-net issues show?
                      The errors should always appear AFAIK, that script just turns off the device based logging for any device owned by the z-wave plugin (the entries like Z-Wave Device: Kitchen Motion Sensor Status Set to Off/Closed/No Motion). I don't know if I can turn on/off the logging of the error messages or where the option is for them.

                      Comment


                        #12
                        Ok great, No I just want the device stuff turned off and still want Ultra log moniter to pick up major z-wave issues. So this is perfect. THANK YOU AGAIN!
                        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


                          #13
                          Thanks for the script gents! I was messing with it yesterday and created a new version that takes two parameters (the device type followed by enable or disable) so one script can be used for multiple uses. It also checks to see the status of the no log flag and won't change devices that are already set the way you want. That way it won't put a bunch of entries in the log if you run the script again after having added new devices.

                          Code:
                          Sub Main(ByVal Parms As String)
                          'based on a script by mrhappy posted here: http://board.homeseer.com/showthread.php?t=179057
                          	
                          	Dim ParmArray() As String = Split(Parms,",")	'split parameter into an array
                          	Dim devType As String = ParmArray(0)			'the first parameter is the device type such as z-wave	
                          	Dim Enable As String = lcase(ParmArray(1))		'the second parameter is either enable or disable
                          	Dim logName As String = "Logging "				'set log type for HS log
                          	Dim Debug As Boolean = False					'set to True if the script give you errors and it will provide additional info in the HS3 log to help troubleshoot
                          
                          	Try
                          		Dim dv As Scheduler.Classes.DeviceClass
                          		Dim EN As Scheduler.Classes.clsDeviceEnumeration
                          		EN = hs.GetDeviceEnumerator
                          
                          		Do
                          			dv = EN.GetNext
                          			If dv Is Nothing Then Continue Do
                          
                          			If dv.Interface(Nothing).ToLower = devType Then
                          				If Enable = "disable" And dv.MISC_Check(hs, Enums.dvMISC.NO_LOG) = False Then
                          					dv.MISC_Set(hs, Enums.dvMISC.NO_LOG)
                          					hs.writelog(logName & "Disable ", "Device: " & dv.Location(Nothing) & " " & dv.Location2(Nothing) & " " & dv.Name(Nothing))
                          				ElseIf Enable = "enable" And dv.MISC_Check(hs, Enums.dvMISC.NO_LOG) = True Then
                          					dv.MISC_Clear(hs, Enums.dvMISC.NO_LOG)
                          					hs.writelog(logName & "Enable ", "Device: "& dv.Location(Nothing) & " " & dv.Location2(Nothing) & " " & dv.Name(Nothing))
                          				End If
                          			End If
                          
                                  Loop Until EN.Finished
                          
                          	Catch ex As Exception : If Debug Then hs.writelog(logName, "Exception: " & ex.message)
                          	End Try
                          
                          End Sub
                          Click image for larger version

Name:	Capture.jpg
Views:	1
Size:	54.2 KB
ID:	1183107

                          Cheers
                          Al
                          HS 4.2.8.0: 2134 Devices 1252 Events
                          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                          Comment


                            #14
                            Originally posted by sparkman View Post
                            Thanks for the script gents! I was messing with it yesterday and created a new version that takes two parameters (the device type followed by enable or disable) so one script can be used for multiple uses. It also checks to see the status of the no log flag and won't change devices that are already set the way you want. That way it won't put a bunch of entries in the log if you run the script again after having added new devices.

                            Code:
                            Sub Main(ByVal Parms As String)
                            'based on a script by mrhappy posted here: http://board.homeseer.com/showthread.php?t=179057
                                
                                Dim ParmArray() As String = Split(Parms,",")    'split parameter into an array
                                Dim devType As String = ParmArray(0)            'the first parameter is the device type such as z-wave    
                                Dim Enable As String = lcase(ParmArray(1))        'the second parameter is either enable or disable
                                Dim logName As String = "Logging "                'set log type for HS log
                                Dim Debug As Boolean = False                    'set to True if the script give you errors and it will provide additional info in the HS3 log to help troubleshoot
                            
                                Try
                                    Dim dv As Scheduler.Classes.DeviceClass
                                    Dim EN As Scheduler.Classes.clsDeviceEnumeration
                                    EN = hs.GetDeviceEnumerator
                            
                                    Do
                                        dv = EN.GetNext
                                        If dv Is Nothing Then Continue Do
                            
                                        If dv.Interface(Nothing).ToLower = devType Then
                                            If Enable = "disable" And dv.MISC_Check(hs, Enums.dvMISC.NO_LOG) = False Then
                                                dv.MISC_Set(hs, Enums.dvMISC.NO_LOG)
                                                hs.writelog(logName & "Disable ", "Device: " & dv.Location(Nothing) & " " & dv.Location2(Nothing) & " " & dv.Name(Nothing))
                                            ElseIf Enable = "enable" And dv.MISC_Check(hs, Enums.dvMISC.NO_LOG) = True Then
                                                dv.MISC_Clear(hs, Enums.dvMISC.NO_LOG)
                                                hs.writelog(logName & "Enable ", "Device: "& dv.Location(Nothing) & " " & dv.Location2(Nothing) & " " & dv.Name(Nothing))
                                            End If
                                        End If
                            
                                    Loop Until EN.Finished
                            
                                Catch ex As Exception : If Debug Then hs.writelog(logName, "Exception: " & ex.message)
                                End Try
                            
                            End Sub
                            [ATTACH]51789[/ATTACH]

                            Cheers
                            Al

                            Al, Thank you!! Here I am doing searches for this exact thing to build it myself and it's already been done. The users on this forum are amazing.

                            Thanks Again.

                            Comment


                              #15
                              Originally posted by waynehead99 View Post
                              Al, Thank you!! Here I am doing searches for this exact thing to build it myself and it's already been done. The users on this forum are amazing.

                              Thanks Again.
                              You're welcome, but most of the credit goes to Adam!

                              Cheers
                              Al
                              HS 4.2.8.0: 2134 Devices 1252 Events
                              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                              Comment

                              Working...
                              X