www.homeseer.com    
 

Go Back   HomeSeer Message Board > Ultilities (Plug-ins) > Utilities Discussion > SDJ-Health Plug-in (3P)

Reply
 
Thread Tools Display Modes
  #1  
Old April 14th, 2018, 07:04 PM
mminehan mminehan is online now
Seer Deluxe
 
Join Date: Jun 2011
Location: New Zealand
Posts: 349
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.423
BLOccupied:,Blue-Iris:,Device History:,DoorBird:,Yamaha:,UltraECM3:,UltraMon3:,mcsXap:,Res tart:,BLRF:,Pushover 3P:,UltraNetatmo3:,UltraM1G3:,Ultra1Wire3:,BLBackup:,Chromec ast:,Z-Wave:,Harmony Hub:,UltraRachio3
Reply With Quote
  #2  
Old April 15th, 2018, 03:12 AM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 768
Quote:
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
Reply With Quote
  #3  
Old April 15th, 2018, 05:18 AM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 768
Quote:
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
File Type: zip SDJ-Health 3-0-6-0 EXE Only.zip (55.1 KB, 3 views)
Reply With Quote
  #4  
Old April 15th, 2018, 08:02 PM
mminehan mminehan is online now
Seer Deluxe
 
Join Date: Jun 2011
Location: New Zealand
Posts: 349
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.423
BLOccupied:,Blue-Iris:,Device History:,DoorBird:,Yamaha:,UltraECM3:,UltraMon3:,mcsXap:,Res tart:,BLRF:,Pushover 3P:,UltraNetatmo3:,UltraM1G3:,Ultra1Wire3:,BLBackup:,Chromec ast:,Z-Wave:,Harmony Hub:,UltraRachio3
Reply With Quote
  #5  
Old April 16th, 2018, 01:38 AM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 768
Quote:
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.


Hi Marty,

I will look into adding a custom conversion factor to adjust these type of devices to %. It shouldn’t be too difficult but involves UI changes so is more involved. Possibly next weekend if I get some time.

Steve
Reply With Quote
  #6  
Old Today, 10:55 AM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 768
Quote:
Originally Posted by SteveMSJ View Post
Hi Marty,

I will look into adding a custom conversion factor to adjust these type of devices to %. It shouldn’t be too difficult but involves UI changes so is more involved. Possibly next weekend if I get some time.

Steve
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.

Name:  ScreenShot.jpg
Views: 7
Size:  158.2 KB

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
Attached Files
File Type: zip SDJ-Health 3-0-6-1 EXE Only.zip (56.1 KB, 1 views)
Reply With Quote
  #7  
Old Today, 02:11 PM
mminehan mminehan is online now
Seer Deluxe
 
Join Date: Jun 2011
Location: New Zealand
Posts: 349
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.423
BLOccupied:,Blue-Iris:,Device History:,DoorBird:,Yamaha:,UltraECM3:,UltraMon3:,mcsXap:,Res tart:,BLRF:,Pushover 3P:,UltraNetatmo3:,UltraM1G3:,Ultra1Wire3:,BLBackup:,Chromec ast:,Z-Wave:,Harmony Hub:,UltraRachio3
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Value ranges for Saturation and Brightness teladog01 JowiHue Plug-In 1 April 9th, 2015 05:49 PM
Monitoring 12 volt batteries acromion HomeSeer General Discussion Area 4 December 10th, 2012 11:38 AM
Trouble with light level in conditions with ranges jusitnh24 HSM100™ Multi-Sensor 5 January 21st, 2010 05:53 PM
How DeviceValuesGraphicsAdd works with value ranges juande Programming with HomeSeer 2 January 4th, 2009 09:17 PM


All times are GMT -4. The time now is 02:33 PM.


Copyright HomeSeer Technologies, LLC