User Tools

Site Tools


wiki:countnz

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:countnz [2018/07/16 06:28]
admin created
wiki:countnz [2022/07/04 08:39] (current)
admin
Line 1: Line 1:
-====== COUNTNZ() Function ======+====== COUNTNZ() Function (Count Non-Zero) ======
  
-The COUNTNZ() function can be used to get the last time variable was changed - it returns human readable time.+The COUNTNZ() function can be used to get the number of minutes value is greater than threshold value
  
 Usage: Usage:
  
-''COUNTNZ(variable, options, val)'' +''COUNTNZ(variable, options, val,[start_hour],[end_hour])'' 
  
 **variable** - the variable name to check **variable** - the variable name to check
Line 12: Line 12:
  
 **val** - optional - the threshold value to be greater than (0 is the default) **val** - optional - the threshold value to be greater than (0 is the default)
 +
 +**start_hour** - option for 'diff in range (option 5) when period is 1 day - start hour (0-23)
 +
 +**end_hour** - option for 'diff in range (option 5) when period is 1 day - end hour (0-23) - set start and end to 0 to ignore this
 +
  
 ===== Generic Variables (per device type) ===== ===== Generic Variables (per device type) =====
Line 35: Line 40:
 The second parameter, [options] is a number and can be any of the following The second parameter, [options] is a number and can be any of the following
  
-|0 | Returns //No Change// | +|1 | DAY - Number of minutes non-zero today
-|1 | DAY - Last time the variable changed during the day +|2 | WEEK - Number of minutes non-zero for the week | 
-|2 | WEEK - Last time the variable changed during the week | +|3 | MONTH - Number of minutes non-zero for during the month | 
-|3 | MONTH - Last time the variable changed during the month | +|4 | YEAR - Number of minutes non-zero for during the current year | 
-|4 | YEAR - Last time the variable changed during the current year | +|5 | PERIOD - Number of minutes non-zero for the selected range | 
-|5 | PERIOD - Last time the variable changed during the  selected range | +|6 | SLICE - Number of minutes non-zero for variable changed during the slice in the range (i.e. in a graph segment) |
-|6 | SLICE - Last time the variable changed during the slice in the range (i.e. in a graph segment) |+
  
  
Line 47: Line 51:
 Get the uptime in percent based on voltage for the day (1440 minutes per day) Get the uptime in percent based on voltage for the day (1440 minutes per day)
  
-''100*(COUNTNZ('voltage',1)/1440''+''100*(COUNTNZ('voltage',1)/1440)''
  
 Possible return values: 0 - 100 Possible return values: 0 - 100
 +
 +===== Example2 =====
 +Get the minutes the DG was running for between 6am and 6 pm (18)
 +
 +''(COUNTNZ('DG1_AC_Active_Power',5,0,6,18))''
 +
 +
 +
  
  
  
  
wiki/countnz.1531722536.txt.gz · Last modified: 2018/07/16 06:28 by admin