Announcement

Collapse
No announcement yet.

ERROR - Finding battery devices. An item with the same key has already been added.

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

    ERROR - Finding battery devices. An item with the same key has already been added.

    Aug-15 3:06:41 PM SDJ-Health Activity Checking stopped.
    Aug-15 3:05:51 PM SDJ-Health Polling devices stopped.
    Aug-15 3:05:48 PM SDJ-Health ERROR - Finding battery devices. An item with the same key has already been added.
    I get this in my log every time I visit the configuration page. I don't seem to get any new devices available for monitoring either.

    Any help would be great.

    Jason

    #2
    Originally posted by jrhubott View Post
    Aug-15 3:06:41 PM SDJ-Health Activity Checking stopped.
    Aug-15 3:05:51 PM SDJ-Health Polling devices stopped.
    Aug-15 3:05:48 PM SDJ-Health ERROR - Finding battery devices. An item with the same key has already been added.
    I get this in my log every time I visit the configuration page. I don't seem to get any new devices available for monitoring either.

    Any help would be great.

    Jason
    Hi Jason,
    I will have a look at this tonight hopefully.
    In the meantime can you let me know the plugin version you are running. Also is this a new installation or have you been using the plugin ok for a while and this is a new error?

    If you have a chance change the LogLevel to 2 (debugging) then exit and reenter the Config page and extract the SDJ-Health messages from the log.

    Steve

    P.S. Having looked into this a bit further, one possibility for this error would be a root device with more than one battery child. Not something I would expect. However, if you can capture the log with DebugLevel set to 2 I should be able to pin down the problem
    Last edited by SteveMSJ; August 16, 2018, 01:05 PM. Reason: PS added.

    Comment


      #3
      From the log:
      Aug-17 10:30:21 AM SDJ-Health ERROR - Finding battery devices. An item with the same key has already been added.
      Aug-17 10:30:21 AM SDJ-Health Debug - BDRef #4530 RDRef #4528 Not Pollable Insteon Added.
      Aug-17 10:30:21 AM SDJ-Health Debug - BDRef #1461 RDRef #1460 Pollable Z-Wave Added.

      Device a Insteon motion sensor. It has the following nodes:
      4528 Motion Sensor - Occupancy Sensor Motion Courtyard - 8/17/2018 9:35:35 AM 37.B8.B6:1 0
      4529 Motion Sensor - Dusk/Dawn Sensor Motion Courtyard - 8/17/2018 6:32:03 AM 37.B8.B6:2 0
      4530 Motion Sensor - Low Battery Warning Motion Courtyard - 12:00:00 AM 37.B8.B6:3 0
      4531 Motion Sensor - Heartbeat Motion Courtyard - 8/17/2018 12:50:41 AM 37.B8.B6:4 0
      4532 Motion Sensor - Battery Level Motion Courtyard - 4/26/2018 12:08:06 PM 37.B8.B6:5 9
      I assume the problem has something to do with the multiple battery indications from the device.

      Comment


        #4
        Originally posted by jrhubott View Post
        From the log:
        Aug-17 10:30:21 AM SDJ-Health ERROR - Finding battery devices. An item with the same key has already been added.
        Aug-17 10:30:21 AM SDJ-Health Debug - BDRef #4530 RDRef #4528 Not Pollable Insteon Added.
        Aug-17 10:30:21 AM SDJ-Health Debug - BDRef #1461 RDRef #1460 Pollable Z-Wave Added.

        Device a Insteon motion sensor. It has the following nodes:
        4528 Motion Sensor - Occupancy Sensor Motion Courtyard - 8/17/2018 9:35:35 AM 37.B8.B6:1 0
        4529 Motion Sensor - Dusk/Dawn Sensor Motion Courtyard - 8/17/2018 6:32:03 AM 37.B8.B6:2 0
        4530 Motion Sensor - Low Battery Warning Motion Courtyard - 12:00:00 AM 37.B8.B6:3 0
        4531 Motion Sensor - Heartbeat Motion Courtyard - 8/17/2018 12:50:41 AM 37.B8.B6:4 0
        4532 Motion Sensor - Battery Level Motion Courtyard - 4/26/2018 12:08:06 PM 37.B8.B6:5 9
        I assume the problem has something to do with the multiple battery indications from the device.
        Yes. Can you post screenshots of the advanced tab for devices 4530 and 4532.

        Steve

        Comment


          #5
          Reference ID 4530
          Technology Address 37.B8.B6:3
          Status 0 = OFF
          Value 0 = "Off"
          String
          Supports Status False
          Dimmable False
          Interface Insteon
          Extra Data Store 0 Named entries, 0 UnNamed entries.
          Device Type Internal Plug-In API, Type: Plug-In Type 4, SubType:
          Device Type (String)
          Misc Settings Show Values, Generate Voice Command, SET_DOES_NOT_CHANGE_LAST_CHANGE
          Device Image File images\Devices\Image-Not-Selected.png
          Thumbnail Image File images\Devices\Image-Not-Selected_small.png
          Relationship Status Child
          Associated Devices Motion Courtyard Motion Sensor - Occupancy Sensor
          Reference ID 4532
          Technology Address 37.B8.B6:5
          Status 9 = Dim
          Value 9
          String 9.0
          Supports Status False
          Dimmable False
          Interface Insteon
          Extra Data Store 0 Named entries, 0 UnNamed entries.
          Device Type Internal Plug-In API, Type: Plug-In Type 4, SubType:
          Device Type (String)
          Misc Settings Status Only, Generate Voice Command, SET_DOES_NOT_CHANGE_LAST_CHANGE
          Device Image File images\Devices\Image-Not-Selected.png
          Thumbnail Image File images\Devices\Image-Not-Selected_small.png
          Relationship Status Child
          Associated Devices Motion Courtyard Motion Sensor - Occupancy Sensor
          Hope this helps. Thanks for looking into this.

          Jason

          Comment


            #6
            Originally posted by jrhubott View Post
            Reference ID 4530
            Technology Address 37.B8.B6:3
            Status 0 = OFF
            Value 0 = "Off"
            String
            Supports Status False
            Dimmable False
            Interface Insteon
            Extra Data Store 0 Named entries, 0 UnNamed entries.
            Device Type Internal Plug-In API, Type: Plug-In Type 4, SubType:
            Device Type (String)
            Misc Settings Show Values, Generate Voice Command, SET_DOES_NOT_CHANGE_LAST_CHANGE
            Device Image File images\Devices\Image-Not-Selected.png
            Thumbnail Image File images\Devices\Image-Not-Selected_small.png
            Relationship Status Child
            Associated Devices Motion Courtyard Motion Sensor - Occupancy Sensor
            Reference ID 4532
            Technology Address 37.B8.B6:5
            Status 9 = Dim
            Value 9
            String 9.0
            Supports Status False
            Dimmable False
            Interface Insteon
            Extra Data Store 0 Named entries, 0 UnNamed entries.
            Device Type Internal Plug-In API, Type: Plug-In Type 4, SubType:
            Device Type (String)
            Misc Settings Status Only, Generate Voice Command, SET_DOES_NOT_CHANGE_LAST_CHANGE
            Device Image File images\Devices\Image-Not-Selected.png
            Thumbnail Image File images\Devices\Image-Not-Selected_small.png
            Relationship Status Child
            Associated Devices Motion Courtyard Motion Sensor - Occupancy Sensor
            Hope this helps. Thanks for looking into this.

            Jason
            Hi Jason,

            Actually I'm more confused now. The plugin looks for "battery" in the Device Type (String) of child devices. According to your debug log it has identified device #4530 as a battery child and added its Parent device to the list, but according to your printout of the data for #4530 the Device Type (String) is blank. I don't see how that happens.

            The error will have occurred when it has identified #4532 as a battery child (again I don't understand as the string is blank) and tried to add the same Parent to the list.

            As far as I am aware I haven't had anyone try Insteon devices with the plugin and if the insteon plugin doesn't set the Device Type (String) they shouldn't appear in the list.
            I'm not sure how you have copied the advanced tab data into your post but can you confirm that when you look at the Advanced tab on your display the Device Type (String) is blank for these devices? Perhaps you could post a screenshot rather than a copy and paste. The string is in a text box so perhaps doesn't copy like the rest of the values.

            I would like to adapt the plugin to work with Insteon devices so if you are prepared to work with me on this that would be very helpful.

            Steve

            Comment


              #7
              You were correct. The cut and paste lost the info. See screenshots. Both devices contain battery in the type.

              I would be more then willing to work with you. I have both Insteon and ZWave battery devices in my network.

              I haven't been able to get my ZWave door locks detected yet. I will post the battery information for one of them later.

              Click image for larger version  Name:	4532.png Views:	1 Size:	252.4 KB ID:	1241832
              Attached Files
              Last edited by jrhubott; August 17, 2018, 06:21 PM.

              Comment


                #8
                ZWave lock that is never detected.

                Click image for larger version

Name:	569.png
Views:	90
Size:	214.0 KB
ID:	1241847

                Comment


                  #9
                  Originally posted by jrhubott View Post
                  You were correct. The cut and paste lost the info. See screenshots. Both devices contain battery in the type.

                  I would be more then willing to work with you. I have both Insteon and ZWave battery devices in my network.
                  OK Jason that's great information. I will post an update later for you to test.

                  Steve

                  Comment


                    #10
                    Originally posted by SteveMSJ View Post

                    OK Jason that's great information. I will post an update later for you to test.

                    Steve
                    Jason,

                    Can you test the version attached to this message. You need to shut down the plug-in then overwrite the HSPI_SDJHealth.exe file in the HS3 root directory with the version extracted from the zip file, then restart the plug-in. You should see in the log 'Version 3.0.6.5 Initialized'.

                    I have modified the behaviour so that the correct battery level child is used from each Insteon battery device. There should now not be an error in the log when you open the Config page and your Insteon battery devices should appear in the list of devices that can be Activity Monitored. You should also find that the pollable list has your Z-Wave locks which were missing previously because the list was being truncated due to the error with the Insteon double childs.

                    I don't have any Insteon devices so I have tested, as best I can, by creating a group of virtual devices to mimic an Insteon device. Let me know how it goes.

                    This should enable the ability to use Activity Monitoring for the Insteon devices. The purpose of this is that the plug-in will alert you if the batteries die, irrespective of the reported level. This should work fine as long as at least one child of a device is updating at regular intervals. I presume the Heartbeat child's Last Change Time is regularly changing.

                    As far as battery level monitoring goes, what range does the Insteon battery level cover? I notice the value of the device you posted is 9.0. Is the range from 0 to 10? If so you can set a custom factor of 10.0, on the SDJ-Health tab of each monitoring child, to change the plug-in reported range to 0-100%. If this is typical for Insteon devices I could set the plug-in to preset the factor to 10.0 for new monitoring devices where it is monitoring an Insteon device. However, maybe this represents a battery voltage rather than percentage charge so let me know on this.

                    I would also like to know more about how the Heartbeat device works because it might be possible, and better, for the plug-in to use the Heartbeat Monitoring method rather than the Activity Monitoring method to detect battery death. What value does the Heartbeat show. Does this change every time a Heartbeat is received or does just the Last Change time get updated? One problem in HS is that the Callbacks to a plug-in are only sent when a device value changes so, whilst an event can trigger on a device being Set as well as Changed, a plug-in only knows when a device value changes.

                    Steve

                    Comment


                      #11
                      This version looks good. The default insteon range appears to be 0-10 for all of my insteon battery devices.

                      The heartbeat device appears to only update the last change time as the status never changes from off from what I can tell. I will set a event on a heartbeat and see if it ever triggers to a value other then 0.

                      Some insteon battery devices only have a heartbeat device and no battery level. Could these also be monitored by your plugin? The water leak sensor is one of these.

                      Comment


                        #12
                        Originally posted by jrhubott View Post
                        Some insteon battery devices only have a heartbeat device and no battery level. Could these also be monitored by your plugin? The water leak sensor is one of these.
                        If it has the Heartbeat device and a root parent device then you can, although it's a little fiddly. I do it for an X10 motion sensor that I still use outside. I have considered automating the process within the plug-in but never got round to it.

                        What you need to do is:
                        • Create a virtual device to represent the battery.
                        • Go to the Advanced tab of the virtual device and enter "Battery" in the Device Type (string) text box (no quotes)
                        • Use Jon00's device grouping utility to set the relationship of the new Virtual Battery Device so it is in the group for the device you want to monitor. For the 'Select Parent Root Device' select the existing Parent/Root device of the group, for the 'Select Child Devices' just select the new Virtual Battery Device as any other devices will stay in the group. Check that the virtual device shows grouped with the others on the HS Device Management page.
                        The device should now appear in the list of Devices for Activity Monitoring so you can select it and a health monitoring child will be created after the refresh interval. The battery level will show whatever value you have set the virtual device to, probably 0 unless you change it. From the SDJ-Health tab of the monitoring child device turn off 'Alert on Battery Levels' as they are obviously meaningless (remember to click the Save button).

                        The plug-in will monitor all the devices in the group for activity at the MonitorActivity interval and the Health Root will alert if the device stops updating. You can also set the battery change date and battery life if you want to be alerted when the batteries reach a certain age.

                        Any problems let me know.

                        Steve

                        Comment


                          #13
                          Originally posted by SteveMSJ View Post

                          If it has the Heartbeat device and a root parent device then you can, although it's a little fiddly. I do it for an X10 motion sensor that I still use outside. I have considered automating the process within the plug-in but never got round to it.

                          What you need to do is:
                          • Create a virtual device to represent the battery.
                          • Go to the Advanced tab of the virtual device and enter "Battery" in the Device Type (string) text box (no quotes)
                          • Use Jon00's device grouping utility to set the relationship of the new Virtual Battery Device so it is in the group for the device you want to monitor. For the 'Select Parent Root Device' select the existing Parent/Root device of the group, for the 'Select Child Devices' just select the new Virtual Battery Device as any other devices will stay in the group. Check that the virtual device shows grouped with the others on the HS Device Management page.
                          The device should now appear in the list of Devices for Activity Monitoring so you can select it and a health monitoring child will be created after the refresh interval. The battery level will show whatever value you have set the virtual device to, probably 0 unless you change it. From the SDJ-Health tab of the monitoring child device turn off 'Alert on Battery Levels' as they are obviously meaningless (remember to click the Save button).

                          The plug-in will monitor all the devices in the group for activity at the MonitorActivity interval and the Health Root will alert if the device stops updating. You can also set the battery change date and battery life if you want to be alerted when the batteries reach a certain age.

                          Any problems let me know.

                          Steve
                          Actually thinking more about this you probably don’t need to create a virtual device to represent the battery. If you go on the advanced tab of the Heartbeat child and add the word Battery to the Device Type (string) the plug-in will pick that up as the battery child. It is possible that it might affect the Insteon plug-in operation but you could try it and see if the Heartbeat device continues to update ok. If it doesn’t then just change the Device Type (string) back to whatever it was before.

                          Steve

                          Comment


                            #14
                            Thanks, That worked perfect for the device.

                            Jason

                            Comment

                            Working...
                            X