Skip to main content
On a product’s Devices page you can search with free text or a query expression, narrow with filters, change tags or deployment groups for every match, and export what you see as CSV.

Requirements

  • NervesHub 2.5.0 or later for the query language, the Columns panel, bulk tagging, bulk import, and bulk actions on every matching device.
  • nh device list --query needs NervesHub 2.5.0 or later. nh checks the server first and refuses to run the query against an older one.
  • Queries on metric:<key> read the latest value each device reported. See Health monitoring for how devices report metrics.
The search bar sits above the list. Press / to focus it, type, and press Enter. Text that is not a query expression is a free-text search. NervesHub looks for it in the identifier, firmware version, platform, and tags, ignoring case. The bar rewrites it to the query it ran, such as search like "%kitchen%". A typo in a query expression shows the parse error instead of falling back to free text.

The query language

A query is one or more comparisons joined with and, or, and not. Use parentheses to group. and binds tighter than or.
Each comparison is a column, an operator, and a value. Values are double-quoted strings, except metric:<key> values, which are bare numbers. Column names, operators, and keywords are not case sensitive. The search bar suggests columns, operators, and values as you type.

Columns

Values other than LIKE patterns and metric numbers must be one of the known values for your product. A platform, tag, or deployment group name that no device has is rejected. Special cases:
  • last_seen only matches offline devices. last_seen > "7 days ago" means last seen less than 7 days ago. last_seen < "7 days ago" means longer ago.
  • ":not_set" matches devices with no value: no tags, no deployment group, or no signer CA.
  • deployment_group != "name" also matches devices with no deployment group.
  • connection = "not_seen" matches devices that have never connected.
  • connection = "asleep" matches devices that said they were going to sleep, including ones now overdue. See Devices that sleep.
  • Deleted devices are left out unless the query uses the deleted column.

Filters and tabs

The tabs across the top (All, Online, Needs attention, Updating, Offline) slice the list by state. See Fleet overview for what each holds. Filters opens a panel of filters grouped as Status, Firmware, Fleet, Alarms and metrics, and More. The panel applies as you change it. Each choice shows how many devices it would give alongside the other filters. Choices within one filter widen the result. Different filters narrow each other. A query in the search bar narrows the result further. Applied filters show as tokens under the search bar. Reset filters clears them. Filters and the query are kept in the page’s URL, so you can share a link to a filtered list.

Columns

Columns opens a panel where you choose which columns the table shows: Health, Firmware, Platform, Deployment group, Connection, and Tags. The device column always shows. The choice is saved to your account, so every product’s devices list shows the same columns.

Bulk actions

Select devices with the checkboxes. A bar appears at the foot of the list with the count and the actions your role allows. Select all in the bar extends the selection from the devices on the page to every device that matches the current tab, filters, and query. The built-in Manage and Admin roles hold all of these. A custom role sees only the actions it holds. See Roles. Limits:
  • Send firmware only works on devices selected on the page, not on every match. Filter the list to one platform first, so the firmware offered fits every selected device.
  • Move to product to a product in another organization needs the Manage role in that organization too.
  • When an action runs on every matching device, one device failing does not stop the rest.

Bulk import

Bulk import creates devices, with their certificates, from a manifest. The only format NervesHub reads is the Microchip Trust&Go manifest: the JSON file Microchip supplies with pre-provisioned ATECC608 secure elements. Each entry’s header.uniqueId becomes the device identifier, and the first x5c certificate in its publicKeySet is registered to the device. There is no import form in the web UI. Use the CLI or the API. Both need the device:create permission.
1

Check the manifest

--dry-run checks every entry the way the server reads it and sends nothing. It needs no login.
2

Import it

--tag puts the same tags on every new device. Pass - instead of a file to read the manifest from standard input. nh sends nothing unless every entry is good.
3

Check the result

NervesHub creates the devices in the background. When it finishes, it posts a notification on the product’s Notifications page saying how many devices were added and how many failed.An entry can fail there for reasons nh cannot see, such as an identifier or certificate already in use.
The API endpoint is POST /api/orgs/{org}/products/{product}/devices/import, with the manifest as the JSON body.

Export

The download button at the top of the devices list (Export devices) downloads a CSV of the devices that match the current tab, filters, and query. The file is named <product>-devices.csv. Its columns are identifier, description, tags, product, org, and certificates.

Query from the CLI and API

nh device list takes the same query language with -q or --query:
--query combines with --filter key:value flags. Results must match both. Use --sort, --page, and --page-size to order and page the results. Run nh device list --help for the filter keys and sort columns. The device list API takes the query as the advanced_query filter. An expression that does not parse is rejected with the parse error.