Battery Level and N...
 
Notifications
Clear all

Battery Level and No Battery Present

2 Posts
2 Users
0 Likes
318 Views
(@Anonymous)
New Member Guest
Joined: 1 second ago
Posts: 0
Topic starter  

Hi

Ive been using DI for many years its great but the customer wants the battery level to show orange when at 30% and red at 10%, ive tried searching the forums and came up[ with this but doesn't work.

Also when there is no battery it shows <n/a> instead of the text. "Not Installed"

Here is the code, what do I need to add or change to do what I need. Many Thanks

 

# battery status lookup table
set=key:battery1,value:Disconnected
set=key:battery2,value:Connected
set=key:battery3,value:Fully Charged
set=key:battery<null>,value:Not Installed

HOST=active:1,interval:0,color:ffffff,style:b,text:HOST:
USER=active:1,interval:0,color:ffffff,style:b,text:USER:

WMI=interval:05,color:ffffff,style:b,text:BATT:,threshold1:15 -20 %red%,namespace:root\cimv2,query:Win32_Battery,display:%EstimatedChargeRemaining%% (%battery%BatteryStatus%%)


   
Quote
Glenn
(@glenn)
Member Admin
Joined: 6 years ago
Posts: 1192
 

Posted by: @Anonymous

Hi

Ive been using DI for many years its great but the customer wants the battery level to show orange when at 30% and red at 10%, ive tried searching the forums and came up[ with this but doesn't work.

Also when there is no battery it shows <n/a> instead of the text. "Not Installed"

Here is the code, what do I need to add or change to do what I need. Many Thanks

 

# battery status lookup table
set=key:battery1,value:Disconnected
set=key:battery2,value:Connected
set=key:battery3,value:Fully Charged
set=key:battery<null>,value:Not Installed

HOST=active:1,interval:0,color:ffffff,style:b,text:HOST:
USER=active:1,interval:0,color:ffffff,style:b,text:USER:

WMI=interval:05,color:ffffff,style:b,text:BATT:,threshold1:15 -20 %red%,namespace:root\cimv2,query:Win32_Battery,display:%EstimatedChargeRemaining%% (%battery%BatteryStatus%%)

that's an old configuration. the threshold option is no longer used. check the manual for item alarms.  you might have something like this:

 

alarms:(%15 le 30 %orange%) (%15 le 10 %red%)

<n/a> is the default text when an item returns no results, as in there is no battery. In the next release I've added a common option called "no-result" where you can set a message specifically for the item when there are no results.

 


   
ReplyQuote
Glenn's Page