Hi all,
recently changed to influxdb2.1 with my system.
went well until yesterday night.
now i messed around the whole day whith my inputs and still really dont have an idea, how all works,really.
im getting
" [inputs.exec] Error in plugin: column type: parse float error strconv.ParseFloat: parsing "Momentleistung(L1)": invalid syntax" in my err log on my telegraf side, thats all i know.
im using a python script to grab the data of my powermeters, convert them there to csv and import them via an input.exec rule.
maybe someone has the nerves to help me out.
here the scripts:
Python "Data-Grabber"
#!/usr/bin/env python
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
import time
meter = ModbusClient(host='192.168.1.105', port=8899)
# Unit = ID des zu lesenden Geraetes
resultL1 = meter.read_input_registers(12, count=2, unit=2)
resultL2 = meter.read_input_registers(14, count=2, unit=2)
resultL3 = meter.read_input_registers(16, count=2, unit=2)
resultges = meter.read_input_registers(52, count=2, unit=2)
resultkwh = meter.read_input_registers(342, count=2, unit=2)
decoderL1 = BinaryPayloadDecoder.fromRegisters(resultL1.registers, byteorder=Endian.Big,wordorder=Endian.Big)
decoderL2 = BinaryPayloadDecoder.fromRegisters(resultL2.registers, byteorder=Endian.Big,wordorder=Endian.Big)
decoderL3 = BinaryPayloadDecoder.fromRegisters(resultL3.registers, byteorder=Endian.Big,wordorder=Endian.Big)
decoderges = BinaryPayloadDecoder.fromRegisters(resultges.registers, byteorder=Endian.Big,wordorder=Endian.Big)
decoderkwh = BinaryPayloadDecoder.fromRegisters(resultkwh.registers, byteorder=Endian.Big,wordorder=Endian.Big)
L1= decoderL1.decode_32bit_float()
time.sleep(1)
L2= decoderL2.decode_32bit_float()
time.sleep(1)
L3= decoderL3.decode_32bit_float()
time.sleep(1)
ges= decoderges.decode_32bit_float()
time.sleep(1)
kwh= decoderkwh.decode_32bit_float()
time.sleep(1)
# etwas Formatierung kilowattstunden
#print ("%.4f" % (a/1000)) #KWh
print "Protokoll,Ort,Strohmzaehler,Momentleistung(L1),Momentleistung(L2),Momentleistung(L3),Momentleistung(Ges),Zaehlerstand(kWh)"
print ('Modbus,Semriach,Heizung,'"{}"','"{}"','"{}"','"{}"','"{}".format(L1,L2,L3,ges,kwh))
meter.close()
Telegraf Import
>>
#Telegraph Config
[[inputs.exec]]
commands = ["/etc/telegraf/telegraf.d/script_heizung_modbus.py"]
timeout = "15s"
interval = "10s"
# DATA EXAMPLE
# Protokoll,Ort,Strohmzaehler,Momentleistung(L1),Momentleistung(L2),Momentleistung(L3),Momentleistung(Ges),Zaehlerstand(kWh)
# Modbus,Semriach,Wasser,0.0,0.0,0.0,0.0,661.625976562
## Data format to consume.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "csv"
## Indicates how many rows to treat as a header. By default, the parser assumes
## there is no header and will parse the first row as data. If set to anything more
## than 1, column names will be concatenated with the name listed in the next header row.
## If `csv_column_names` is specified, the column names in header will be overridden.
csv_header_row_count = 1
## For assigning custom names to columns
## If this is specified, all columns should have a name
## Unnamed columns will be ignored by the parser.
## If `csv_header_row_count` is set to 0, this config must be used
#
#csv_column_names = ["Protokoll","Ort","Strohmzaehler","Momentleistung(L1)","Momentleistung(L2)","Momentleistung(L3)","Momentleistung(Ges)","Zaehlerstand(kWh)"]
## For assigning explicit data types to columns.
## Supported types: "int", "float", "bool", "string".
## Specify types in order by column (e.g. `["string", "int", "float"]`)
## If this is not specified, type conversion will be done on the types above.
#
csv_column_types = ["string", "string", "string", "float", "float", "float", "float", "float"]
## The seperator between csv fields
## By default, the parser assumes a comma (",")
#
csv_delimiter = ","
## Columns listed here will be added as tags. Any other columns
## will be added as fields.
csv_tag_columns = ["Protokoll","Ort","Strohmzaehler"]
## The column to extract the name of the metric from
#csv_measurement_column = ""
## The column to extract time information for the metric
## `csv_timestamp_format` must be specified if this is used
##csv_timestamp_column = ""
## The format of time data extracted from `csv_timestamp_column`
## this must be specified if `csv_timestamp_column` is specified
##csv_timestamp_format = ""
#
#[[processors.converter]]
#[processors.converter.fields]
# string = ["Momentleistung*","Zaehlerstand(kWh)"]
<<