Hello, I’m trying to export the Data from my LDDS-75 to Influxdb via telegraf and MQTT.
Everything is working… “okay” but there is one BIG problem.
The one number I need is not being imported into influx via the MQTT_consumer.
I’m talking about the distance the ultrasonic sensor is measuring.
This is the code I’m using. I assume it’s something with this code but I’m not a professional and I couldn’t figure it out on my own…
I have never used your setup before(telegraf, influxdb) but I see that you have 3 decoded fields in your above screen shot: uplink_message_decoded_payload_Bat, uplink_message_decoded_payload_Interrupt_flag, uplink_message_decoded_payload_Sensor_flag. I would assume your ultrasonic reading ought to be there as well. Could there be an issue with your JavaScript decoder thats not decoding your ultrasonic sensor value? Or is the uplink_message_decoded_payload_Sensor_flag parameter the one you are looking for(assuming a binary parameter)?
Thank you for your answer.
I actually found the answer a little before you wrote an answer.
It was a problem with the way ttn decoded the payload.
At the and the distance was printed with “mm”.
This “mm” was the problem. Influx only could handle numbers. So the distance which was printed like this: “1400 mm” could not be imported.
I just changed the payload decoder and now it is working fine.