Automate

Automate

Make your phone or tablet smarter with automation

Get it on Google Play

Bluetooth device scan

An action block that scans for nearby Bluetooth devices.

The fiber will pause until a new scan has completed.

The arrays assigned to Device names, Device addresses, Device advertisements and Signal strengths are of equal length, sorted in signal strength order. The names array will often contain null elements since a device may only broadcast its name when “discoverable”. The advertisements array may contain dictionary elements with the “advertising” properties emitted by an Bluetooth LE device. The signal strengths array may contain -Infinity elements if the RSSI is unavailable for the device.

  • Discovery scans may only find devices in a “discoverable” state, i.e. awaiting pairing.
  • Low energy scans may only find Bluetooth LE devices “beacons” advertising their presence.
  • Active scans will initiate a new scan.
  • Passive scans will await results of scans initiated by other apps, not initiating a new scan.

Filters

Required for Low Energy scans while the screen is off on Android 14+, and Android 8.1+ on Samsung devices, otherwise the scan results will be empty. Filters expects an array of dictionaries where each entry is describing a “filter” of properties a device must have to be included in the results:

Device address

An "address" entry where the value is a text with the address of the device.

Device name

An "name" entry where the value is a text with the name of the device.

Advertising, generic 1 (Android 13+)

An "advertising" entry where the value is a dictionary with a key:

  • "type" where value is a type number of the advertising, e.g. 0x0A for Transmit power.

Eddystone advertising 2

An "eddystone" entry representing an Eddystone beacon where the value is a dictionary with either key:

  • "uid" where value is a text of the hexadecimal encoded Beacon ID of the UID beacon, 32 characters/16 bytes.
  • "url" where value is a text of the URL of the URL beacon.

iBeacon advertising 3

An "iBeacon" entry representing an iBeacon where the value is a dictionary with any of keys:

  • "uuid" where value is a text of UUID for the beacon.
  • "major" where value is a major version number of the beacon.
  • "minor" where value is a minor version number of the beacon.

Manufacturer Specific advertising 3

An "manufacturerSpecific" key where the value is a dictionary with a key:

  • "companyId" where value is a company identifier number of the manufacturer specific advertising, e.g. 0x004C for Apple, Inc.

Service advertising

An "service" entry where the value is a text of UUID for the service advertising.

Service Data advertising 2

An "serviceData" entry where the value is a dictionary with a key:

  • "uuid" where value is text of UUID for the service data advertising, e.g. 0000feaa-0000-1000-8000-00805f9b34fb for Google LLC.

Service Solicitation advertising (Android 10+)

An "serviceSolicitation" entry where the value is a text of UUID for the service solicitation advertising.

URI advertising 1

A "uri" entry where the value is an text of URI. (Android 13+).

1 2 3 kind, only one per filter entry.

Advertisements

A dictionary, one for each device, describing the advertisements it emits:

Eddystone advertising

An "eddystone" entry representing an Eddystone beacon where the value is a dictionary with keys:

  • "uid" where value is a text of the hexadecimal encoded Beacon ID of the UID beacon, 32 characters/16 bytes.
  • "url" where value is a text of the URL of the URL beacon.
  • "batteryVoltage" where value is a number with the battery voltage in mV of the TLM beacon.
  • "hardwareTemperature" where value is a number with the temperature in degrees Celsius of the TLM beacon.
  • "framesEmitted" where value is the number of advertisement frames of all types emitted by the TLM beacon since power-up or reboot.
  • "uptime" where value is the number of seconds since the TLM beacon powered-up or rebooted.

iBeacon advertising

An "iBeacon" entry representing an iBeacon where the value is a dictionary with keys:

  • "uuid" where value is text of UUID for the beacon.
  • "major" where value is a major version number of the beacon.
  • "minor" where value is a minor version number of the beacon.

URI advertising

An "uri" entry where the value is an text of URI.

Transmit power level property

An "txPower" entry where the value is a number with the transmission signal strength in dBm of the beacon, from either a Transmit power advertising, or another kind of advertising that includes a transmit power level property.

Note! This feature may require that the system Location setting is enabled on Android 6+.

Input arguments

  • Scan mode — mode of scanning, default is Active discovery.
  • Device type — type of device, default is any.
  • Filters — array of filters of devices properties it must have to be included in the scan result, maybe required for Low Energy scans while the screen is off, default is no filter.
  • Paired devices — whether to only include paired devices, default is no.
  • Connectable only — whether to only include devices advertising as connectable, only works for Low Energy scans. (Android 8+)

Output variables

  • Device addresses — variable to assign an array of device addresses.
  • Device names — variable to assign an array of device names.
  • Device advertisements — variable to assign an array of advertisements, only available for Low Energy mode.
  • Signal strengths — variable to assign an array of signal strengths, in dBm.
Note! This documentation is also accessible within the app from Help & feedback menu.