node-red tutorial (#1024)
* node-red tutorial for ble temperature sensor
No files matched your search
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -1,4 +1,78 @@
|
||||
# Integrate Node Red
|
||||
# Integrate Node-Red
|
||||
|
||||
## Integrate BLE sensors, devices and display a dashboard
|
||||
|
||||
Prerequisites: node-red, node-red-dashboard
|
||||
|
||||
### Broker connection
|
||||
* Add a new `mqtt in` node
|
||||
* Click 2 times on it
|
||||
* Add a new broker or connect to an existing one (server field)
|
||||
* Set the topic like below with the MAC address at the end being the one of the device you want to integrate
|
||||
|
||||

|
||||
|
||||
::: tip
|
||||
The "+" enables to process the data from all the gateways whatever name they have. So you may setup several OpenMQTTGateway, you will not have to change the Node-Red configuration.
|
||||
:::
|
||||
|
||||
This configuration enables to process all the data coming from the sensor.
|
||||
|
||||
* Click on done
|
||||
* So as to monitor the traffic coming; you can add a debug node with *msg.payload* as Output
|
||||
|
||||

|
||||
|
||||
* Link it to the `mqtt in` node
|
||||
|
||||

|
||||
|
||||
* Deploy
|
||||
* Open the debug panel
|
||||
* You should see messages coming when the gateway will receive data
|
||||
|
||||

|
||||
|
||||
### Json message processing
|
||||
We need to process the json message so as to extract the value that we want to display.
|
||||
|
||||
* Add a `change` node
|
||||
* Configure it as `Move`
|
||||
* Add the msg value you would like to process example *msg.payload.tempc* and the target *msg.payload*
|
||||
|
||||

|
||||
|
||||
* Connect the `change` node to the `mqtt in` node
|
||||
|
||||
### Dashboard
|
||||
You can now add widget so as to display the value processed above
|
||||
|
||||
* Add a `gauge` node
|
||||
* Add a group and organize your dashboard
|
||||
* Add your value format to process the payload like below
|
||||
|
||||

|
||||
|
||||
* Click on Done
|
||||
* Deploy
|
||||
* Go to your `node-red url`/ui
|
||||
|
||||
You should see the gauge with the last value displayed
|
||||
|
||||

|
||||
|
||||
You can also add easily a chart node:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Or a function with a notification:
|
||||
|
||||

|
||||
|
||||
|
||||
## Integrate RF
|
||||
Here is a simple set of flows for integrating OpenMQTTGateway with NodeRED via an ESP8266 module.
|
||||
|
||||
In this example I have used a Wemos D1 Mini with some cheap RF modules.
|
||||
|
||||