I have a ESP32 with Tasmota how is put to the digital electricity meter to get the information.
this send to Topics:
one on Tasmota/STATUS10 every 15min:
{“StatusSNS”:{“Time”:“2024-06-22T10:00:01”,“MT175”:{“E_in”:12642.6,“P”:2256.00,“L1”:263.00,“L2”:6.00,“L3”:1988.00,“Server_ID”:“0649534b010e1f5f9b3b”}}}
and one on Tasmota/SENSOR with the current change Values. This seams to be the content of StatusSNS
{“Time”:“2024-06-22T10:00:01”,“MT175”:{“E_in”:12642.6,“P”:2256.00,“L1”:263.00,“L2”:6.00,“L3”:1988.00,“Server_ID”:“0649534b010e1f5f9b3b”}}
But then only one of the Fields in MT175.* is sendet.
I try to get a messerument with all of this five Fields put all version I try didn
t work.
I have try a data_format=“xpath_json” version but there I get no values, and with to lines above I get the Error: configuration specified the fields [“timestamp_path”], but they were not used. This is either a typo…
data_format = “json_v2”
[[inputs.mqtt_consumer.json_v2]]
[[inputs.mqtt_consumer.json_v2.object]]
path = “StatusSNS”
timestamp_path = “Time”
timestamp_format = “2006-01-02T15:04:05”
[[inputs.mqtt_consumer.json_v2.object.field]] # fields by key and type
P = “number(MT175.P)”
L1 = “number(MT175.L1)”
L2 = “number(MT175.L2)”
L3 = “number(MT175.L3)”
E_in = “number(MT175.E_in)”
Both options have different settings. The fields, note plural and a list, is a list of key values, while the field, singular, is something that can be specified multiple times and specify multiple paths, keys, etc.
I’ll add there are two things you might need to think about as well:
Do you want the server id to be a tag?
The timestamps are the same in these examples. In this case, the 2nd L2 value would win. In this case they are the same so it wouldn’t matter, but if they were different just be aware that when metrics are named the same, have the same timestamp and don’t have any tags, then the last value wins.
the serverID is not needed, I have only one digital electricity meter and it want be change (and if it change it will only replace so for the timeline it is’nt important.
there will be multiple publishing in the same second from tasmota. so if only one L1,L2,L3,P is save its okay, but one should be inserted.
is there a possible that there is no Tag set with “Tasmota/SENSOR”. I added befor via API and scripting and there is also no Tag, that make later in Grafana Problems.
I don’t want the topic now I have one REsult with topic Tasmota/SENSOR and one TASMOTA/STATUS10
and as I Inserted before there is no topic needed, was is what I want
Dropping data in influxdb depends on whatever version and release of influxdb you are using. I’m not a huge influxdb expert, but if you let me know what version you are using I might be able to guide you there.
it was nearly one day, every 10minutes so I think API would be easier. I will read the docu and look.
But I have now the fields with telegraf in.
thanks