Hi,
I have a tasmota smart meter Reader that sends the data to my mqtt Broker.
Now I can’t get the data to be written to the influxdb via telegraph. I didn’t manage it with the json v2 integration.
Basically, telegraf works, as does the connection to the database. The records sent by 3 opendtu’s are already successfully written to the database.
The mqtt data of the tasmota smart meter reader is sent to the broker in the following format.
The topic: Energie/tele/EZ_AL5/SENSOR
{“Time”:“2023-08-13T22:44:09”,“Haus 5”:{“server_id”:“0a01484c590300024f92”,“export_total_kwh”:0.0000,“total_kwh”:72.5554,“curr_w”:12,“volt_p1”:0.00,“volt_p2”:242.00,“volt_p3”:0.00,“amp_p1”:0.00,“amp_p2”:0.08,“amp_p3”:0.00,“wirkleistung_l1”:0,“wirkleistung_l2”:12,“wirkleistung_l3”:0,“phase_angle_l2_l1”:-1.0,“phase_angle_l3_l1”:-1.0,“phase_angle_p1”:-1.0,“phase_angle_p2”:307.0,“phase_angle_p3”:-1.0,“freq”:50.00}}
Could any of you please help me?
Hello @Spueli99 ,
I’m confused.
It seems like everything is working?
Basically, telegraf works, as does the connection to the database. The records sent by 3 opendtu’s are already successfully written to the database.
Can you share your error and telegraf config? So I can understand what’s not working and what you’ve tried?
Spueli99:
{“Time”:“2023-08-13T22:44:09”,“Haus 5”:{“server_id”:“0a01484c590300024f92”,“export_total_kwh”:0.0000,“total_kwh”:72.5554,“curr_w”:12,“volt_p1”:0.00,“volt_p2”:242.00,“volt_p3”:0.00,“amp_p1”:0.00,“amp_p2”:0.08,“amp_p3”:0.00,“wirkleistung_l1”:0,“wirkleistung_l2”:12,“wirkleistung_l3”:0,“phase_angle_l2_l1”:-1.0,“phase_angle_l3_l1”:-1.0,“phase_angle_p1”:-1.0,“phase_angle_p2”:307.0,“phase_angle_p3”:-1.0,“freq”:50.00}}
@Spueli99 assuming you managed to subscribe to your MQTT topic for the Tasmota device you can parse the data via
[[inputs.mqtt_consumer]]
...
data_format = "xpath_json"
xpath_native_types = true
[[inputs.mqtt_consumer.xpath]]
metric_name = "'tasmota'"
metric_selection = '*'
timestamp = "/Time"
timestamp_format = "2006-01-02T15:04:05"
field_selection = "*"
which results in
> tasmota,host=Hugin amp_p1=0,amp_p2=0.08,amp_p3=0,curr_w=12,export_total_kwh=0,freq=50,phase_angle_l2_l1=-1,phase_angle_l3_l1=-1,phase_angle_p1=-1,phase_angle_p2=307,phase_angle_p3=-1,server_id="0a01484c590300024f92",total_kwh=72.5554,volt_p1=0,volt_p2=242,volt_p3=0,wirkleistung_l1=0,wirkleistung_l2=12,wirkleistung_l3=0 1691966649000000000
for the example you gave. Is this what you want?
2 Likes
@srebhan many thanks for your support.
I have integrated the configuration you provided.
at first it looks very good.
I test the days for plausibility.