# BME180 processing output for Dashboard

**URL:** https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287
**Category:** General
**Created:** [13 August 2019 16:37 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287 "2019-08-13T16:37:47Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![BrianD](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@BrianD](https://discourse.nodered.org/u/BrianD)
#### Post date: [13 August 2019 16:37 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/1 "2019-08-13T16:37:47Z")

</div>

I'm stuck! I have a BME280 attached to a esp8266 with Tasmota firmware. The Console output is -  
sensorBME/tele/SENSOR = {"Time":"2019-08-13T17:27:58","BME280":{"Temperature":21.0,"Humidity":56.7,"Pressure":1007.9},"PressureUnit":"hPa","TempUnit":"C"}

In Node-Red I have read the output with a MQTT input node and the raw data looks fine.  
I would like to separate out the Time, Temperature, Pressure and Humidity outputs.  
To do this I have used the Json node, then a Split node (using ,) and then sending data to a Change node.

I have not been able to change and separate the Object data -

13/08/2019, 17:22:59[node: 5ac1839.91c387c](http://192.168.1.129:1880/#)sensorBME/tele/Time : msg.payload : string[19]

"2019-08-13T17:22:57"

13/08/2019, 17:22:59[node: 5ac1839.91c387c](http://192.168.1.129:1880/#)sensorBME/tele/BME280 : msg.payload : Object

object

Temperature: 21

Humidity: 57

Pressure: 1008

13/08/2019, 17:22:59[node: 5ac1839.91c387c](http://192.168.1.129:1880/#)sensorBME/tele/PressureUnit : msg.payload : string[3]

"hPa"

13/08/2019, 17:22:59[node: 5ac1839.91c387c](http://192.168.1.129:1880/#)sensorBME/tele/TempUnit : msg.payload : string[1]

"C"

Any help in sorting out this data would be most welcome.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [13 August 2019 16:50 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/2 "2019-08-13T16:50:45Z")

</div>

Not sure what you are trying to do, but you can access the properties by using `msg.payload.Temperature` etc

---

<div class="post-metadata">

### Author: ![BrianD](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@BrianD](https://discourse.nodered.org/u/BrianD)
#### Post date: [13 August 2019 20:39 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/3 "2019-08-13T20:39:38Z")

</div>

Thanks bakman2 getting there but no cigar.  
Getting lots of Undefined debug reports as well as some correct reports.  
Not sure what I have done to mess things up.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [13 August 2019 21:13 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/4 "2019-08-13T21:13:07Z")

</div>

I am not sure what you are trying to do.

---

<div class="post-metadata">

### Author: ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)
#### Post date: [14 August 2019 05:23 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/5 "2019-08-14T05:23:36Z")

</div>

Please share the relevant part of your flow, so people can help. Otherwise it is hard to understand what it going wrong.

As @bakman2 has stated, you can already access distinct properties of your data once it has been converted into an object by either the mqtt-node or the json-node.

---

<div class="post-metadata">

### Author: ![Cathprotech](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cathprotech/32/7913_2.png) [@Cathprotech](https://discourse.nodered.org/u/Cathprotech)
#### Post date: [14 August 2019 16:48 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/6 "2019-08-14T16:48:02Z")

</div>

I'm very new so what I say maybe completely wrong but it sound similar to what I needed to do.

I use a function node and pick out what I need

var Temp=msg.payload.Temperature;  
var Hum=msg.payload.Humidty;  
var Pres=msg.payload.Pressure;  
return msg;

or maybe this.....

Temp: {{payload.Temperature}}  
Hum: {{payload.Humidity}}  
Pres: {{payload.Pressure}}

If you want 3 separate data outputs you could select a function node with 3 outputs and use something like this...

Temp={};  
Hum={};  
Pres={};  
Temp.payload = (msg.payload.Temperature);  
Hum.payload = (msg.payload.Humidity);  
Pres.payload = (msg.payload.Pres);  
return [Temp,Hum,Pres];

Now I maybe completely wrong as I use mostly trial and error to get my nodes to work. It will depend upon your input string of course.  
Hope I could help though.

---

<div class="post-metadata">

### Author: ![BrianD](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@BrianD](https://discourse.nodered.org/u/BrianD)
#### Post date: [15 August 2019 13:19 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/7 "2019-08-15T13:19:11Z")

</div>

Thanks to all - I'm not there yet!  
I would like to separate out the temperature and pressure sensor outputs to trigger other MQTT attached devices.

Here is the flow editor output (I hope this is the correct way to share what i,m doing) -  
[  
{  
"id": "399dba2a.7b0306",  
"type": "mqtt in",  
"z": "50e81bd1.24b564",  
"name": "",  
"topic": "esp8266BME/tele/SENSOR",  
"qos": "0",  
"datatype": "json",  
"broker": "496ae199.0dca3",  
"x": 280,  
"y": 520,  
"wires": [  
[  
"2e169ccf.7f3f24"  
]  
]  
},  
{  
"id": "541f28e6.2f6358",  
"type": "switch",  
"z": "50e81bd1.24b564",  
"name": "",  
"property": "payload",  
"propertyType": "msg",  
"rules": [  
{  
"t": "cont",  
"v": "msg.payload.Humidity",  
"vt": "str"  
},  
{  
"t": "cont",  
"v": "msg.payload.Temperature",  
"vt": "str"  
},  
{  
"t": "cont",  
"v": "msg.payload.Pressure",  
"vt": "str"  
},  
{  
"t": "else"  
}  
],  
"checkall": "true",  
"repair": false,  
"outputs": 4,  
"x": 730,  
"y": 560,  
"wires": [  
[  
"46cc26dd.9aa7a8"  
],  
[  
"a73a5e3d.bc501"  
],  
[  
"19b373f1.71440c"  
],  
  
]  
},  
{  
"id": "46cc26dd.9aa7a8",  
"type": "debug",  
"z": "50e81bd1.24b564",  
"name": "Humidity",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "true",  
"targetType": "full",  
"x": 909.9999771118164,  
"y": 541.3333168029785,  
"wires":   
},  
{  
"id": "a73a5e3d.bc501",  
"type": "debug",  
"z": "50e81bd1.24b564",  
"name": "Temperature",  
"active": true,  
"console": "false",  
"complete": "value",  
"x": 923.4999618530273,  
"y": 588.6666145324707,  
"wires":   
},  
{  
"id": "19b373f1.71440c",  
"type": "debug",  
"z": "50e81bd1.24b564",  
"name": "Pressure",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "value",  
"targetType": "msg",  
"x": 915.4999618530273,  
"y": 640.6666145324707,  
"wires":   
},  
{  
"id": "486d72bb.48158c",  
"type": "debug",  
"z": "50e81bd1.24b564",  
"name": "",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "true",  
"targetType": "full",  
"x": 680,  
"y": 480,  
"wires":   
},  
{  
"id": "2e169ccf.7f3f24",  
"type": "split",  
"z": "50e81bd1.24b564",  
"name": "",  
"splt": "/",  
"spltType": "str",  
"arraySplt": 1,  
"arraySpltType": "len",  
"stream": false,  
"addname": "key",  
"x": 530,  
"y": 520,  
"wires": [  
[  
"486d72bb.48158c",  
"541f28e6.2f6358"  
]  
]  
},  
{  
"id": "496ae199.0dca3",  
"type": "mqtt-broker",  
"z": "",  
"name": "MQTT",  
"broker": "192.168.1.129",  
"port": "1883",  
"clientid": "",  
"usetls": false,  
"compatmode": true,  
"keepalive": "60",  
"cleansession": true,  
"birthTopic": "",  
"birthQos": "0",  
"birthRetain": "true",  
"birthPayload": "",  
"closeTopic": "",  
"closeQos": "0",  
"closeRetain": "false",  
"closePayload": "",  
"willTopic": "",  
"willQos": "0",  
"willRetain": "false",  
"willPayload": ""  
}  
]

My initial posting contains the mqtt console output from the BME280 sensor.

Brian

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [15 August 2019 13:21 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/8 "2019-08-15T13:21:13Z")

</div>

Does it work, or if it doesn't, what doesn't work ?

---

<div class="post-metadata">

### Author: ![BrianD](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@BrianD](https://discourse.nodered.org/u/BrianD)
#### Post date: [15 August 2019 13:23 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/9 "2019-08-15T13:23:09Z")

</div>

It doesn't work from the Switch node.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [15 August 2019 14:58 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/10 "2019-08-15T14:58:29Z")

</div>

Show us a properly formatted output of a debug node that you have connected to the MQTT node.

---

<div class="post-metadata">

### Author: ![BrianD](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@BrianD](https://discourse.nodered.org/u/BrianD)
#### Post date: [15 August 2019 15:20 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/11 "2019-08-15T15:20:58Z")

</div>

15/08/2019, 16:19:06[node: 86adae18.20fc8](http://192.168.1.129:1880/#)esp8266BME/tele/SENSOR : msg : Object

object

topic: "esp8266BME/tele/SENSOR"

payload: object

Time: "2019-08-15T16:19:04"

BME280: object

Temperature: 22.5  
Humidity: 53.6  
Pressure: 1004.8

PressureUnit: "hPa"  
TempUnit: "C"  
qos: 0  
retain: false  
\_msgid: "a6746b0b.f7aa48"

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [15 August 2019 15:41 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/12 "2019-08-15T15:41:08Z")

</div>

The switch switches based on value, not based on property. Splitting doesn't work either as it splits `msg.payload`

Try this flow, connect your MQTT node to both.

```auto
[{"id":"e4295f89.c628f","type":"debug","z":"681f8bde.8887bc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":610,"y":616,"wires":[]},{"id":"d55c40ca.7b488","type":"change","z":"681f8bde.8887bc","name":"Temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.BME280.Temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":434,"y":616,"wires":[["e4295f89.c628f"]]},{"id":"9f6fe77e.49c6a8","type":"change","z":"681f8bde.8887bc","name":"Humidity","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.BME280.Humidity","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":424,"y":672,"wires":[["daa23c3b.b9864"]]},{"id":"daa23c3b.b9864","type":"debug","z":"681f8bde.8887bc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":610,"y":672,"wires":[]}]

```

I was working on tasmota with a bme280 as well, how convenient 😉

---

<div class="post-metadata">

### Author: ![BrianD](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@BrianD](https://discourse.nodered.org/u/BrianD)
#### Post date: [15 August 2019 18:01 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/13 "2019-08-15T18:01:10Z")

</div>

bakman2, many thanks you have fixed it. My ignorance drives me mad!  
Make sure that you have a BME180 because many of the sellers send you a BMP180 (no humidity).  
Mine is attached to a esp8266 with tasmota and is working well.  
Thanks again.

---

<div class="post-metadata">

### Author: ![triphil](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@triphil](https://discourse.nodered.org/u/triphil)
#### Post date: [15 January 2020 12:02 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/14 "2020-01-15T12:02:51Z")

</div>

I'm also having problems getting the Temperature,Pressure and Humidity from the BME280.  
I have it wired to a Wemos D1 and it shows the values correctly on its own Tasmota webpage ( for the Wemos) and I get

```auto
house/weather/tele/SENSOR : msg.payload : string[129]

"{"Time":"2020-01-14T21:00:07","BME280":{"Temperature":11.9,"Humidity":95.3,"Pressure":987.9},"PressureUnit":"hPa","TempUnit":"C"}"

```

from the node on my node-red page but I don't seem to be able to work out what I have to do to get the individual values for each on their own message topic.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [15 January 2020 12:10 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/15 "2020-01-15T12:10:30Z")

</div>

How are you trying to access it? In your debug it shows msg.payload as a string. Where is this coming from? a MQTT-IN node? If so, look at the options and try setting the 'output' setting to 'a parsed json object'

---

<div class="post-metadata">

### Author: ![triphil](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@triphil](https://discourse.nodered.org/u/triphil)
#### Post date: [15 January 2020 12:23 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/16 "2020-01-15T12:23:45Z")

</div>

yes I believe its coming from an MQTT-In node ( will have to check when I'm home). I did at one stage get the 'pressure' value out on its own but changed settings and lost it again

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [15 January 2020 13:23 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/17 "2020-01-15T13:23:40Z")

</div>

Stick a debug node on the output of the `mqtt-in` node so you can see msg payload and copy the path to each of the elements  
 ![Screen Shot 2020-01-15 at 8.23.00 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/33b7d0b13d6ed9f041b1645cbdc06c7edaa9d5c2.png)

---

<div class="post-metadata">

### Author: ![triphil](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@triphil](https://discourse.nodered.org/u/triphil)
#### Post date: [17 January 2020 16:26 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/18 "2020-01-17T16:26:18Z")

</div>

This is what I get from my MQTT in node

```auto
{"topic":"house/weather/tele/SENSOR","payload":"{\"Time\":\"2020-01-17T16:25:13\",\"BME280\":{\"Temperature\":5.8,\"Humidity\":76.5,\"Pressure\":1006.9},\"PressureUnit\":\"hPa\",\"TempUnit\":\"C\"}","qos":0,"retain":false,"_msgid":"e1a95e7a.6ef5b"}

```

---

<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: [17 January 2020 17:08 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/19 "2020-01-17T17:08:49Z")

</div>

As suggested earlier, change the MQTT in node to parsed JSON mode, which tells it to expect JSON formatted data and convert it to a javascript object.

---

<div class="post-metadata">

### Author: ![triphil](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@triphil](https://discourse.nodered.org/u/triphil)
#### Post date: [17 January 2020 21:47 UTC](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287/20 "2020-01-17T21:47:30Z")

</div>

Thanks - with a bit of help and some trial and error I now seem to have a working BME280 output - now to try and add a UV sensor to the Wemos as well

[Next page](https://discourse.nodered.org/t/bme180-processing-output-for-dashboard/14287.md?page=2)
