Data from Modbus is used to visualize it in Grafana. The problem is that if the value should be “0”, for example due to a communication problem with Modbus, then the visualization in Grafana is severely distorted. Now I wanted to use the processor filter in Telegraf to prevent 0 values from being passed on to InfluxDB2. Unfortunately that didn’t work.
Does anyone have an idea how it could work?
This is my Telegraf config for the Modbus:
[[inputs.modbus]]
name = "Plenticore_7.0"
slave_id = 71
timeout = "5s"
controller = "tcp://scb:1502"
holding_registers = [
{ name = "Total_home_consumption_Battery", byte_order = "CDAB", data_type = "FLOAT32-IEEE", scale=1.0, address = [110,111]},
{ name = "Total_home_consumption_Grid", byte_order = "CDAB", data_type = "FLOAT32-IEEE", scale=1.0, address = [112,113]},
{ name = "Total_home_consumption_PV", byte_order = "CDAB", data_type = "FLOAT32-IEEE", scale=1.0, address = [114,115]},
{ name = "Total_home_consumption", byte_order = "CDAB", data_type = "FLOAT32-IEEE", scale=1.0, address = [118,119]},
]
This is the processor command, which unfortunately doesn’t work:
[[processors.filter]]
namepass = ["Plenticore_7.0"]
[[processors.filter.override]]
name = "Total_home_consumption_Battery"
drop_value = 0
[[processors.filter.override]]
name = "Total_home_consumption_Grid"
drop_value = 0
[[processors.filter.override]]
name = "Total_home_consumption_PV"
drop_value = 0
[[processors.filter.override]]
name = "Total_home_consumption"
drop_value = 0