Hi I’m getting this JSON from my tasmota SPM
15:15:47.864 MQT: sonoff/tele/ss-tal1-c1/SENSOR = {“Time”:“2024-04-30T15:15:47”,“SPM”:{“Energy”:[158.3,78.8,124.1,22.7,79.2,32.3,187.1,1.0],“Yesterday”:[12.7,6.4,8.8,5.5,6.5,1.6,16.4,0.1],“Today”:[1.6,0.8,1.1,0.7,0.8,0.7,1.8,0.1],“ActivePower”:[530.1,267.3,368.1,230.6,266.9,248.6,341.8,122.8],“ApparentPower”:[536.7,449.7,372.0,232.8,268.5,251.2,343.7,123.4],“ReactivePower”:[82.6,360.8,52.6,31.4,27.9,35.4,36.6,11.0],“Factor”:[0.99,0.59,0.99,0.99,0.99,0.99,0.99,1.00],“Voltage”:[221.1,223.0,221.1,221.3,222.7,220.9,221.2,222.9],“Current”:[2.43,2.02,1.69,1.05,1.20,1.13,1.55,0.55]}}
I want to save the data only of the SPM part, in my influxdb
[[inputs.mqtt_consumer]]
client_id = "telegraf"
username = "myuser"
password = "mypass"
data_format = "json_v2"
servers = [ "tcp://vernemq.mqtt:1883" ]
topics = [ "tele/+/+/+/SENSOR" ]
[[inputs.mqtt_consumer.json_v2]]
measurement_name = "spm_data"
[[inputs.mqtt_consumer.topic_parsing]]
topic = "tele/+/+/+/SENSOR"
tags = "_/site/room/sensor/_"
[[inputs.mqtt_consumer.json_v2.tag]]
path = "Time"
[[inputs.mqtt_consumer.json_v2.object]]
path = "SPM"
disable_prepend_keys = true
[[inputs.mqtt_consumer.json_v2.field]]
path = "Energy"
type = "float"
[[inputs.mqtt_consumer.json_v2.field]]
path = "Yesterday"
type = "float"
[[inputs.mqtt_consumer.json_v2.field]]
path = "Today"
type = "float"
[[inputs.mqtt_consumer.json_v2.field]]
path = "ActivePower"
type = "float"
[[inputs.mqtt_consumer.json_v2.field]]
path = "ApparentPower"
type = "float"
[[inputs.mqtt_consumer.json_v2.field]]
path = "ReactivePower"
type = "float"
[[inputs.mqtt_consumer.json_v2.field]]
path = "Factor"
type = "float"
[[inputs.mqtt_consumer.json_v2.field]]
path = "Voltage"
type = "float"
[[inputs.mqtt_consumer.json_v2.field]]
path = "Current"
type = "float"
I used that and nothing is coming into my influxdb I dunno whats wrong or maybe there is another way