---
title: "Accessory Scanner Guide"
canonical: "https://docs.xirgoglobal.com/space/SD/486965249/Accessory+Scanner+Guide"
format: markdown
---
# 1. Setting Up the Filters and Configuration

## 1.1 First Steps

Firstly, open/create a configuration template for your device. Inside, go to the `Script` tab and add a new script. 

![image-20250516-094728.png](media://5b40abbf-0d2a-43e8-b02e-44a4941359df)

![image-20250516-094927.png](media://7d8f547f-32b0-47d7-abc6-4610d4ffa16b)

Using the dropdown menu, search for the newest `Accessory Scanner VX.X` script.

![image-20250516-095326.png](media://3cd1c3ce-7ad4-436c-9bf1-686ac9a96a08)


Then go to the script settings and create filters by selecting `Import preset` or adding custom filters by pressing `Add`:

## 1.2 Using filter presets:

To use presets, go to the script settings in the device configuration and select the `Import preset` button.

![image-20250513-114924.png](media://6dd35d34-c5e8-4d1b-8e31-936cdf5dd3f0)

There, you can find already integrated Bluetooth devices and their parameters. When selected, the filters are added to the list. Pay close attention to the Notes section, where instructions are stored.

![image-20250516-102333.png](media://a6d8d7c6-a583-400a-845d-614f9e5735b1)

Open the newly added filter and look at the available fields. 

![image-20250516-101431.png](media://c178ea57-f73d-48b6-9319-7339cf6701cf)

![image-20250516-103226.png](media://4166fba2-9a33-460d-ac21-bc0da76fc34c)

Universal fields that correspond to the specific beacon and data are filled, but to finish setting up the filter, a few things must be done:

- `Filter` - The filter field must be edited according to the beacon used. Usually, name or address filters are used to identify the specific beacons.
- `Sensor` - The sensor assigned to the filter must be selected according to the size of the filtered data. The recommended sensor type will be set in the preset.

> ℹ️ **It is essential to consult the preset notes for detailed accessory setup instructions.** Preset descriptions may contain further steps, like entering a data pattern.

In this ELA temperature beacon example, it is necessary to enter the full beacon name and select a sensor (or use the default one). Fully configured filter looks like this:

![image-20250516-110256.png](media://afb24351-09b1-4745-ac7c-6ec5c0c2f66f)


## 1.3 Creating custom filters

Go to the script settings in the device configuration and select the `Add` button to add a new filter.

![image-20250513-114853.png](media://44898ae2-e8e2-4a9b-a8ec-158518597015)

Fill out the mandatory and optional fields from the payload structure in the beacon documentation.

For this example ELA temperature beacon will be used. The protocol is:

| **Byte Position** | **Data** | **Byte description** | **Bluetooth data fields** |
| --- | --- | --- | --- |
| 1 | 0x02 | Flags data type length | Bluetooth “Flags” data type |
| 2 | 0x01 | Flags data type ID |
| 3 | 0x06 | Bluetooth flags bitfield |
| 4 | 0x05 | Service data length | Bluetooth “Service data (16-bit UUID)” data type with “Temperature” UUID.<br>Temperature data is encoded in **little-endian** format and needs to be divided by 100 to return a temperature float value.<br>In this example:<br>2165 (0x**0875**)/100 = **21.65** °C |
| 5 | 0x16 | Service data ID |
| 6 | 0x6E | Temperature UUID |
| 7 | 0x2A |
| 8 | 0x75 | Temperature LSB |
| 9 | 0x08 | Temperature MSB |
| 10 | 0x0E | Complete Local Name data type length | Bluetooth “Complete Local Name“ data type.<br>For ELA beacons, using a name filter for identification is recommended as it is easier to find than MAC address.<br>In this example, the name is “**P T EN 801803**“ |
| 11 | 0x09 | Complete local ame data type ID |
| 12 | “P” | Name string for ELA temperature beacon |
| 13 | “ “ |
| 14 | “T” |
| 15 | “ “ |
| 16 | “E” |
| 17 | “N” |
| 18 | “ “ |
| 19 | “8“ |
| 20 | “0“ |
| 21 | “1“ |
| 22 | “8“ |
| 23 | “0“ |
| 24 | “3“ |

To get the temperature data from the beacon, there are a few things to note:

- Filter type and filter.
  - In this example, either MAC filter or name filter can be used. They are usually written on the beacon itself or you can find the device using a Bluetooth scanning app ([nRF connect](https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-mobile)) on a phone.
  - It is not uncommon for a beacon to advertise multiple protocols or messages on one identity (MAC address). For this, `Pattern` field must be used additionally to distinguish between the two messages. Refer to the [field description table](https://docs.xirgoglobal.com/space/SD/486309927/BLE+Accessory+Scanner#Filter-configuration-field-descriptions) for more information.
- Start byte or end byte.
  - Start byte and end byte marks the start end the end of value. Using ELA temperature beacon as an example, the temperature data start byte index is `8` and the end byte index is `9`.

> ℹ️ Note: If the documentation specifies offset (byte numbering starts from 0), +1 needs to be added to both start byte and end byte positions to get the correct data.

- Endianess
  - How memory is organised between the start byte and end byte.
  - In the ELA beacon example, the first temperature data byte is the LSB, and the second byte is the MSB. This shows that the temperature field is in Little-Endian (LSB first), and the byte positions must be swapped.
- Sensor
  - The device sensor must be selected according to the value type and size.
  - For the ELA temperature beacon, at least a 16-bit sensor must be selected to fit the temperature data.

Example of a fully configured accessory scanner beacon filter (temperature field from the ELA temperature sensor):

![image-20250516-110251.png](media://52fc4337-1a0b-4568-9f91-2373262d5d97)

---

# 2. Next steps

## 2.1 Interpreting Raw Values

Filtered raw values typically require mathematical operations to transform them into usable parameters, like fuel level or temperature. This conversion can be achieved in two ways: 

1. By developing a separate script to perform calculations with the sensor values.
2. By transmitting the raw data to a server for the calculations to be conducted there.

## 2.2 Finalising the device configuration settings

Telemetry server setup can be found here: [Telemetry setup](https://docs.xirgoglobal.com/space/FMSTC/21597894/Quick+set+up+of+setting+template#b)-Set-address-where-to-send-data.)

Data recording setup can be found here: [Data sending methods](https://docs.xirgoglobal.com/space/FMSTC/21597454/Data+sending+methods)

## 2.3 Loading the settings to the device

After completing the device configuration, you can load it onto the device by either [OTA update](https://docs.xirgoglobal.com/space/FMSTC/21594955/Devices+SDK) or by using [USB](https://docs.xirgoglobal.com/space/SD/27144925/Device+Configuration+-+USB).