How to Schedule Mass-Downlinks (Multicast) using Datacake Rule Engine

This document provides a detailed guide on triggering mass downlinks (multicast/broadcast) on a time-based schedule using the Datacake Rule Engine, allowing you to send downlinks to multiple devices.

Overview

This document provides a detailed guide on how to trigger mass downlinks (also known as multicast or broadcast downlinks) on a time-based schedule using the Datacake Rule Engine. This capability allows you to define a schedule for sending downlinks to multiple devices at once, addressing a common and critical use case for many customers.

Video Guide

It is very important that you read this section before we start showing you how setting up downlink schedulers or multicast downlink works.

On the Datacake rule engine, we have two different types of actions for downlinks: Single device downlink and multi-device downlink. Essentially, single device sends a single downlink and multi-device sends a downlink to a group of devices. You might assume that for sending a multicast downlink, you would choose the multi-device downlink. However, this is only the case if you are not working with time-based actions. We will explain the difference between the two, but it is important to read this section beforehand.

A single-device downlink is used when the product you create the rule on contains multiple devices. This setup is common for time-based schedules. For instance, if you set a rule to trigger every morning at 9 AM for a product with 100 devices, the rule will execute for all these devices simultaneously.

When configuring the action for a single-device downlink:

  • Select "Single Device Downlink": This is necessary because the rule will apply to each device in the product.

  • Choose "Triggering Device": The triggering device is the device or all the devices on which the rule is executed. Each device in the product triggers the downlink action individually according to the schedule.

This approach ensures that each device in the product receives the downlink at the specified time.

Multi-device downlinks are used when the product you are creating the rule on does not contain the devices you want to send the downlink to. This scenario typically occurs with measurement-based triggers from an external sensor.

For example, you might have an outdoor temperature sensor and set a condition that if the temperature falls below 10 degrees, you want to switch off all heating devices. Since the triggering device is the single temperature sensor, you need to:

  • Select "Multi-Device Downlink": This allows you to send a downlink to multiple devices based on the condition met by a single triggering device.

  • Select the Target Product: Instead of specifying each device individually, you can select a product (group of devices) and define a single downlink action.

In both single-device and multi-device downlink cases, this setup ensures that you can control a large number of devices (hundreds or even thousands) with a single rule. This method is efficient and scalable, making it easy to manage extensive IoT deployments with minimal effort.

Step 1: Create a New Rule

  1. Log in to the Datacake platform and navigate to the workspace containing your devices.

  2. Click on "Rules" in the left-hand menu.

  3. Click on "Create New Rule".

Step 2: Select the Product

  1. Choose the product that includes the devices you want to control. For instance, select the "McClymit Viki" product, which contains all 108 devices you want to manage.

  2. Optional: Define device groups using tags if you only want the rule to apply to specific subsets of devices.

Step 3: Define the Time-Based Trigger

  1. Select "Time-Based Schedule" as the trigger type.

  2. Configure the Schedule:

    • Deselect "Saturday" and "Sunday" if you do not want the rule to run on weekends.

    • Set the time to 5:00 AM for the rule to execute each weekday morning.

  3. Confirm the Trigger: Ensure the rule is set to activate at the specified time for all selected devices.

  1. Add a New Action and select "Single Device Downlink".

  2. Configure the Downlink:

    • Select the downlink type relevant to your needs (e.g., "Set Temperature").

    • Define the parameters for the downlink (e.g., set the temperature to 22 degrees).

  3. Set the Action Scope:

    • Since the rule is triggered based on a time schedule for all devices in the selected product, the downlink will be sent to all devices.

  4. Name the Action: For example, "Weekday Morning Temperature Set".

  5. Save the Rule: Click "Save" to finalize the rule.

Summary

By following these steps, you will have created a rule that automatically sends a downlink to all selected devices at 5 AM on weekdays, setting the temperature to 22 degrees.

Step 1: Create a New Rule

  1. Log in to the Datacake platform and navigate to the workspace containing your devices.

  2. Click on "Rules" in the left-hand menu.

  3. Click on "Create New Rule".

Step 2: Select a Product

  1. Choose the product that contains the external sensor. For example, select the "SenseCAP" product which has an outdoor temperature sensor.

Step 3: Define the Trigger

  1. Select "New Measurement" as the trigger type.

  2. Define the Condition:

    • Choose "Average of Last Hour" for the temperature measurement.

    • Set the condition to "greater than 15 degrees".

Step 4: Configure the Action

  1. Add a New Action and select "Multi Device Downlink".

  2. Configure the Downlink:

    • Select the target product (e.g., "McClymit Viki").

    • Define the downlink parameters (e.g., set temperature to 12 degrees).

  3. Name the Action: For example, "External Temperature Shutdown".

  4. Save the Rule.

Summary

This rule will monitor the external temperature sensor and, if the average temperature over the last hour exceeds 15 degrees, it will send a downlink to all devices in the selected product to set the temperature to 12 degrees.

Example Scenario: Morning Temperature Adjustment

Objective

Set all "Mclimate Vicki" devices to a specific temperature every weekday morning at 5 AM.

Steps

  1. Create a Time-Based Rule:

    • Navigate to "Rules" and create a new rule.

  2. Select the Product:

    • Choose "Mclimate Vicki Product" which includes all relevant devices.

  3. Define the Time-Based Trigger:

    • Set the schedule to weekdays at 5 AM.

  4. Configure the Downlink Action:

    • Select Single Device Downlink

    • Set the action to adjust the temperature to 22 degrees.

    • Name the action and save the rule.

Result

At 5 AM every weekday, all "McClymit Viki" devices will automatically receive a downlink to set their temperature to 22 degrees.

Conclusion

The Datacake Rule Engine's capability to schedule mass downlinks on a time-based schedule is a powerful feature for managing large groups of devices. By following the steps in this documentation, users can efficiently create rules that automate downlink scheduling, ensuring consistent and synchronized control over their IoT devices. This functionality is crucial for applications requiring regular and simultaneous updates across multiple devices.

Last updated