# Mqtt in output dataformate for dashbaord

**URL:** <https://discourse.nodered.org/t/mqtt-in-output-dataformate-for-dashbaord/62385>\
**Category:** Dashboard\
**Tags:** mqtt\
**Created:** [9 May 2022 07:57 UTC](https://discourse.nodered.org/t/mqtt-in-output-dataformate-for-dashbaord/62385 "2022-05-09T07:57:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dheeju1314](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@dheeju1314](https://discourse.nodered.org/u/dheeju1314)\
**Post date:** [9 May 2022 07:57 UTC](https://discourse.nodered.org/t/mqtt-in-output-dataformate-for-dashbaord/62385/1 "2022-05-09T07:57:49Z")

</div>

Hi Team,

am received MQTT IN values using node red but how do i publish into dashabord using this single TOpic name receiving from MQTTIN

 ![Screenshot from 2022-05-09 13-26-14](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06c1001e77ccc5876b7e9bd530c43689a526babb.png)  
 ![Screenshot from 2022-05-09 14-38-31](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/0/802914e98e008ebcd9ef2cdf21aa4ae1607531eb.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 May 2022 09:39 UTC](https://discourse.nodered.org/t/mqtt-in-output-dataformate-for-dashbaord/62385/2 "2022-05-09T09:39:35Z")

</div>

> [@dheeju1314](#):
>
> but how do i publish into dashabord using this single TOpic name receiving from MQTTIN

With considerable difficulty.

What is publishing that data? Are you in control of the publishing? If yes, then I would strongly recommend you change it to have individual topics OR all values in one message as JSON

---

<div class="post-metadata">

**Author:** ![dheeju1314](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@dheeju1314](https://discourse.nodered.org/u/dheeju1314)\
**Post date:** [9 May 2022 09:46 UTC](https://discourse.nodered.org/t/mqtt-in-output-dataformate-for-dashbaord/62385/3 "2022-05-09T09:46:23Z")

</div>

Hi Thanks for the information @Steve-Mcl i will try to Send data using Json String from the MQTT publisher and try it to subscribe.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 May 2022 10:20 UTC](https://discourse.nodered.org/t/mqtt-in-output-dataformate-for-dashbaord/62385/4 "2022-05-09T10:20:28Z")

</div>

Also, try not to use mixed strings like "`Humidity : 63.00"` and `"O2 : 20.09"` as you will have to split them up later. Better formatting your JSON payload something like...

```auto
{
  "temperature": 29.3,
  "humidity": 63.0,
  "o2": 20.09
}

```

That way, when you receive the data, you can access each item by name e.g...  
`msg.payload.temperature` and `msg.payload.humidity` and so on and the values with be of number type.

Then when you use them in the dashboard, you can format them to however you like e.g.

- `Temperature: {{ payload.temperature | number:2 }} ℃` would show `Temperature: 29.30 ℃` on the dashboard.
- `Humidity: {{ payload.humidity | number:0 }} %` would show `Humidity: 63 %` on the dashboard.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [9 May 2022 10:39 UTC](https://discourse.nodered.org/t/mqtt-in-output-dataformate-for-dashbaord/62385/5 "2022-05-09T10:39:19Z")

</div>

Also your MQTT topic could perhaps be better. "out" and "topic" don't add much value.

I guess this is an air quality sensor so you could use just "iaq" as the mqtt topic.

But perhaps one day you want more than one iaq sensor, so try "iaq/x" where x = the device location.  
So one sensor might use "iaq/kitchen", another "iaq/lounge".

You can subscribe to just one of them with "iaq/kitchen" or all of them with "iaq/#"

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 July 2022 10:39 UTC](https://discourse.nodered.org/t/mqtt-in-output-dataformate-for-dashbaord/62385/6 "2022-07-08T10:39:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
