Telemetry2U Technical Bulletin

How to Automate LoRaWAN Device Control with Alerts

Create alert-triggered actions that automatically control a connected device. This example switches a Milesight WS52x Smart Wall Outlet according to soil moisture readings from a Dragino LSE01 sensor.

Platform areas: Actions and Alerts Example devices: WS52x and LSE01 Network: LoRaWAN

Use Sensor Data to Trigger Device Commands

Telemetry2U Actions can send supported device commands when an alert condition is met. In this example, the outlet turns on when soil moisture falls below 15% and turns off after moisture rises above 25%.

The separate on and off thresholds create a control band between 15% and 25%. This avoids repeatedly switching the outlet when readings fluctuate close to a single threshold. The same method can be adapted to compatible relays, pumps, ventilation equipment, lighting and other controllable devices.

Telemetry2U account access

Sign in to an account with access to Actions Maintenance and Alert Maintenance.

Configured sensor and controller

Add the Dragino LSE01 and Milesight WS52x to the same Telemetry2U account before creating the automation.

Working LoRaWAN connection

Confirm that sensor uplinks are arriving and that the network path supports downlink commands to the outlet.

Suitable connected equipment

Keep the controlled load within the outlet manufacturer's electrical ratings and installation requirements.

Before automating live equipment: test the actions with a non-critical load and confirm that manual control, command delivery and status reporting all work as expected.

1. Create the Turn On and Turn Off Actions

Create two clearly named actions: one that sends the WS52x power-on command and another that sends the power-off command. The alert conditions will reference these actions in the next stage.

  1. Sign in to Telemetry2U and open Admin > Actions Maintenance.
  2. Select Create New.
  3. Enter a clear description such as Turn WS52x On, then select Create.
  4. Under Add Node to Action, select the Milesight WS52x.
  5. From the Command list, select Turn On Power.
  6. Leave Parameter blank and select Save.
  7. Repeat the process with a second action named Turn WS52x Off using the Turn Off Power command.
Telemetry2U Action Details page with the Milesight WS52x selected and Turn On Power chosen as the command
Create a separate action for each required outlet state.

2. Create the Soil Moisture Alert Conditions

Create one alert containing two conditions. The low condition turns the outlet on, while the high condition turns it off after the soil moisture has recovered.

  1. Open Admin > Alert Maintenance.
  2. Select Create New.
  3. Enter a description such as Soil Moisture Automation.
  4. Select Save to open the full alert configuration.
  5. Under Alert Conditions, add the Dragino LSE01 sensor twice so each threshold can use its own action.

Low-Moisture Condition

Use this condition to turn the outlet on when the soil becomes too dry.

  • Input: Moisture
  • Comparison: Less Than
  • Threshold: 15
  • Consecutive Readings: 1
  • Minutes Between Alerts: 60
  • Alert Action: Turn WS52x On
  • Send on Recovery: Checked
  • Recovery Action: Leave blank
  • Active: Checked

High-Moisture Condition

Use this condition to turn the outlet off after sufficient moisture has been restored.

  • Input: Moisture
  • Comparison: Greater Than
  • Threshold: 25
  • Consecutive Readings: 1
  • Minutes Between Alerts: 60
  • Alert Action: Turn WS52x Off
  • Send on Recovery: Checked
  • Recovery Action: Leave blank
  • Active: Checked

Select any notification groups that should also receive email, SMS or voice notifications. Leave the notification groups unselected when the alert is being used only for automation. Select Save after reviewing both conditions.

Telemetry2U Alert Details page with low and high soil moisture conditions linked to WS52x on and off actions
The two conditions create separate on and off thresholds within one alert.

3. Test and Verify the Automation

Display the WS52x outlet status and LSE01 soil moisture input on the same dashboard. This makes it easier to confirm the sensor reading, triggered action and resulting outlet state during testing.

  1. Add the WS52x power status and LSE01 soil moisture input to a Telemetry2U dashboard.
  2. Use manual dashboard controls to confirm that the outlet can turn on and off correctly.
  3. Test the alert logic under controlled conditions or temporarily use safe test thresholds.
  4. Confirm that the outlet turns on after moisture falls below 15%.
  5. Confirm that the outlet turns off after moisture rises above 25%.
  6. Restore the intended thresholds and reconnect the final load only after the full sequence has been verified.

The dashboard may not update at the exact moment a command is issued. Allow time for the downlink to be delivered and for the device's next status message to confirm the resulting outlet state.

Telemetry2U dashboard displaying WS52x outlet status, electrical measurements and Dragino LSE01 soil moisture readings
Review the sensor value and outlet status together while testing the automation.