BMP180 to Influxdb

This flow allow you to write measurements (temperature, pressure and altitude) of your BMP180 sensor connected on your Raspberry Pi to an influxdb database.

[{"id":"f1ad0983.5176d8","type":"json","z":"29ac22f9.6aefae","name":"Convert 2 JSON","x":310.5357131958008,"y":960.4006690979004,"wires":[["cd173549.4267e8"]]},{"id":"da92b91b.9abdb8","type":"mqtt in","z":"29ac22f9.6aefae","name":"","topic":"iot/sensors/BMP180","qos":"2","broker":"4a94fdae.3781a4","x":123.57142639160156,"y":1023.1073169708252,"wires":[["f1ad0983.5176d8"]]},{"id":"cd173549.4267e8","type":"template","z":"29ac22f9.6aefae","name":"Format to Influxdb","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"temperature\": {{payload.temperature}}, \"pressure\": {{payload.pressure}}, \"altitude\": {{payload.altitude}} }\n{{! Remove the seaLevel measurement because of null value }}","x":476.25000762939453,"y":873.4723024368286,"wires":[["e5a6d2be.b4efa"]]},{"id":"e5a6d2be.b4efa","type":"json","z":"29ac22f9.6aefae","name":"Convert 2 JSON again","x":641.3293304443359,"y":817.1626529693604,"wires":[["718b19c6.872e78"]]},{"id":"f885bbf.e6fca48","type":"influxdb out","z":"29ac22f9.6aefae","influxdb":"a2438c77.956c8","name":"","measurement":"","x":949.1626968383789,"y":646.198447227478,"wires":[]},{"id":"718b19c6.872e78","type":"function","z":"29ac22f9.6aefae","name":"Send msg.measurement","func":"\n// send msg.measurement property as required by Influxdb node\nvar tokens = msg.topic.split(\"/\");\nmsg.measurement = tokens[2];\nreturn msg;","outputs":1,"noerr":0,"x":762.8571548461914,"y":736.9245834350586,"wires":[["f885bbf.e6fca48"]]},{"id":"4a94fdae.3781a4","type":"mqtt-broker","z":"29ac22f9.6aefae","broker":"yourRaspberryPiIp","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"a2438c77.956c8","type":"influxdb","z":"29ac22f9.6aefae","hostname":"yourInfluxdbHost","port":"8086","database":"iotdb","name":""}]
pdomineaux

Flow Info

created 10 months, 3 weeks ago

Node Types

Core
  • function (x1)
  • json (x2)
  • mqtt in (x1)
  • mqtt-broker (x1)
  • template (x1)
Other

Tags

  • BMP180
  • infuxdb
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option