Ariela has build in Bluetooth device sensor, informations which can be send to Home Assistant to automate things when the Phone get’s connected to another Bluetooth device, it’s state changes etc or even detect device room presence based on the RSSI of other Bluetooth devices .

In order to enable Bluetooth MQTT device informations, go to Ariela -> Settings -> MQTT Sensors.

If the discovery is enabled in the MQTT Home Assistant configuration file the new sensor should be automatically discovered. If not, click on the 3 dots button from the Bluetooth Sensor entry in order to see sensor implementation.

JSON Attributes

enabled attribute

boolean – true if the Bluetooth adapter is ON, false instead

icon

sensor device icon, default “mdi:bluetooth”

name

Bluetooth Device name

mac

Bluetooth device mac address. Note if you are running Android 8.0 or later the mac address will be “02:00:00:00:00:00” due to OS limitations.

discovered_device

JSON array of the nearby Bluetooth devices (this list is populated by the phone while is discovering the devices)

A entry from the JSON array will be a JSON Object like this:

{
“name” : “device name”,
“mac” : “mac address”,
“rssi” : rssi_value
}

Name: its the name of the device discovered
Mac: the mac address of the device discovered
RSSI: signal strength of the device discovered

bonded_devices

JSON array containing all the bonded (paired) Bluetooth devices with the phone device

A entry from this JSON array will be a JSON Object like this:

{
“name” : “device name”,
“mac” : “mac address”,
}

Name: its the name of the device paired
Mac: the mac address of the device paired

Remarks

  • the discovery (scanning) is done every 1 minute
  • when the discovery process is started, the discovered devices list will be empty, and while the devices are found it will be populated
  • if the Bluetooth device is off, the discovery & bonded list will be empty and no discovery will be made
  • due to Android limitations, the discovery process will only last for 10 seconds

Example

The fallowing example will toggle the switch whenever my phone detects another BT device with signal strength less then 0


- id: '1547281634013'
  alias: test BT
  trigger:
  - platform: mqtt
    topic: homeassistant/sensor/android_ionut_bluetooth/state
  condition:
  - condition: template
    value_template: '{{ trigger.payload_json.discovered_devices[0].rssi <= 0 }}'
  action:
  - data:
      entity_id: switch.bedroom_light
    service: switch.toggle