Milesight LoRaWAN gateway has built-in Node-Red, which can help user to simulate and set up related solutions easily. This guide we will use gateway embedded Node-Red function to change digital output status of UC501, to make irrigation equipment work according to the soil humidity detected by EM500-SMT.


  • Milesight LoRaWAN Sensors and Controller
  • Milesight UG6X Series LoRaWAN gateway



Step 1: Follow this guide to make EM500-SMT and UC50x activate in gateway embedded network server.

Step 2: Access to gateway web GUI, go to APP > Node-RED, Enable it, then Save and Apply it.

Step 3. Click Launch, fill in Username and Password (The same information used to login) to go to Node-Red portal.

Step 4. Add all modules to Flow interface.

1)LoRa Input : To get all uplink message from Sensor in network server.

2)Device Filter: Filter device by Device EUI. Here we configure it to filter EM500-SMT and UC50x by their device EUI.

3)Decoder: Embedded Milesight LoRaWAN Node decoder code, choose model to use directly. Choose corresponding decoder for EM500 and UC here.

4)Switch: Use to set up judgement condition(If…). More Milesight sensor parameter information in decoder code, get from here.

5)Debug: Display selected message properties in the debug sidebar tab and optionally the runtime log. Here, we use it to see UC50x and EM500 uplink package content, keep Output as payload by default.

6)LoRa Output: Send downlink command to other device. Here, we will send two type downlink command to change DO status of UC50x.

A. Change DO to High status, when soil humidity from EM500-SMT is smaller than 60%.

B. Change DO restore to Low status, when humidity value from EM500-SMT is larger than 60%.

Step 5. Click Deploy to save and apply all configuration.

Step 6. When humidity value is lower than 60%, Go to gateway Network Server > Packets page, we will see that there is downlink message to UC50x to change output port status high.

After receiving ACK command, we will double check MSG module, click Debug message Icon, we will see that the digital output of UC50X change to high status.


1. When I use third party sensor, how can I add decoder code to gateway Embedded Node-Red?

A: Please Add Function module to develop decoder code by yourselves.