---
title: "Device Sets"
description: "Group devices for redundancy and automatic failover using a priority-ordered set"
source_url: https://ai-ops.com/docs/devices/device-sets
---

# Device Sets

A **device set** is a priority-ordered group of devices that all share the same protocol and expose the same data. The set provides redundancy: at any moment one member is the **active device**, and Koios reads and writes through it. If the active device stops running, Koios promotes the next healthy member so data collection continues without manual intervention.

Device sets are useful when a critical data source has a backup: two OPC-UA servers mirroring the same tags, a primary and standby PLC, or paired gateways on separate network paths.

> [!NOTE] One protocol per set
> Every device in a set must use the same protocol. When you create a set you choose its protocol, and only protocols that support redundancy are offered. A tag can then read from the set only if the tag's protocol matches the set's.

## Creating a Device Set

From the **Devices** area, open **Device Sets**, then select **Add Device Set**. Provide:

- **Name**: a unique label for the set.
- **Description**: optional context.
- **Protocol**: the protocol shared by every member. The list is limited to protocols that support redundancy.

The set is created empty. Add devices to it from the set's detail page.

## Adding and Ordering Devices

Open the set and use the **Failover Priority** card:

1. Select **Add Device**. The picker lists devices on the set's protocol that are not already members.
2. Add one or more devices. Each becomes a member with a **priority**.

Priority is an integer where **1 is the highest**. When Koios needs to choose an active device, it tries members in ascending priority order and picks the first one that is running. Use the up and down arrows on each row to reorder members, which swaps their priority numbers.

## The Active Device

The set tracks which member is currently active, that member's priority, and its live status. All redundant tags in the set read and write through the active device.

Koios manages failover automatically:

- The data collector watches the active device's health.
- When the active device is no longer running (it failed, was disabled, or lost its connection), Koios searches the set for the running member with the highest priority and promotes it to active.
- Every redundant tag in the set is reassigned to the new active device, so those tags keep updating.
- A failover event is recorded noting the previous and new active device.

Failover runs reactively the moment a scan fails, backed by a periodic safety-net check. If no member is running, the set keeps its current active device and reports a stopped or failed status until a member recovers.

## Swapping the Active Device Manually

To force a specific member active, select the check icon next to it in the Failover Priority card and confirm. All tag activity swaps to that device immediately.

Automatic failover still applies afterward. If you make a stopped device active and another member is running, the next health check moves the active device back to the running member. Manual selection holds only while the chosen device stays running.

## Using a Device Set on a Tag

A tag opts into a set through its **General** configuration:

1. Open a device tag and turn on **Use Redundant Device**.
2. The single-device selector is replaced by a **Device Set** selector listing sets on the tag's protocol.
3. Choose the set and save.

The tag now reads and writes through whichever device is active in the set instead of one fixed device. Only device tags support redundancy. Expression tags and in-memory tags do not connect to a device and cannot use a set.

## Cross-References

The set's detail page shows what depends on it:

- **Redundant tags** that read through the set.
- **Devices** that are members.
- **Mapped tags** whose output is bound to the set's active-device fields (active device priority and status).

Review cross-references before restructuring or deleting a set so you know what is affected.

## Deleting a Device Set

Delete a set from the action menu on its detail page.

> [!WARNING] Deleting a set affects its tags
> Deleting a device set does not delete the member devices; it only removes their membership. Redundant tags that read from the set are unlinked from it and stop collecting until you point them at another device or set. Tag mappings bound to the set's active-device fields are deleted. Reassign dependent tags before deleting if you want them to keep collecting.

## What's Next

- [Troubleshoot a Connection](https://ai-ops.com/docs/troubleshoot/connection.md): diagnose why a member device failed and triggered a failover.
- [Tag Introduction](https://ai-ops.com/docs/tags/introduction.md): how tags read from devices, including redundant device tags.
