# Tasmotta MQTT to InfluxDB

**URL:** <https://discourse.nodered.org/t/tasmotta-mqtt-to-influxdb/19381>\
**Category:** General\
**Created:** [20 December 2019 10:05 UTC](https://discourse.nodered.org/t/tasmotta-mqtt-to-influxdb/19381 "2019-12-20T10:05:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![loyaltolex](https://avatars.discourse-cdn.com/v4/letter/l/a587f6/32.png) [@loyaltolex](https://discourse.nodered.org/u/loyaltolex)\
**Post date:** [20 December 2019 10:05 UTC](https://discourse.nodered.org/t/tasmotta-mqtt-to-influxdb/19381/1 "2019-12-20T10:05:21Z")

</div>

Hi, I am trying to take my MQTT string sent to me by Tasmota (TH16) and send it to InfluxDB  
The string is

```auto
{"Time":"2019-12-20T20:52:22","AM2301":{"Temperature":18.4,"Humidity":67.7},"TempUnit":"C"}

```

and I believe that I will need to get it into a form like this: (as seen in a debug node)

rflink : msg.payload : Object  
object  
temp: 18.4  
humidity: 67.7  
TempUnit: "C"

before sending to a influxdb out node.

Could someone please confirm if I need to send the string through a JSON node and  
some guidance on the suitable code for a function node that will give me the result suitable for sending to the InfluxDB node

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 December 2019 14:17 UTC](https://discourse.nodered.org/t/tasmotta-mqtt-to-influxdb/19381/2 "2019-12-20T14:17:18Z")

</div>

If you set the mqtt node to parsed json object mode then it should return a javascript object rather than a string. Feed the output into a debug node to check whether it is a string or an object. The influxdb node also requires an object not a string so all you need to do is to move the bits about to get the required structure.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 December 2019 19:40 UTC](https://discourse.nodered.org/t/tasmotta-mqtt-to-influxdb/19381/3 "2019-12-20T19:40:27Z")

</div>

> [@Colin](#):
>
> to move the bits about

... possibly using a change node
