Bosch IoT Manager

Working with filters

Filters are saved in the database as filter entries containing a search filter (а query) and a name by which the query can be reused. They serve as dynamic groups whose members vary according to the current state of the devices being filtered.

The following examples show you how to create a filter entry, how to get an existing one, list all created filter entries, as well as how to list all devices matching the filter saved in the particular filter entry.

Create a filter entry

Execute the following code to create a filter entry according to the specified parameters - a name and a query. In the example, the filter entry name will be myAttributeDevices and the query will filter all devices having the attribute myAttribute:


Get a filter entry

Get an existing filter entry, such as myAttributeDevices from the example above:


List filter entries

List all filter entries recorded in the database, grouped in pages of 10 elements each:


List devices using а FilterEntry object

List all devices matching the filter of a particular filter entry, grouped in pages of 10 elements each:


Get devices using a filter entry

Use an existing filter entry to get devices:

 .thenCompose(filterEntry -> deviceInventory.devices(filterEntry.filter()));

Filters can have attributes, described in more detail in Working with attributes.