mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-09-21 03:21:20 +02:00
[text_sensor] Tidy up name/id (#4152)
This commit is contained in:
parent
2d2971af57
commit
5e53c6fed8
@ -33,7 +33,6 @@ Configuration variables:
|
||||
- **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.
|
||||
- **notify** (*Optional*, boolean): Instruct the server to send notifications for this
|
||||
characteristic. Defaults to ``false``.
|
||||
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device. Defaults to ``60s``.
|
||||
|
@ -47,8 +47,7 @@ Example json log:
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (**Required**, string): The name of the sensor.
|
||||
- All other options from :ref:`Text Sensor <config-text_sensor>`.
|
||||
- All options from :ref:`Text Sensor <config-text_sensor>`.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
@ -13,7 +13,7 @@ states from your Home Assistant instance using the :doc:`native API </components
|
||||
# Example configuration entry
|
||||
text_sensor:
|
||||
- platform: homeassistant
|
||||
name: "Weather Forecast From Home Assistant"
|
||||
id: weather_fom_ha
|
||||
entity_id: sensor.weather_forecast
|
||||
|
||||
Entity state attributes can also be imported:
|
||||
@ -30,11 +30,9 @@ Entity state attributes can also be imported:
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (*Optional*, string): The name of the text sensor.
|
||||
- **entity_id** (**Required**, string): The entity ID to import from Home Assistant.
|
||||
- **attribute** (*Optional*, string): The name of the state attribute to import from the
|
||||
specified entity. The entity state is used when this option is omitted.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- All other options from :ref:`Text Sensor <config-text_sensor>`.
|
||||
|
||||
See Also
|
||||
|
@ -24,7 +24,8 @@ Base Text Sensor Configuration
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **name** (**Required**, string): The name for the sensor.
|
||||
- **id** (*Optional*, string): Manually specify the ID for code generation. At least one of **id** and **name** must be specified.
|
||||
- **name** (*Optional*, string): The name for the sensor. At least one of **id** and **name** must be specified.
|
||||
|
||||
.. note::
|
||||
|
||||
|
@ -10,8 +10,6 @@ and requires :doc:`/components/modbus_controller` to be configured.
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- **name** (**Required**, string): The name of the sensor.
|
||||
- **register_type** (**Required**): type of the modbus register.
|
||||
|
||||
- ``coil``: Coils are 1-bit registers (on/off values) that are used to control discrete outputs. They may be read and/or written. Modbus *Function Code 1 (Read Coil Status)* will be used.
|
||||
@ -53,7 +51,7 @@ Configuration variables:
|
||||
- ``return <std::string>;`` the new value for the sensor.
|
||||
- ``return {};`` uses the parsed value for the state (same as ``return x;``).
|
||||
|
||||
- **offset** (*Optional*, int): Offset from start address in bytes (only required for uncommon response encodings). If more than one register is written in a command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type. The value for offset depends on the register type.
|
||||
- **offset** (*Optional*, int): Offset from start address in bytes (only required for uncommon response encodings). If more than one register is written in a command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type. The value for offset depends on the register type.
|
||||
- All options from :ref:`Text Sensor <config-text_sensor>`.
|
||||
|
||||
Example:
|
||||
|
@ -22,10 +22,8 @@ in its ``id(mysensor).state``.
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (**Required**, string): The name of the text sensor.
|
||||
- **topic** (**Required**, string): The MQTT topic to listen for string data.
|
||||
- **qos** (*Optional*, int): The MQTT QoS to subscribe with. Defaults to ``0``.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- All other options from :ref:`Text Sensor <config-text_sensor>`.
|
||||
|
||||
Example Usage for Displays
|
||||
|
@ -32,7 +32,6 @@ See :doc:`/components/display/nextion` for setting up the display
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (**Required**, string): The name of the sensor.
|
||||
- **nextion_id** (*Optional*, :ref:`config-id`): The ID of the Nextion display.
|
||||
- **component_name** (*Optional*, string): The name of the Nextion component.
|
||||
- **update_interval** (*Optional*, :ref:`config-time`): The duration to update the sensor. If using a :ref:`nextion_custom_text_sensor_protocol` this should not be used
|
||||
|
@ -28,12 +28,10 @@ Possible return values for the lambda:
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (**Required**, string): The name of the text sensor.
|
||||
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`):
|
||||
Lambda to be evaluated every update interval to get the new value of the text sensor
|
||||
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
|
||||
text sensor. Set to ``never`` to disable updates. Defaults to ``60s``.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- All other options from :ref:`Text Sensor <config-text_sensor>`.
|
||||
|
||||
.. _text_sensor-template-publish_action:
|
||||
|
@ -21,8 +21,6 @@ You can create the text sensor as follows:
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- **name** (**Required**, string): The name of the sensor.
|
||||
- **sensor_datapoint** (**Required**, int): The datapoint id number of the sensor.
|
||||
- All other options from :ref:`Text Sensor <config-text_sensor>`.
|
||||
|
||||
|
@ -21,15 +21,13 @@ was compiled against as a text sensor.
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (**Required**, string): The name of the text sensor.
|
||||
- **hide_timestamp** (*Optional*, boolean): Allows you to hide the compilation timestamp from the version string. Defaults to ``false``.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- All other options from :ref:`Text Sensor <config-text_sensor>`.
|
||||
|
||||
Disabling the compilation timestamp:
|
||||
------------------------------------
|
||||
|
||||
.. code-block:: yaml
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
text_sensor:
|
||||
|
Loading…
Reference in New Issue
Block a user