Announcement

Collapse
No announcement yet.

Monitoring batteries with different value ranges

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

    Monitoring batteries with different value ranges

    I have a few devices with batteries that use a different value range (0 to 10000 as opposed to 0 to 100). UltraJones's Netatmo weather station plugin is an example.

    Does your plugin get the 'status' value or 'value' value?

    Here's the advanced tab from the Netatmo battery device:

    Reference ID 2180
    Technology Address 03:00:00:04:5d:ac-Battery-Indoor
    Status 5772 = Unknown
    Value 5772 = "High"
    String
    Supports Status False
    Dimmable False
    Interface UltraNetatmo3
    Extra Data Store 0 Named entries, 0 UnNamed entries.
    Device Type Internal Plug-In API, Type: Plug-In Root Device, SubType:
    Device Type (String)
    Netatmo Battery-Indoor
    Misc Settings 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 Netatmo UltraNetatmo3 Plugin 48SBC [Master Bedroom]


    The SDJ-Health device is reporting this as:
    48SBC [Master Bedroom]
    Last Good Check: 15/04/2018 10:21 AM
    Battery Level: 0% (<=20)
    Battery Rate: 0.0% per day
    Battery Life: 0 days
    Status: Low Battery


    Is that because the status is out of range for the plugin (i.e. >100)? Or because the value contains the word "High"?

    Perhaps I could create a new virtual device that converts the 0 to 10000 to a range of 0 to 100 and associated that as a child device. Would this then allow your plugin to monitor the battery status correctly?

    Thanks for your help. Marty.
    iCore5 Win 10 Pro x64 SSD

    HS3 Pro Edition 3.0.0.435 Windows

    BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

    #2
    Originally posted by mminehan View Post
    I have a few devices with batteries that use a different value range (0 to 10000 as opposed to 0 to 100). UltraJones's Netatmo weather station plugin is an example.

    Does your plugin get the 'status' value or 'value' value?

    Here's the advanced tab from the Netatmo battery device:

    Reference ID 2180
    Technology Address 03:00:00:04:5d:ac-Battery-Indoor
    Status 5772 = Unknown
    Value 5772 = "High"
    String
    Supports Status False
    Dimmable False
    Interface UltraNetatmo3
    Extra Data Store 0 Named entries, 0 UnNamed entries.
    Device Type Internal Plug-In API, Type: Plug-In Root Device, SubType:
    Device Type (String)
    Netatmo Battery-Indoor
    Misc Settings 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 Netatmo UltraNetatmo3 Plugin 48SBC [Master Bedroom]


    The SDJ-Health device is reporting this as:
    48SBC [Master Bedroom]
    Last Good Check: 15/04/2018 10:21 AM
    Battery Level: 0% (<=20)
    Battery Rate: 0.0% per day
    Battery Life: 0 days
    Status: Low Battery


    Is that because the status is out of range for the plugin (i.e. >100)? Or because the value contains the word "High"?

    Perhaps I could create a new virtual device that converts the 0 to 10000 to a range of 0 to 100 and associated that as a child device. Would this then allow your plugin to monitor the battery status correctly?

    Thanks for your help. Marty.
    Hi Marty,

    The plugin does use the value but I had (wrongly) expected these to be percentages as that is what all the devices I have come across use.
    Some ZWave devices, when low, jump to a value of 255 which represents 'Battery Low Warning'. The plugin currently treats any value greater than 100 as 0 so that the Battery Low Warning value doesn't mess up the rate calculation or the detection of batteries being replaced.

    I can see that I need to make it a little more intelligent so that it can cope with a greater value range. I will have a quick look at altering the way it works so that I can allow values greater than 100 unless they represent the 'Battery Low Warning' status. I will shortly post a version for you to try. The slight issue will be that it will display the value as 5772%.

    Ultimately I might be able to add a user configurable conversion factor for individual devices to convert the value to the true percentage, but that will be more work and might not be for a while.

    Steve

    Comment


      #3
      Originally posted by SteveMSJ View Post
      Hi Marty,

      The plugin does use the value but I had (wrongly) expected these to be percentages as that is what all the devices I have come across use.
      Some ZWave devices, when low, jump to a value of 255 which represents 'Battery Low Warning'. The plugin currently treats any value greater than 100 as 0 so that the Battery Low Warning value doesn't mess up the rate calculation or the detection of batteries being replaced.

      I can see that I need to make it a little more intelligent so that it can cope with a greater value range. I will have a quick look at altering the way it works so that I can allow values greater than 100 unless they represent the 'Battery Low Warning' status. I will shortly post a version for you to try. The slight issue will be that it will display the value as 5772%.

      Ultimately I might be able to add a user configurable conversion factor for individual devices to convert the value to the true percentage, but that will be more work and might not be for a while.

      Steve
      Marty,

      Can you test the version attached to this message which should work with your higher range devices, although not a true percentage.

      It seems HS doesn't allow me to post beta updates without publishing at least one paid plugin so you will need to do this manually. Just disable the plugin from the Plug-ins/manage page, copy the exe file from the attached zip file over the existing in the HS3 root folder and then re-enable the plugin. The plug-in will still show version 3.0.5.9 in the interface (unless you restart HS3) but in the log you should see 'Version 3.0.6.0 initialized."

      Let me know if it works for you.

      Steve
      Attached Files

      Comment


        #4
        Hi Steve,
        That did the trick as you predicted. The values are in the order of 5769% etc.
        I'm thinking though that I might make some virtual devices and run script to populate them with appropriate values (0-100%). With the current setup (version 3.0.6.0) the actual battery level would have to be less 0.2% to get a value of 20% in the plugin.

        I tried setting the low value trigger to 2000% (as opposed to 20%) on the SDJ device, but is maxes out at 100%.

        If you are thinking of adding some sort of custom conversion factor then I will forgo the virtual device route.

        Thanks for working on this.

        Marty.
        iCore5 Win 10 Pro x64 SSD

        HS3 Pro Edition 3.0.0.435 Windows

        BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

        Comment


          #5
          Originally posted by mminehan View Post
          Hi Steve,
          That did the trick as you predicted. The values are in the order of 5769% etc.
          I'm thinking though that I might make some virtual devices and run script to populate them with appropriate values (0-100%). With the current setup (version 3.0.6.0) the actual battery level would have to be less 0.2% to get a value of 20% in the plugin.

          I tried setting the low value trigger to 2000% (as opposed to 20%) on the SDJ device, but is maxes out at 100%.

          If you are thinking of adding some sort of custom conversion factor then I will forgo the virtual device route.

          Thanks for working on this.

          Marty.

          Comment


            #6
            Marty,

            Could you try version 3.0.6.1 attached to this message. It is just the exe file which you need to replace the existing one with in the HS3 root folder. I suggest you close down HS3 and do a full backup before replacing the plugin exe file and restarting. I don't expect a serious problem but it does update all the plug-ins devices because of the additional conversion factor parameter.

            I have added a BatteryFactor conversion parameter which can be set globally (on the Cofig page) but more usefully can be set for individual devices on the SDJ-Health tab of each monitoring device.

            Click image for larger version

Name:	ScreenShot.jpg
Views:	1
Size:	158.2 KB
ID:	1196455

            In your case if the reported battery levels for the device go up to 10000 then set the BatteryFactor to 0.01 which will convert them so that the range is 0-100%. Remember to click Save after changing the value.

            Let me know if this works for you.

            Steve

            Comment


              #7
              You are a super star. Works like a charm. Now my SDJ Netatmo devices are reporting battery levels in the 0-100%. Sent you a donaion.

              Cheers, Marty.
              iCore5 Win 10 Pro x64 SSD

              HS3 Pro Edition 3.0.0.435 Windows

              BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

              Comment


                #8
                Originally posted by mminehan View Post
                You are a super star. Works like a charm. Now my SDJ Netatmo devices are reporting battery levels in the 0-100%. Sent you a donaion.



                Cheers, Marty.


                Glad it works for you and thanks.
                Steve

                Comment

                Working...
                X