2018-05-14 21:15:49 +02:00
|
|
|
ESP32 Bluetooth Low Energy Device
|
|
|
|
=================================
|
|
|
|
|
2018-11-14 22:12:27 +01:00
|
|
|
.. seo::
|
|
|
|
:description: Instructions for setting up BLE binary sensors for the ESP32.
|
2018-11-19 18:32:16 +01:00
|
|
|
:image: bluetooth.png
|
2018-11-14 22:12:27 +01:00
|
|
|
|
2018-06-13 22:38:49 +02:00
|
|
|
The ``esp32_ble_tracker`` binary sensor platform lets you track the presence of a
|
2018-05-14 21:15:49 +02:00
|
|
|
bluetooth low energy device.
|
|
|
|
|
2018-06-01 18:10:00 +02:00
|
|
|
.. figure:: images/esp32_ble-ui.png
|
|
|
|
:align: center
|
|
|
|
:width: 80.0%
|
2018-05-14 21:15:49 +02:00
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-05-14 21:15:49 +02:00
|
|
|
|
|
|
|
# Example configuration entry
|
2018-06-13 22:38:49 +02:00
|
|
|
esp32_ble_tracker:
|
2018-05-14 21:15:49 +02:00
|
|
|
scan_interval: 300s
|
|
|
|
|
|
|
|
binary_sensor:
|
2018-06-13 22:38:49 +02:00
|
|
|
- platform: esp32_ble_tracker
|
2018-05-14 21:15:49 +02:00
|
|
|
mac_address: AC:37:43:77:5F:4C
|
|
|
|
name: "ESP32 BLE Tracker Google Home Mini"
|
|
|
|
|
|
|
|
Configuration variables:
|
2018-08-24 22:44:01 +02:00
|
|
|
------------------------
|
2018-05-14 21:15:49 +02:00
|
|
|
|
|
|
|
- **mac_address** (**Required**, MAC Address): The MAC address to track for this
|
|
|
|
binary sensor.
|
|
|
|
- **name** (**Required**, string): The name of the binary sensor.
|
2018-06-01 18:10:00 +02:00
|
|
|
- **id** (*Optional*, :ref:`config-id`): Manually specify
|
2018-05-14 21:15:49 +02:00
|
|
|
the ID used for code generation.
|
2018-06-01 18:10:00 +02:00
|
|
|
- All other options from :ref:`Binary Sensor <config-binary_sensor>`
|
|
|
|
and :ref:`MQTT Component <config-mqtt-component>`.
|
2018-05-14 21:15:49 +02:00
|
|
|
|
2018-08-22 22:05:28 +02:00
|
|
|
.. _esp32_ble_tracker-setting_up_devices:
|
|
|
|
|
2018-05-14 21:15:49 +02:00
|
|
|
Setting Up Devices
|
2018-08-24 22:44:01 +02:00
|
|
|
------------------
|
2018-05-14 21:15:49 +02:00
|
|
|
|
|
|
|
To set up binary sensors for specific BLE beacons you first have to know which MAC address
|
|
|
|
to track. Most devices show this screen in some setting menu. If you don't know the MAC address,
|
2018-06-13 22:38:49 +02:00
|
|
|
however, you can use the ``esp32_ble_tracker`` hub without any binary sensors attached and read through
|
2018-05-14 21:15:49 +02:00
|
|
|
the logs to see discovered Bluetooth Low Energy devices.
|
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-05-14 21:15:49 +02:00
|
|
|
|
|
|
|
# Example configuration entry for finding MAC addresses
|
2018-08-22 22:05:28 +02:00
|
|
|
esp32_ble_tracker:
|
2018-05-14 21:15:49 +02:00
|
|
|
|
|
|
|
Using above configuration, first you should see a ``Starting scan...`` debug message at
|
|
|
|
boot-up. Then, when a BLE device is discovered, you should see messages like
|
2018-08-22 22:05:28 +02:00
|
|
|
``Found device AC:37:43:77:5F:4C`` together with some information about their
|
2018-05-14 21:15:49 +02:00
|
|
|
address type and advertised name. If you don't see these messages, your device is unfortunately
|
|
|
|
currently not supported.
|
|
|
|
|
|
|
|
Please note that devices that show a ``RANDOM`` address type in the logs cannot be used for
|
|
|
|
tracking, since their MAC-address periodically changes.
|
|
|
|
|
2018-06-01 18:10:00 +02:00
|
|
|
See Also
|
2018-08-24 22:44:01 +02:00
|
|
|
--------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2018-06-13 22:38:49 +02:00
|
|
|
- :doc:`/esphomeyaml/components/esp32_ble_tracker`
|
2018-06-01 18:10:00 +02:00
|
|
|
- :doc:`/esphomeyaml/components/binary_sensor/index`
|
|
|
|
- :doc:`API Reference </api/misc/esp32_ble_tracker>`
|
2018-08-24 22:44:01 +02:00
|
|
|
- `ESP32 BLE for Arduino <https://github.com/nkolban/ESP32_BLE_Arduino>`__ by `Neil Kolban <https://github.com/nkolban>`__.
|
2018-06-13 22:38:49 +02:00
|
|
|
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst>`__
|
2018-10-12 16:33:22 +02:00
|
|
|
|
|
|
|
.. disqus::
|