Ai-OPs
ai-ops.com
Docs
/
Devices
/

Importing & Exporting Devices

Importing & Exporting Devices

You can import and export device configurations as CSV files. Both run from the Actions menu on the Devices page. This is useful for bulk-creating devices across protocols, migrating configurations between Koios instances, or editing device settings in a spreadsheet.

Exporting Devices

How to Export

There are two ways to export device configurations:

  1. Selected devices: tick one or more devices, then open the Actions menu above the table and choose Export config for N devices. Only the selected devices are exported.
  2. All devices: with nothing selected, the same menu offers Export config for all N devices, which includes every device in the system.

The export downloads a file named devices.csv containing one row per device.

What's Included

The CSV contains all configuration fields for each device: general settings and protocol-specific fields. Every column is included regardless of protocol, so columns that don't apply to a particular device's protocol will be empty.

CSV Columns

The export includes these columns:

Core fields:

ColumnDescription
idDatabase ID (primary key)
slugUUID identifier
nameDevice name (unique)
descriptionOptional description
enabledWhether the device is actively scanning
protocolProtocol ID (foreign key)
scan_ratePolling interval in seconds (0.1–3600)
heartbeat_scansNumber of scans before heartbeat toggle
on_demand_freshnessMax age of tag data in seconds for on-demand reads
on_demand_batch_windowTime window for batching on-demand requests
parentFolder ID (if organized in folders)

Protocol-specific fields:

ColumnsProtocol
opcua_endpoint, opcua_security_mode, opcua_security_policy, opcua_token_type, opcua_username, opcua_password, opcua_timeout, opcua_certificateOPC-UA
modbus_hostname, modbus_port, modbus_unit_id, modbus_timeout, modbus_show_one_based, modbus_max_registers_per_readModbus TCP
ethernet_ip_hostname, ethernet_ip_type, ethernet_ip_controller_slot, ethernet_ip_timeout, ethernet_ip_eds_fileEtherNet/IP (all types)
soap_hostname, soap_type, soap_timeout, soap_rdm_username, soap_rdm_password, soap_rdm_web_authenticationSOAP (RDM)
rest_url, rest_type, rest_timeout, rest_auth_type, rest_verify_ssl, rest_username, rest_password, rest_max_retriesREST (BOSS)
sql_driver, sql_hostname, sql_database_name, sql_username, sql_password, sql_timeoutMicrosoft SQL

Audit fields (read-only):

ColumnDescription
created_atCreation timestamp
updated_atLast modification timestamp
last_modified_byUser who last modified the device

Importing Devices

How to Import

  1. Navigate to the Devices page
  2. Open the Actions menu above the table and choose Import devices from CSV
  3. Select a CSV file from your computer
  4. Review the preview to verify what will change
  5. Click Confirm Import to apply the changes

The menu item is disabled if your account lacks permission to manage devices.

CSV Format

The import expects a CSV file with column headers matching the export format. You don't need to include every column, only the fields you want to set. At minimum, new devices require a name and protocol.

How the import determines what to do with each row:

ConditionAction
id column is emptyCreate a new device
id matches an existing device and fields differUpdate the existing device
id matches an existing device and nothing changedUpdate the device, with no fields altered
Row has validation errorsError: row is not imported

Example: Creating New OPC-UA Devices

To create new devices, leave the id column empty. Provide at least a name and protocol (by ID):

id,name,protocol,enabled,scan_rate,opcua_endpoint,opcua_security_mode,opcua_token_type,opcua_timeout
,AHU-1 Controller,1,True,1.0,opc.tcp://192.168.1.10:4840,None,0,5
,AHU-2 Controller,1,True,1.0,opc.tcp://192.168.1.11:4840,None,0,5
,Chiller Plant,1,True,2.0,opc.tcp://192.168.1.20:4840,None,0,10

Example: Creating Modbus TCP Devices

id,name,protocol,enabled,scan_rate,modbus_hostname,modbus_port,modbus_unit_id,modbus_timeout
,Power Meter 1,2,True,1.0,192.168.1.50,502,1,5
,Power Meter 2,2,True,1.0,192.168.1.51,502,1,5
,VFD Controller,2,True,0.5,192.168.1.60,502,2,5

Example: Updating Existing Devices

To update existing devices, include the id column with the device's database ID. Only the fields you include will be checked for changes:

id,scan_rate,enabled
12,2.0,True
13,2.0,True
14,5.0,False

Preview Step

After selecting a file, Koios performs a dry run. It processes the CSV without saving anything and shows you exactly what will happen:

  • Counts: how many devices will be created, updated, or rejected, and how many of the file's columns change at all
  • Row details: select any row to open a panel showing each changed field, with its current value above the new one
  • Filtering: search the rows, or narrow the grid to one action — rejected rows sort to the top and are marked
  • All columns: the grid shows only the columns your file changes. Switch it to show every column when you want the full picture

Validation Rules

The import validates each row against the same rules as the create/update forms:

FieldValidation
nameRequired, max 128 characters, must be unique
descriptionMax 256 characters
protocolMust reference an existing protocol ID
scan_rateNumber between 0.1 and 3600
enabledBoolean value
Protocol fieldsValidated against protocol-specific constraints

Boolean fields accept: True/False, true/false, 1/0, yes/no.

Foreign key fields (protocol, parent, opcua_certificate) expect integer IDs.

After Import

Once you confirm the import:

  • Devices are created or updated in a single transaction. If anything fails, all changes are rolled back
  • An audit event is recorded (e.g. "Imported 10 devices") with your username
  • The device table automatically refreshes to show the updated list
  • Imported devices begin connecting on the next scan cycle if they are enabled

Tips

  • Bulk-create devices for a new site: create one device per protocol, export it, duplicate the rows in your spreadsheet, change the names and addresses, clear the id column, and import.
  • Move devices between Koios instances: export from one instance, clear the id and slug columns, verify the protocol IDs match the target instance, and import on the target.
  • Audit trail: every import creates an event visible on the Events page, grouped under a single parent event so you can see what was imported in one action.
  • Read-only columns: id, slug, created_at, updated_at, and last_modified_by are ignored on create. You can leave them in the CSV (useful when round-tripping an export) but they won't overwrite system-managed values.
  • Sensitive fields: credentials (opcua_password, soap_rdm_password, rest_password, sql_password) are included in exports. Handle exported CSV files carefully if your devices use authenticated connections.