# Device Widgets

Each widget has its own settings, similar to those on a [Device Dashboard](https://docs.blynk.io/en/blynk.console/templates/dashboard) but adjusted slightly to work correctly with multiple devices.&#x20;

Device widgets can be used to perform management actions such as turning devices on or off or updating values. They can also display data from multiple devices and visualize them on a map or floor plan.

Available Device widgets:

* [Switch](https://docs.blynk.io/en/blynk.console/dashboards/controls#switch)
* [Slider](https://docs.blynk.io/en/blynk.console/dashboards/controls#slider)
* [Label](https://docs.blynk.io/en/blynk.console/dashboards/device-widgets/label)
* [Device Table](https://docs.blynk.io/en/blynk.console/dashboards/device-widgets/device-table)
* [Chart: Metrics over time](https://docs.blynk.io/en/blynk.console/dashboards/charts#metrics-over-time-agg)
* [Chart: Metrics by device](https://docs.blynk.io/en/blynk.console/dashboards/charts#metric-by-device)
* [Image Map](https://docs.blynk.io/en/blynk.console/dashboards/device-widgets/image-map)
* [Geomap](https://docs.blynk.io/en/blynk.console/dashboards/device-widgets/geomap)

<div align="left"><figure><img src="https://1839001309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBFTVMf7L6S67HOuqVC%2Fuploads%2FGDY2VpNSV95QAes5nAMv%2F12_device_metrics_widgets.avif?alt=media&#x26;token=d467e162-12f3-4d8f-8a76-81604f97fec2" alt=""><figcaption><p>Device Metrics Widgets</p></figcaption></figure></div>

### How to configure

Device widgets are designed to display or interact with datastream values, offering insightful data visualization and control.

#### Datastreams

All device metrics widgets require an assigned datastream to function. To streamline this process and enhance your experience, we’ve developed a **Virtual Pin** approach for datastream selection.

Instead of manually mapping multiple datastreams one by one, you only need to select a single Virtual Pin. All datastreams associated with that Virtual Pin will automatically be assigned to the widget, saving time and reducing complexity.

This approach simplifies widget setup and ensures a seamless connection to the data you need.

{% hint style="warning" %}
Before creating a dashboard, standardize the datastreams across the templates included in it so that the corresponding Virtual Pins contain the same data. For example, V1 represents Brightness across all templates.
{% endhint %}

E.g. You have launched a new product model. And you want to add the data from it to one of your existing dashboards. If you have datastreams standardized the same way as for the existing products, you just need to add the new product (template) to the dashboard data source and all of your widgets will be updated immediately.

#### Data Types

Current widgets support only Integer and Double data types. Datastreams of any other type will be ignored and excluded from calculations.

{% hint style="success" %}
For example, if you set the V1 Pin to display the Average value in a Label widget, and V1 uses the Integer type in four templates but String type in two, the calculation will only include the four Integer datastreams. The two String datastreams will be ignored, regardless of the data selection.
{% endhint %}

#### How to select datastreams

To select datastreams, choose a row from the dropdown. The dropdown displays all datastreams, grouped by Virtual Pin, based on the templates included in the dashboard's data source.

<figure><img src="https://1839001309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBFTVMf7L6S67HOuqVC%2Fuploads%2FnZb8RT498lXD6D6Q5i4r%2F14_select_datastream.avif?alt=media&#x26;token=dec81d01-1e9b-4d2d-8d4b-9e3c13441fea" alt=""><figcaption><p>Select datastreams grouped by Virtual Pin</p></figcaption></figure>

Once you select the row, assigned datastreams preview appears on the right, displaying the datastreams associated with the selected Virtual Pin across all templates included in the dashboard. This preview helps you quickly assess the data and confirm that the correct datastreams are connected for each template.

<div align="left"><figure><img src="https://1839001309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBFTVMf7L6S67HOuqVC%2Fuploads%2FpwHjIaQMJXxSra5lZwJu%2F15_datastreams_preview.avif?alt=media&#x26;token=d98f53eb-ef38-44c2-936c-107ec1305756" alt=""><figcaption><p>Assigned datastreams preview</p></figcaption></figure></div>

#### Aggregation types

Blynk supports 4 aggregation types across all widgets: Average, Min, Max, and Sum.

Also the **Label widget** supports additional aggregation type - **Latest value**.&#x20;

{% hint style="info" %}
**Latest value** aggregation type is available only if **1 device** is selected and updates its latest value once in a 10 sec.
{% endhint %}

<div align="left"><figure><img src="https://1839001309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBFTVMf7L6S67HOuqVC%2Fuploads%2FflLKGCSnAPINfxPSN9sC%2F16_aggregation_types.avif?alt=media&#x26;token=e94bdc7f-7617-48e6-8bb6-6e5cd195f791" alt="" width="563"><figcaption><p>Aggregation types</p></figcaption></figure></div>

&#x20;&#x20;

#### Decimals

Determines the number of decimal places displayed for numerical values in the widget (e.g., #.## for 25.35).

#### Units

Specifies the measurement unit to display alongside values (e.g., °C, %, kWh) for clarity and context.

{% hint style="warning" %}
Note that this is purely a label and does not involve any unit conversion of the values.
{% endhint %}
