Skip to content

Tasks

Note

We're sorry, this article hasn't been completed or updated yet. We're working on finishing it as soon as possible. In case of any questions, please reach out to our Support Team.

Version 6 of the REST API introduced the task/ resource. Tasks allow you to create and schedule changes to your Device properties. Tasks are associated with one or more devices; they contain a schedule - day/time when the task will be actioned; they contain device physical properties to be changed:

  • txPower
  • interval
  • proximity
  • major
  • minor

Tasks have been created to support:

  • Scheduled power saving
  • ID security

Power saving schedules

{
    "scheduled": "17:00 MON,TUE,WED,THU,FRI",
    "name": "energy-saver-on-0ckw-1429787376771",
    "parameters": {
        "interval": "2000.0"
    },
    "uniqueId": "0CKW"
},
{
    "scheduled": "08:00 TUE,WED,THU,FRI,SAT",
    "name": "energy-saver-off-0ckw-1429787376772",
    "parameters": {
        "interval": "350.0"
    },
    "uniqueId": "0CKW"
}

The above schedule is a typical power saving schedule for a beacon.

The first task object, sets the advertising interval for beacon 0CKW to 2 seconds. The schedule will be applied weekly on MON-FRI at 17:00 UTC.

The second task object will reset the beacon to its normal value. At 08:00 UTC on the following day.

Security schedules

{
    "scheduled": "00:00 FRI",
    "name": "security-0xio-1429787834718",
    "parameters": {
        "minor": "random",
        "major": "random"
    },
    "uniqueId": "0xIO"
}

The minor and major values for Beacon 0xIO will be changed to new random values weekly, at 00:00 hours UTC on Fridays.

Simple schedules

You don't need to specify day of the week for your schedules. You can also create a schedule to repeat every 'x' hours:

{
    "scheduled": "3:00",
    "name": "security-0ckw-1429787376771",
    "parameters": {
        "major": "random"
    },
    "uniqueId": "0CKW"
}

This schedule will change the major id every 3 hours.

{% note|info %} Simple schedules are always in whole hours not minutes. If you do specify minutes for a simple schedule, they will be ignored. {% endnote %}

Handle with care

The task/ resource gives you a lot of flexibility but be aware that you need to treat with care:

  • Changing the proximity UUID can cause unpredictable behavior. Your app may crash if you change this value.
  • Make sure that if you create a 'sleep' task, then don't neglect to create a matching 'wake' task.
  • If you modify the txPower as part of your power saving preset, you may put your beacons outside of the range of your Cloud Beacon.
  • Increasing the interval to more than 2000 ms can also cause communication problems with your Cloud Beacon.