# Downlinks

The **Downlinks** tab allows you to configure and add downlinks. Once created, each downlink can be sent manually to the device.

To add a downlink, click on the **Add Downlink** button. The **Add Downlink** modal opens.

In the **Name** text box, enter a **name** for the downlink.

In the **Comment** text box, enter additional details about that downlink.

There are two options that you can enable by turning on the following toggle buttons:

* **Pass payload data to downlink** - pass the last uplink payload to the downlink.
* **Activate after uplink** - send the downlink after receiving an uplink.

The downlink payload can be configured using either the **Default** or **Custom** options:

**Default**:

In the **Default** tab, you can configure the downlink payload by providing suitable values for each data field. When you enter values, make sure that they are in the valid range and type.

{% hint style="info" %}
These data fields appear in the Add **Downlink** model box only if they have been added to the **device type** under the **Downlink Data**. To ensure the correct functioning of the downlink, a valid **downlink payload formatter** must also be added to the device type under the **Downlink Data.**
{% endhint %}

Click on the **Save** button.

<figure><img src="/files/Qy1TZ4FHVlsqDAitYaxi" alt="" width="394"><figcaption></figcaption></figure>

**Custom**:

In the **Custom** tab, you can write a custom **downlink payload decoder**, for example, something like this.

```
function decode(payload, params) { 
const red = ('00' + payload.red.toString(16)).slice(-2) 
const green = ('00' + payload.green.toString(16)).slice(-2) 
const blue = ('00' + payload.blue.toString(16)).slice(-2) 
const on = ('00' + payload.on.toString(16)).slice(-2) 
const off = ('00' + payload.off.toString(16)).slice(-2) 
return ${red}${blue}${green}${on}${off} 
}
```

Click on the **Save** button.

<figure><img src="/files/g9VzwN0WlDJH3MyNDFhZ" alt="" width="393"><figcaption></figcaption></figure>

Once added, the downlink will be displayed in the **Downlinks** tab. Similarly, you can add more downlinks that can be used to control different functionalities of a device.

Click on the **Send** button to send the downlink to the device.

<figure><img src="/files/avtZnEeeePvb4XgUPgTi" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.widgelix.com/get-started/devices/downlinks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
