List Devices
GET/devices
Paginated device information query, supporting filter by space, online status, associated gateway, device type, and device name. Filtering by protocol instance ID, instance name, public protocol type, and network protocol mask is supported.
Multiple values within the same list are combined with OR; multiple bits in the mask are OR’ed; different filter types and existing query conditions are combined with AND. Filtering is performed first, followed by totalCount calculation, sorting, and pagination.
If no filter is provided, the default behavior is preserved; if all three lists are empty, there’s no restriction; unknown values will not match. protocolNames requires a complete and case-sensitive match; Home Assistant does not match Home Assistant(1).
You may call /devices/filter-options first to obtain currently available instances; use the name for display, but we recommend using the stable id for persistent storage or specifying an instance. Protocol types are determined by server configuration, not all instances are required to have a type or networkProtocolMask. networkProtocolMask filters according to the type configuration of the instance, and does not read device's real-time NetworkProtocolSupport Trait. If omitted, there’s no restriction; if set to 0 or there’s no match, the result is empty.
For each device, protocolId and networkProtocolMask are returned if available: the former is the associated protocol instance ID, the latter is the complete configured mask for that instance type (bits are not trimmed to match the query). If there is no associated instance, both fields are omitted; if there is an instance but no configured mask, only protocolId is returned. For ordinary queries or those filtered only by instance ID/name, an invalid mapping will only omit the mask in the response; filtering by type or nonzero mask still requires valid configuration.
gatewayId—when omitted, empty, or contains only whitespace—does not participate in filtering; if a non-empty value is provided, leading and trailing whitespace are trimmed and an exact match is performed. Gateway filtering is applied together with other query conditions and takes effect before pagination.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 429
- 500
Request succeeded
Query parameter error; this error is returned when networkProtocolMask is duplicated (even if containing empty values), non-empty and not a decimal integer, or out of Uint32 range. A single empty value or only whitespace will be ignored.
Unauthorized or authentication expired
No permission to access
Resource not found
Request frequency too high
Returns 500 if protocol mapping needs to be read (when non-empty protocolTypes or non-zero networkProtocolMask are specified) and the mapping configuration is invalid; other internal errors may also result in a 500. If networkProtocolMask=0, an empty result is returned directly, and even if protocolTypes is specified, protocol mapping reading and validation are skipped—invalid mapping configuration will not cause a 500 in this case.