> ## Documentation Index
> Fetch the complete documentation index at: https://docs.signagelab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conditional Playback

> Play images and videos based on the current weather at the screen's location.

A **Conditional Playback** campaign contains several images and videos, each with its own conditions. The screen plays only the media whose conditions currently apply. The conditions are based on the current weather at the screen's location: temperature, weather conditions, and UV radiation. It works well, for example, for offering hot drinks when it's cold and iced coffee when it's hot.

## Before you start

The campaign needs to know where your screens are. You enter the location through a [meta](https://docs.signagelab.com/cms/screens/metas.md) of type **Location**:

1. In the **Meta** section, create a meta of type **Location**, for example *Store location*.
2. Fill in its value (coordinates) for screen categories or for individual screens.

## Create the campaign

**1. Create a campaign and choose the Conditional Playback type**

Create a new campaign as described in [Create a campaign](https://docs.signagelab.com/cms/campaigns/create.md) and in the **Content** step, choose the **Conditional Playback** type.

**2. Choose the location and playback**

* **Location:** the Location meta used to look up the weather for each screen.
* **Playback:** how the media whose conditions apply are played. The options are the same as for the [gallery](https://docs.signagelab.com/cms/campaigns/campaign-gallery.md): **All** (default), **One**, **Random**, **Random one**.

**3. Add media**

Click **Add image or video** and select or upload files in the library. Each media file is added to the **Medias with conditions** section, without conditions for now.

To remove a media file, click the red trash button on the right.

**4. Set the conditions**

Next to a media file, click **Edit conditions**. In the **Conditions** dialog, click **Add condition**, choose the **Condition type**, and fill in the value:

| Condition type | Value |
| - | - |
| **Weather temperature** | **Operator** and **Temperature** in °C |
| **Weather condition** | One of **Clear**, **Cloudy**, **Fog**, **Rain**, **Sleet**, **Snow**, **Thunderstorm** |
| **Weather UV** | **Operator** and a UV index value from 0 to 20 |

The operator can be **Equal**, **Greater than**, **Greater than or equal**, **Less than**, or **Less than or equal**.

![Weather temperature condition less than 10 °C](https://signagelab-alfa-space.fra1.digitaloceanspaces.com/documentation/images/cms/campaign-types/conditional-playback/temperature-condition.en.png)

Confirm the conditions with **Save**. If you add several conditions to a media file, all of them must apply at the same time. To remove a condition, click the red trash button.

**5. Add a fallback media file**

A media file without conditions is a **fallback**. It plays only when the conditions of no other media file apply. We recommend always having at least one fallback media file in the campaign; otherwise, the screen skips the campaign at such times.

![Media with conditions: afternoon tea below 10 °C, lemon tea when it rains, and a fallback cup of coffee](https://signagelab-alfa-space.fra1.digitaloceanspaces.com/documentation/images/cms/campaign-types/conditional-playback/media-with-conditions.en.png)

**6. Set the timing and screens, and publish**

Continue with **Next**. The next steps are the same as for other campaigns; see [Campaign timing](https://docs.signagelab.com/cms/campaigns/timing.md) and [Network](https://docs.signagelab.com/cms/campaigns/network.md). The **Summary** doesn't show a content preview for this type.

> [!NOTE]
>
> The campaign plays only on screens whose layout contains the selected content region. On screens with the *Ticker* layout, choose the **Ticker layout: main area** region; on full-screen screens, choose **Full screen**.

## How conditions are evaluated

* Conditions are evaluated separately for each screen based on the weather at its location.
* The CMS checks the weather and screen content about every 5 minutes, so when the weather changes, the played media change with a short delay.
* If the location meta isn't filled in for a screen or the weather isn't available, no condition applies and the fallback media play.

## FAQ

> [accordion] Can several media files apply at once?
>
> Yes. All media whose conditions currently apply are played according to the selected **Playback**. Fallback media don't play at that time.

> [accordion] How do I set a temperature range, for example 10 to 20 °C?
>
> Add two **Weather temperature** conditions to the media file: **Greater than or equal** 10 and **Less than** 20. The media file plays only when both apply.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.