Graph - Stop graphing when some value

Started by Asterix, December 27, 2020, 11:12:36 AM

Previous topic - Next topic

Asterix

Hi,
is possibile to stop graphing when some value is returned?
In my case Ubiquiti device return -1000 of signal strenght when remote device is not connected via radio.

I need to stop graphing instead of get -1000



tomaskir

Use a transform script to return "null" when wrong value is received:


if ($1 < -100) {
  return null;
} else {
  return $1;
}

Asterix

When null is returned on the chart it goes a position itself as value 0

Version 3.6.303

Other methods?

tomaskir

Null means data collection error - no value will be stored in the DB, no value will be shown on the chart.
The DCI will show "<<ERROR>>" in Last Values.

If you want 0, simply return 0 in the transform script.

Asterix

I've tried, but in last value I get "0" instead of <<ERROR>>
This is the Transformation
return ($1 < -100) ? null : $1;

Why?

Filipp Sudanov

Try abort instead of return null:

if ($1 < -100) {
  abort;
} else {
  return $1;
}

Asterix


Asterix

However, there is an anomaly  :(
If the chart is zoomed out, it tends to close the line between the previous and last retrieved value.
See in my example 1H Graph and 4H same graph


Victor Kirhenshtein

Hi,

there is open change request for that: https://track.radensolutions.com/issue/NX-1826. Hopefully will fix it soon.

Best regards,
Victor