Set Time Frame

Programmatically send downlinks only within individual timeframe, not on weekends, within the week only.

Guide

In this tutorial, we are going to show you how you can use the downlink editor function to programmatically set a time frame in which a downlink is being queued up.

Please open up your downlink editor or create a new downlink.

Downlink Overview on Datacake Device

Now you can see the downlink editor and here you can paste your custom downlink encoder. This looks like the following:

Downlink Encoder Editor

Now you need to make changes to your existing Downlink Encoder or create a new one. We show you what you need to do in the next chapter.

The Code

Original Encoder

Let's assume you would already have a downlink encoder set up and this would look like the following:

Timeframe Option

Now we will add a timeframe to the above downlink. This will look like the following. You can copy and paste this and only adapt the payload that you want to send.

circle-info

If you now replace the downlink payload from the example with your own downlink payload, you have successfully set up a timeframe downlink.

Timezone Adjustment

triangle-exclamation

For example, if you live in Germany you would likely add additional 2 hours.

Weekend Pause

If you want your automated downlinks to be valid on workdays only (and avoid the weekend) you can adapt the above code by adding a "is it weekend already?" check.

Last updated

Was this helpful?