Unwanted tags in modbus input setup (telegraf)

Hi All,

I was able to successfully get a telegraph setup for reading an energy meter via Modbus RTU up and running.

Here is the Modbus chapter of the *.conf file:

[[inputs.modbus]]
  name = "energy_meter_test"
  slave_id = 10
  timeout = "5s"
  controller = "file:///dev/ttyUSB0"
  baud_rate = 38400
  data_bits = 8
  parity = "N"
  stop_bits = 1
  transmission_mode = "RTU"
  configuration_type = "register"
  input_registers = [
    { measurement = "energy",   name = "voltage_V",                         byte_order = "ABCD",   data_type = "FIXED",   scale=0.001,   address = [256,257]},
    { measurement = "energy",   name = "current_A",                         byte_order = "ABCD",   data_type = "FIXED",   scale=0.001,   address = [258,259]},
    { measurement = "energy",   name = "active_power_W",                    byte_order = "ABCD",   data_type = "FIXED",   scale=1.0,     address = [260,261]},
  ]

What I get as line protocol output looks like this:

energy,host=modbusRTU-test-raspi,name=energy_meter_test,slave_id=10,type=input_register voltage_V=227.73000000000002,current_A=0.914,active_power_W=148 1705271172000000000

What annoys me is the tag type=input_register in the output line. Where does it come from and how can I get rid of it from the output data stream?

I would be grateful for any advice.

conne914

The tag is set based on the type of configuration to read.

If you don’t want it, then see the tagexclude config option.

Hi jpowers,

thanks a lot! I just had the chance to try it out today. The tagexclude option works for me.

:+1:

conne914