OPC Telegrag apply Deadband

Hello, sorry in advance if that topic has been discussed before, but I’ve not been able to find it.

I’m creating a Probe of Concept, OPC Data read by telegraf and this data send to Influx.

I do need to apply any kind of “deadband” process.

To help understanding that. Temperature in the PLC that I’m reading has like 8 decimas, then if temperatura changes from 20.0000001 to 20.0000002 a change of value is send and data is stored in Influx. Result is lots of data not need.

I do need to implement a deadband of 10% or 0.1. If temperature changes from 20.0 to 20.1 write data, if changes between 20.01 and 20.09 skip recording.

Can you help with that?

I will need almost the same of Modbus, but taking into account that Modbus works based in sampling instead of COV.

Thank you.

I’ve been testing and I’ve been able to get the difference every 1 sec,

from(bucket: “IOT”)
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) =>
r._measurement == “opcua” and
r._field == “User2”
|>derivative(unit: 1s)

What I need at present is:

Moving data to another bucket when derivate is > 1.

Can you help with that?

Thank you.

First of all, please note that InfluxDB usually copes very well with identical/similar consecutive data. However, if you really need to do what you want, you might use the starlark processor allowing to write a python-like program.

Thank you.

But the idea is having an Influx at customer site, then replication to cloud. As much data can be reduced as easier would be sending to cloud.

Thank you.

I see. So I suggest to use the starlark processor I linked above. There you can round the values and then use the dedup processor or filter out the metrics in starlark directly (by not returning it) like in this example.