Milesight Gateway support Node-RED feature, Node-RED is a flow-based development tool for visual programming and wiring together hardware devices, APIs and online services as part of the Internet of Things. Node-RED provides a web-browser-based flow editor, which can easily wire together flows using the wide range of nodes in the palette.
This article describes how to use dashboard on Node Red of Milesight Gateway for displaying sensor’s data.
Milesight Gateway: UG6X
LoRaWAN sensor: take Milesight AM104 as example
1. Connect Milesight sensor to Milesight LoRaWAN gateway, please refer to this article: How to Connect LoRaWAN Nodes to Milesight Gateway.
2. Go to App -> Node-RED to enable the Node-RED feature, after enabled, click Launch to go to the Node-RED web GUI and to log in with the same username and password as gateway.
3. Install node-red-dashboard, after installation, you can see it in the list on the left.
4. Create topology like the picture below
- LoRa Input: Receive the LoRa data, please ensure the network server mode is enabled before using this node.
- Device Filter: Filter out the data of one or more specific LoRaWAN® nodes
- Decoder: Decode the Milesight LoRaWAN® end nodes data.
- debug: Displays selected message properties in the debug sidebar tab and optionally the runtime log. By default it displays msg.payload.
- guage: Adds a gauge type widget to the user interface.
5. Device Filter configuration, filter out the data via Device EUI
6. Decoder configuration, in this example, select AM100 Series.
If the sensor is not offered by Milesight, you need to use the component of function instead of Decoder, and then add decode of your sensor in function.
7. Debug configuration, just keep it by default.
8. Guage configuration, edit guage node > Add now dashboard group config node > Add new dashboard tab config node, you need to add new group and new dashboard tab, click Add to finish the configuration.
Configure the value format, you can check the variable from debug.
Note: if you modify some configurations, please remember to click Deploy.
9. Select Dashboard and click the icon in the upper right corner, you will see the dashboard
10. If you need to check battery level in real time, you need to add the component of switch. For some Milesight series sensors, battery level is sent seperated from other sensor data. Take AM100 Series as example, it reports battery status every 24 hours, so if battery level isn’t contained in the payload, the battery level in the dashboard will disappear.