Skip to main content

Bluetooth Low Energy

The Bluetooth Low Energy component is called BLE. It handles bluetooth services of a device. The Bluetooth Low Energy component uses BLE as RPC namespace and provides the methods:

It uses the key ble when enumerated in objects including multiple component payloads, like Shelly.GetStatus.

Observer

To support Shelly Bluetooth peripheral devices, the BLE component can act as a perpetual BT LE Observer. When enabled via the observer.enable configuration flag, the device will run a constant passive Bluetooth LE scan and report received advertisement packets to the Cloud service, to enable scene triggers.

Methods

BLE.SetConfig

Properties:

PropertyTypeDescription

config

object

Configuration that the method takes

Find more about the config properties in config section

BLE.GetConfig

Find the Switch.GetConfig response properties in config section

BLE.GetStatus

Find more about the status response properties in status section

Configuration

The configuration of the Bluetooth Low Energy component shows whether the bluetooth connection is enabled.

PropertyTypeDescription

enable

boolean

True if bluetooth is enabled, false otherwise

rpc

object

Configuration of the rpc service

PropertyTypeDescription

enable

boolean

True if rpc service is enabled, false otherwise

note

Currently only rpc service is implemented, but a global enable flag is maintained for possible other future BLE functionality implementation. If either of the enable flags is set to false the device is not advertised. Changing the configuration requires restart.

Status

The status of the BLE component contains information about the bluetooth on/off state and does not own any status properties.

Examples

BLE.GetStatus example

http://192.168.33.1/rpc/BLE.GetStatus

Response

{}

BLE.GetConfig example

http://192.168.33.1/rpc/BLE.GetConfig

Response

{
"enable": true,
"rpc": {
"enable": true
}
}

BLE.SetConfig example

http://192.168.33.1/rpc/BLE.SetConfig?config={"enable":true,"rpc":{"enable":true}}

Response

{
"restart_required": true
}