Update docs for ble_client RSSI sensor (#2339)

This commit is contained in:
RoboMagus 2022-10-12 04:24:00 +02:00 committed by GitHub
parent 90645afd57
commit af9abec4f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 12 deletions

View File

@ -6,7 +6,7 @@ BLE Client Sensor
:image: bluetooth.svg :image: bluetooth.svg
The ``ble_client`` component is a sensor platform that can The ``ble_client`` component is a sensor platform that can
query BLE devices for specific values of service characteristics. query BLE devices for RSSI or specific values of service characteristics.
For more information on BLE services and characteristics, see For more information on BLE services and characteristics, see
:doc:`/components/ble_client`. :doc:`/components/ble_client`.
@ -21,6 +21,7 @@ For more information on BLE services and characteristics, see
sensor: sensor:
- platform: ble_client - platform: ble_client
type: characteristic
ble_client_id: itag_black ble_client_id: itag_black
name: "iTag battery level" name: "iTag battery level"
service_uuid: '180f' service_uuid: '180f'
@ -28,20 +29,34 @@ For more information on BLE services and characteristics, see
icon: 'mdi:battery' icon: 'mdi:battery'
unit_of_measurement: '%' unit_of_measurement: '%'
- platform: ble_client
type: rssi
ble_client_id: itag_black
name: "iTag RSSI"
Configuration variables: Configuration variables:
------------------------ ------------------------
- **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client. - **type** (**Required**): One of ``rssi``, ``characteristic``.
- **service_uuid** (**Required**, UUID): UUID of the service on the device.
- **characteristic_uuid** (**Required**, UUID): UUID of the service's characteristic to query. rssi options:
- **descriptor_uuid** (*Optional*, UUID): UUID of the characteristic's descriptor to query.
- **id** (*Optional*, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components. - **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): The lambda to use for converting a raw data - All other options from :ref:`Sensor <config-sensor>`.
reading to a sensor value. See :ref:`ble-sensor-lambda` for more information.
- **notify** (*Optional*, boolean): Instruct the server to send notifications for this characteristic options:
characteristic.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device. - **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client.
- All other options from :ref:`Sensor <config-sensor>`. - **service_uuid** (**Required**, UUID): UUID of the service on the device.
- **characteristic_uuid** (**Required**, UUID): UUID of the service's characteristic to query.
- **descriptor_uuid** (*Optional*, UUID): UUID of the characteristic's descriptor to query.
- **id** (*Optional*, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): The lambda to use for converting a raw data
reading to a sensor value. See :ref:`ble-sensor-lambda` for more information.
- **notify** (*Optional*, boolean): Instruct the server to send notifications for this
characteristic.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
- All other options from :ref:`Sensor <config-sensor>`.
Automations: Automations:
@ -64,6 +79,7 @@ variable ``x`` of type ``std::vector<uint8_t>``. The function must return a sing
sensor: sensor:
- platform: ble_client - platform: ble_client
type: characteristic
ble_client_id: t_sensor ble_client_id: t_sensor
name: "Temperature Sensor 32bit float" name: "Temperature Sensor 32bit float"
... ...

View File

@ -55,6 +55,7 @@ Configuration example:
# a notification is received, the corresponding binary_sensor # a notification is received, the corresponding binary_sensor
# is briefly toggled. # is briefly toggled.
- platform: ble_client - platform: ble_client
type: characteristic
ble_client_id: itag_black ble_client_id: itag_black
name: "Black iTag btn" name: "Black iTag btn"
service_uuid: 'ffe0' service_uuid: 'ffe0'
@ -73,12 +74,18 @@ Configuration example:
# support this characteristic, you will see 'Unknown' in the # support this characteristic, you will see 'Unknown' in the
# HA frontend. # HA frontend.
- platform: ble_client - platform: ble_client
type: characteristic
ble_client_id: itag_black ble_client_id: itag_black
name: "Black iTag Battery" name: "Black iTag Battery"
service_uuid: '180f' service_uuid: '180f'
characteristic_uuid: '2a19' characteristic_uuid: '2a19'
icon: 'mdi:battery' icon: 'mdi:battery'
unit_of_measurement: '%' unit_of_measurement: '%'
# This entry queries polls the RSSI when the tag is connected.
- platform: ble_client
type: rssi
ble_client_id: itag_black
name: "Black iTag RSSI"
Explanation Explanation
----------- -----------