luci-app-statistics: Voltage graphs - AC and DC
authorbobmseagithub <bobmseagithub@squakmt.com>
Thu, 20 Jul 2017 18:47:57 +0000 (11:47 -0700)
committerguidosarducci <guidosarducci@users.noreply.github.com>
Fri, 30 Mar 2018 03:44:22 +0000 (20:44 -0700)
The Voltage graph combines Battery, Input Voltage and Output Voltage.
The Y-Axis scale masks changes in Input/Output voltages over time.
This patch splits the graphs into 2 graphs.
This makes it possible to see variations in AC Input/Output voltages.

Signed-off-by: Bob Meizlik <bobmseagithub@squakmt.com>
(cherry picked from commit 2145b7b33bbc4c142b243ac032e6e9c1c28ca835)

applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua

index 04eee93..2a8acee 100644 (file)
@@ -5,18 +5,34 @@ module("luci.statistics.rrdtool.definitions.apcups",package.seeall)
 
 function rrdargs( graph, plugin, plugin_instance, dtype )
 
+       local voltagesdc = {
+               title = "%H: Voltages on APC UPS - Battery",
+               vlabel = "Volts DC",
+    alt_autoscale = true,
+               number_format = "%5.1lfV",
+               data = {
+                       instances = {
+                               voltage = { "battery" }
+                       },
+
+                       options = { 
+                               voltage = { title = "Battery voltage", noarea=true }
+                       }
+               }
+       }
+       
        local voltages = {
-               title = "%H: Voltages on APC UPS ",
-               vlabel = "V",
+               title = "%H: Voltages on APC UPS - AC",
+               vlabel = "Volts AC",
+               alt_autoscale = true,
                number_format = "%5.1lfV",
                data = {
                        instances = {
-                               voltage = { "battery", "input", "output" }
+                               voltage = {  "input", "output" }
                        },
 
                        options = {
                                voltage_output  = { color = "00e000", title = "Output voltage", noarea=true, overlay=true },
-                               voltage_battery = { color = "0000ff", title = "Battery voltage", noarea=true, overlay=true },
                                voltage_input   = { color = "ffb000", title = "Input voltage", noarea=true, overlay=true }
                        }
                }
@@ -97,5 +113,5 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
                }
        }
 
-       return { voltages, percentload, charge_percent, temperature, timeleft, frequency }
+       return { voltages, voltagesdc, percentload, charge_percent, temperature, timeleft, frequency }
 end