Announcement

Collapse
No announcement yet.

Check devices script

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

  • Check devices script

    Hi,
    someone created this script that I'm trying to modify to include the device type. Unfortunately writing a script is not my forte' and for some reason, it is not including those types. I also would like to exclude from the device list I selected some of those devices that the date does not update, I do not have any idea on how to do that! I'm trying to use this script to check for devices that does not update and I may miss, this includes devices with batteries and not.

    Thanks
    Attached Files

  • #2
    So is the issue that this line is not including the correct devices? Or are no devices returned?

    Code:
             If (dv.Interface(Nothing).ToLower = Plugin Or Plugin = "all") And (dv.Location(Nothing).ToLower = Location Or Location = "all") And (dv.Location2(Nothing).ToLower = Location2 Or Location2 = "all") And (dv.device_type_string(Nothing).ToLower = DeviceTString Or DeviceTString = "all") And dv.Status_Support(Nothing) = Not(Battery) And dv.Relationship(Nothing) < 5 Then
    To help troubleshoot, I would write all devices to the log and include the plugin, location, location2, device type string, status and relationship information. Also, this does not filter out any devices as valid values are 0-4:

    Code:
    dv.Relationship(Nothing) < 5
    HS 3.0.0.548: 1990 Devices 1172 Events
    Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

    Comment


    • #3
      Originally posted by sparkman View Post
      So is the issue that this line is not including the correct devices? Or are no devices returned?

      Code:
       If (dv.Interface(Nothing).ToLower = Plugin Or Plugin = "all") And (dv.Location(Nothing).ToLower = Location Or Location = "all") And (dv.Location2(Nothing).ToLower = Location2 Or Location2 = "all") And (dv.device_type_string(Nothing).ToLower = DeviceTString Or DeviceTString = "all") And dv.Status_Support(Nothing) = Not(Battery) And dv.Relationship(Nothing) < 5 Then
      To help troubleshoot, I would write all devices to the log and include the plugin, location, location2, device type string, status and relationship information. Also, this does not filter out any devices as valid values are 0-4:

      Code:
      dv.Relationship(Nothing) < 5
      As always, thanks Sparkman.
      I modified this line to include dv.device_type_string(Nothing).ToLower. When I search for all, 1400, all, all, Insteon motion sensor, false (I go by memory here) it does not return anything, while if I search for the plugin name Insteon or any other value, it will return those.
      I was wondering what this mean and I still do not, what is the value 0-4 comes from? I changed to 5 thinking that it was due to how many parms I included.

      Comment


      • #4
        The dv.relationship values are for parent/child relationships. The values are explained here: https://help.homeseer.com/help/HS3/s...ootchildstatus

        I tried the script and it worked for me. Perhaps the combination of values that you are using as criteria really don't return any matches. Post the exact script parameters that you are using along with a screenshot of the advanced tab of one of the devices that you are expecting to be included as that may provide a clue as to what the issue is.
        HS 3.0.0.548: 1990 Devices 1172 Events
        Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

        Comment


        • #5
          Hi Sparkman,
          This is what I'm running
          all,1000,all,all,Insteon Motion Sensor Battery Level,False. I have no result when I run this script with the following parm.

          Thanks,
          Aldo

          Attached Files

          Comment


          • #6
            Can you post a screenshot of one of those devices’ advanced tab?
            HS 3.0.0.548: 1990 Devices 1172 Events
            Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

            Comment


            • #7
              Also, if you change the last parameter to True do you get any results then?
              HS 3.0.0.548: 1990 Devices 1172 Events
              Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

              Comment


              • #8
                Interesting by changing it to True I get all the devices.
                Attached Files

                Comment


                • #9
                  That make sense as the script inverts it:

                  Code:
                      dim Battery As Boolean = CBool(ParmArray(5))        'specify whether to check battery (True) (non status) devices or non-battery (False).
                  Code:
                  And dv.Status_Support(Nothing) = Not(Battery)
                  HS 3.0.0.548: 1990 Devices 1172 Events
                  Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                  Comment


                  • #10
                    sorry to be a bother but this script has a mind of his own. I tried few more things but is not working right. As you can see using these parms all,9600,all,all,Insteon Motion Sensor Occupancy Sensor,False, it does not get the last device from the picture. It should have since it was more than one day. I tried true or false with the same results.
                    Attached Files

                    Comment


                    • #11
                      9600 = 9600 minutes which is about 6.7 days.
                      HS 3.0.0.548: 1990 Devices 1172 Events
                      Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                      Comment


                      • #12
                        Any number there does not make any difference, it still return no records. Do not worry, I will try to figure it out.

                        Sent from my SM-G935V using Tapatalk

                        Comment


                        • #13
                          Originally posted by aldo View Post
                          Any number there does not make any difference, it still return no records. Do not worry, I will try to figure it out.

                          Sent from my SM-G935V using Tapatalk
                          There must be something a bit different about the device. I played with it a bit today and seems to work properly for me in the scenarios that I tested.
                          HS 3.0.0.548: 1990 Devices 1172 Events
                          Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                          Comment


                          • #14
                            Very much appreciated. I did several testing yesterday but the same conclusion, do you think it is the time that is not working properly?.

                            Thanks again for putting so much time into it.

                            Aldo

                            Sent from my SM-G935V using Tapatalk

                            Comment


                            • #15
                              Since most likely we have the same device types, could you send me your parms so I can check if with the same devices you have it will run.
                              Thanks

                              Sent from my SM-G935V using Tapatalk

                              Comment

                              Working...
                              X