mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-25 17:17:54 +01:00
Merge branch 'next' into bump-2022.10.0b1
This commit is contained in:
commit
f8c31b2a86
2
Doxygen
2
Doxygen
@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2022.9.4
|
||||
PROJECT_NUMBER = 2022.10.0-dev
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
ESPHOME_PATH = ../esphome
|
||||
ESPHOME_REF = 2022.9.4
|
||||
ESPHOME_REF = dev
|
||||
|
||||
.PHONY: html html-strict cleanhtml deploy help live-html Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify
|
||||
|
||||
|
@ -3,3 +3,4 @@
|
||||
# Moved components
|
||||
# e.g: /components/sensors/abc.html /components/sensors/xyz.html 301
|
||||
/components/sensor/sgp40.html /components/sensor/sgp4x.html 301
|
||||
/components/binary_sensor/xpt2046.html /components/touchscreen/xpt2046.html 301
|
||||
|
@ -1 +1 @@
|
||||
2022.9.4
|
||||
2022.10.0-dev
|
@ -102,7 +102,7 @@ This platform utilises the library's generic one-size-fits-all API, which might
|
||||
|
||||
Additional configuration must be specified for this platform:
|
||||
|
||||
- **protocol** (**Required**, string): Choose one of Arduino-HeatpumpIR's supported protcols: ``aux``, ``ballu``, ``carrier_mca``, ``carrier_nqv``, ``daikin_arc417``, ``daikin_arc480``, ``daikin``, ``electroluxyal``, ``fuego``, ``fujitsu_awyz``, ``gree``, ``greeya``, ``greeyac``, ``greeyan``, ``hisense_aud``, ``hitachi``, ``hyundai``, ``ivt``, ``midea``, ``mitsubishi_fa``, ``mitsubishi_fd``, ``mitsubishi_fe``, ``mitsubishi_heavy_fdtc``, ``mitsubishi_heavy_zj``, ``mitsubishi_heavy_zm``, ``mitsubishi_heavy_zmp``, ``mitsubishi_heavy_kj``, ``mitsubishi_msc``, ``mitsubishi_msy``, ``mitsubishi_sez``, ``panasonic_ckp``, ``panasonic_dke``, ``panasonic_jke``, ``panasonic_lke``, ``panasonic_nke``, ``samsung_aqv``, ``samsung_fjm``, ``sharp``, ``toshiba_daiseikai``, ``toshiba``
|
||||
- **protocol** (**Required**, string): Choose one of Arduino-HeatpumpIR's supported protcols: ``aux``, ``ballu``, ``carrier_mca``, ``carrier_nqv``, ``daikin_arc417``, ``daikin_arc480``, ``daikin``, ``electroluxyal``, ``fuego``, ``fujitsu_awyz``, ``gree``, ``greeya``, ``greeyac``, ``greeyan``, ``hisense_aud``, ``hitachi``, ``hyundai``, ``ivt``, ``midea``, ``mitsubishi_fa``, ``mitsubishi_fd``, ``mitsubishi_fe``, ``mitsubishi_heavy_fdtc``, ``mitsubishi_heavy_zj``, ``mitsubishi_heavy_zm``, ``mitsubishi_heavy_zmp``, ``mitsubishi_heavy_kj``, ``mitsubishi_msc``, ``mitsubishi_msy``, ``mitsubishi_sez``, ``panasonic_ckp``, ``panasonic_dke``, ``panasonic_jke``, ``panasonic_lke``, ``panasonic_nke``, ``samsung_aqv``, ``samsung_fjm``, ``sharp``, ``toshiba_daiseikai``, ``toshiba``, ``zhlt01``
|
||||
- **horizontal_default** (**Required**, string): What to default to when the AC unit's horizontal direction is *not* set to swing. Options are: ``left``, ``mleft``, ``middle``, ``mright``, ``right``, ``auto``
|
||||
- **vertical_default** (**Required**, string): What to default to when the AC unit's vertical direction is *not* set to swing. Options are: ``down``, ``mdown``, ``middle``, ``mup``, ``up``, ``auto``
|
||||
- **max_temperature** (**Required**, float): The maximum temperature that the AC unit supports being set to.
|
||||
@ -120,6 +120,8 @@ Additional configuration must be specified for this platform:
|
||||
internal temperature sensor; a value of 2 minutes seems to work well. See :doc:`/components/sensor/index`
|
||||
for more information.
|
||||
|
||||
- The ``zhlt01`` protocol supports multiple AC brands: Eurom, Chigo, Tristar, Tecnomaster, Elgin, Geant, Tekno, Topair, Proma, Sumikura, JBS, Turbo Air, Nakatomy, Celestial Air, Ager, Blueway, Airlux, etc.
|
||||
|
||||
.. _ir-receiver_id:
|
||||
|
||||
Using a Receiver
|
||||
|
@ -52,8 +52,6 @@ modes that Home Assistant offers.
|
||||
- platform: thermostat
|
||||
name: "Thermostat Climate Controller"
|
||||
sensor: my_temperature_sensor
|
||||
default_target_temperature_low: 20 °C
|
||||
default_target_temperature_high: 22 °C
|
||||
min_cooling_off_time: 300s
|
||||
min_cooling_run_time: 300s
|
||||
min_heating_off_time: 300s
|
||||
@ -66,6 +64,11 @@ modes that Home Assistant offers.
|
||||
idle_action:
|
||||
- switch.turn_off: air_cond
|
||||
- switch.turn_off: heater
|
||||
default_preset: Home
|
||||
preset:
|
||||
- name: Home
|
||||
default_target_temperature_low: 20 °C
|
||||
default_target_temperature_high: 22 °C
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@ -74,7 +77,6 @@ modes that Home Assistant offers.
|
||||
- platform: thermostat
|
||||
name: "Thermostat Climate Controller"
|
||||
sensor: my_temperature_sensor
|
||||
default_target_temperature_low: 20 °C
|
||||
min_heating_off_time: 300s
|
||||
min_heating_run_time: 300s
|
||||
min_idle_time: 30s
|
||||
@ -82,6 +84,11 @@ modes that Home Assistant offers.
|
||||
- switch.turn_on: heater
|
||||
idle_action:
|
||||
- switch.turn_off: heater
|
||||
default_preset: Home
|
||||
preset:
|
||||
- name: Home
|
||||
default_target_temperature_low: 20 °C
|
||||
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@ -90,7 +97,6 @@ modes that Home Assistant offers.
|
||||
- platform: thermostat
|
||||
name: "Thermostat Climate Controller"
|
||||
sensor: my_temperature_sensor
|
||||
default_target_temperature_high: 22 °C
|
||||
min_cooling_off_time: 300s
|
||||
min_cooling_run_time: 300s
|
||||
min_idle_time: 30s
|
||||
@ -98,6 +104,11 @@ modes that Home Assistant offers.
|
||||
- switch.turn_on: air_cond
|
||||
idle_action:
|
||||
- switch.turn_off: air_cond
|
||||
default_preset: Home
|
||||
preset:
|
||||
- name: Home
|
||||
default_target_temperature_high: 22 °C
|
||||
|
||||
|
||||
|
||||
Controller Behavior and Hysteresis
|
||||
@ -163,7 +174,7 @@ Default Target Temperatures and Mode
|
||||
|
||||
These configuration items determine default values the thermostat controller should use when it starts.
|
||||
|
||||
- **default_mode** (*Optional*, *Deprecated*, climate mode): The default climate mode the controller should
|
||||
- **default_mode** (*Optional*, *Deprecated*, climate mode): The default climate mode the controller should
|
||||
use if it is unable to restore it from memory. One of:
|
||||
|
||||
- ``off`` (default)
|
||||
@ -173,7 +184,7 @@ These configuration items determine default values the thermostat controller sho
|
||||
- ``dry``
|
||||
- ``fan_only``
|
||||
- ``auto``
|
||||
|
||||
|
||||
This value is used the first time your device starts after ESPHome is initially installed onto it. Add
|
||||
this option into your configuration if you want your thermostat component to start in a climate mode other
|
||||
than ``off``. If this option is not configured, you'll need to manually change the climate mode later via
|
||||
@ -190,9 +201,9 @@ device's configuration.
|
||||
|
||||
.. note::
|
||||
|
||||
**default_mode**, **default_target_temperature_low**, and **default_target_temperature_high** are
|
||||
**default_mode**, **default_target_temperature_low**, and **default_target_temperature_high** are
|
||||
being removed in a future release. In the future you will need to migrate your configuration to using
|
||||
a :ref:`preset <thermostat-preset>` which will allow for more flexibility and customisation
|
||||
a :ref:`preset <thermostat-preset>` which will allow for more flexibility and customisation
|
||||
|
||||
Note that ``min_temperature`` and ``max_temperature`` from the base climate component are used to define
|
||||
the range of allowed temperature values in the thermostat component. See :doc:`/components/climate/index`.
|
||||
@ -315,22 +326,6 @@ Set Point Options/Behavior
|
||||
- **supplemental_heating_delta** (*Required with* ``supplemental_heating_action``, float): When the temperature
|
||||
difference between the lower set point and the current temperature exceeds this value,
|
||||
``supplemental_heating_action`` will be called immediately.
|
||||
- **away_config** (*Optional*, *Deprecated*): Additionally specify target temperature range settings for away mode.
|
||||
Away mode can be used to have a second set of target temperatures (for example, while the user is
|
||||
away or sleeping/at night).
|
||||
|
||||
- **default_target_temperature_low** (*Optional*, float): The default low target temperature for the control
|
||||
algorithm when Away mode is selected. This can be dynamically set in the frontend later.
|
||||
- **default_target_temperature_high** (*Optional*, float): The default high target temperature for the control
|
||||
algorithm when Away mode is selected. This can be dynamically set in the frontend later.
|
||||
|
||||
**If configured, at least one of** ``default_target_temperature_low`` **and** ``default_target_temperature_high``
|
||||
**must be specified in the away mode configuration.**
|
||||
|
||||
.. note::
|
||||
|
||||
**away_config** is deprecated and will be removed in a future release. You should migrate your configuration
|
||||
to using a :ref:`preset <thermostat-preset>` which allows for more flexibility and customisation
|
||||
|
||||
.. _thermostat-preset:
|
||||
|
||||
@ -343,19 +338,19 @@ experience and automation.
|
||||
|
||||
- **preset**: (*Optional*, list)
|
||||
|
||||
- **name** (*Required*, string): Name of the preset. If this is one of the *standard* presets (``eco``, ``away``,
|
||||
- **name** (*Required*, string): Name of the preset. If this is one of the *standard* presets (``eco``, ``away``,
|
||||
``boost``, ``comfort``, ``home``, ``sleep``, or ``activity``) it is considered a *standard* preset. Any other
|
||||
string will make the preset a *custom* preset. *Standard* and *custom* presets are functionally equivalent,
|
||||
the only difference is that when switching the mode via :ref:`climate.control Action <climate-control_action>`
|
||||
you will need to use the `preset` or `custom_preset` property as appropriate. The Home Assistant
|
||||
you will need to use the `preset` or `custom_preset` property as appropriate. The Home Assistant
|
||||
`climate.set_preset_mode` service treats them identically
|
||||
- **default_target_temperature_low** (*Optional*, float): The default low target temperature when switching to
|
||||
- **default_target_temperature_low** (*Optional*, float): The default low target temperature when switching to
|
||||
this preset
|
||||
- **default_target_temperature_high** (*Optional*, float): The default high target temperature when switching
|
||||
to this preset.
|
||||
- **mode** (*Optional*, climate mode): The mode the thermostat should switch to when this preset is activated.
|
||||
If not specified, the thermostat's mode will remain unchanged when the preset is activated. One of:
|
||||
|
||||
|
||||
- ``heat_cool``
|
||||
- ``cool``
|
||||
- ``heat``
|
||||
@ -378,7 +373,7 @@ experience and automation.
|
||||
- **swing_mode** (*Optional*, climate swing mode): The fan swing mode the thermostat should switch to when this
|
||||
preset is activated. If not specified, the thermostat's fan swing mode will remain unchanged when the preset
|
||||
is activated. One of:
|
||||
|
||||
|
||||
- ``off``
|
||||
- ``both``
|
||||
- ``horizontal``
|
||||
@ -422,6 +417,67 @@ experience and automation.
|
||||
preset_change:
|
||||
- logger.log: Preset has been changed!
|
||||
|
||||
Default Preset
|
||||
**************
|
||||
|
||||
These configuration items determine default values the thermostat controller should use when it starts.
|
||||
|
||||
- **default_preset** (*Optional*, string): The name of the preset to use by default. Must match a preset
|
||||
as per :ref:`preset <thermostat-preset>`.
|
||||
- **on_boot_restore_from**: (*Optional*, on_boot_restore_from): Controls what the thermostat will do when
|
||||
it first boots. One of:
|
||||
|
||||
- ``memory`` (default): The thermostat will restore any settings from last time it was running.
|
||||
- ``default_preset``: The thermostat will always switch to the preset specified by **default_preset**
|
||||
|
||||
.. note::
|
||||
|
||||
You can specify a ``default_preset`` and set ``on_boot_restore_from`` to ``memory``. In this mode when
|
||||
the settings from last boot cannot be retrieved, for any reason, then the specified ``default_preset``
|
||||
will be applied.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# This climate controller, on first boot, will switch to "My Startup Preset". Subsequent boots would
|
||||
# restore to whatever mode it was in prior to the reboot
|
||||
climate:
|
||||
- platform: thermostat
|
||||
name: "From Memory Thermostat"
|
||||
default_preset: My Startup Preset
|
||||
on_boot_restore_from: memory
|
||||
preset:
|
||||
- name: My Startup Preset
|
||||
default_target_temperature_low: 17
|
||||
default_target_temperature_high: 26
|
||||
fan_mode: OFF
|
||||
swing_mode: OFF
|
||||
mode: OFF
|
||||
# Custom preset
|
||||
- name: A custom preset
|
||||
default_target_temperature_low: 21
|
||||
default_target_temperature_high: 23
|
||||
fan_mode: HIGH
|
||||
mode: HEAT_COOL
|
||||
|
||||
# This climate controller will always switch to "Every Start Preset"
|
||||
climate:
|
||||
- platform: thermostat
|
||||
name: "Default Preset Thermostat"
|
||||
default_preset: Every Start Preset
|
||||
on_boot_restore_from: default_preset
|
||||
preset:
|
||||
- name: Every Start Preset
|
||||
default_target_temperature_low: 17
|
||||
default_target_temperature_high: 26
|
||||
fan_mode: OFF
|
||||
swing_mode: OFF
|
||||
mode: OFF
|
||||
# Custom preset
|
||||
- name: A custom preset
|
||||
default_target_temperature_low: 21
|
||||
default_target_temperature_high: 23
|
||||
fan_mode: HIGH
|
||||
mode: HEAT_COOL
|
||||
|
||||
Additional Actions/Behavior
|
||||
***************************
|
||||
@ -487,7 +543,7 @@ Hysteresis Values
|
||||
|
||||
- While this platform uses the term temperature everywhere, it can also be used to regulate other values.
|
||||
For example, controlling humidity is also possible with this platform.
|
||||
- ``min_temperature`` and ``max_temperature`` from the base climate component are used the define the range of
|
||||
- ``min_temperature`` and ``max_temperature`` from the base climate component are used the define the range of
|
||||
adjustability and the defaults will probably not make sense for control of things like humidity. See
|
||||
:doc:`/components/climate/index`.
|
||||
|
||||
|
@ -63,7 +63,7 @@ Configuration variables:
|
||||
- ``Adafruit RR 280x240`` (round-rectangular display -- some pixels are "deleted" from corners to form rounded shape)
|
||||
- ``Custom`` (see details below)
|
||||
|
||||
- **cs_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The CS pin.
|
||||
- **cs_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The CS pin.
|
||||
- **dc_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The DC pin.
|
||||
- **reset_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The RESET pin.
|
||||
- **height** (*Optional*, int): When ``model`` is set to "Custom", use this to specify the ``height`` of the display
|
||||
|
@ -50,6 +50,8 @@ Advanced options:
|
||||
|
||||
- **name** (**Required**, string): Name of the project
|
||||
- **version** (**Required**, string): Version of the project
|
||||
- **min_version** (*Optional*, string): The minimum ESPHome version required to compile this configuration.
|
||||
See :ref:`esphome-min_version`.
|
||||
|
||||
Old-style platform options, which have been moved to the platform-specific :doc:`esp32 </components/esp32>` and
|
||||
:doc:`esp8266 </components/esp8266>` sections but are still accepted here for compatibility reasons (usage not
|
||||
@ -129,11 +131,11 @@ too many WiFi/MQTT connection attempts, Over-The-Air updates being applied or th
|
||||
Configuration variables:
|
||||
|
||||
- **priority** (*Optional*, float): The priority to execute your custom shutdown code. A higher value
|
||||
means a high priority and in case of shutdown triggers that the code is executed **later**.
|
||||
means a high priority and in case of shutdown triggers that the code is executed **later**.
|
||||
Priority is used primarily for the initialization order of components. Shutdowns for these components are handled in *reverse* order, such that e.g. sensors (600) are shutdown before the hardware components (800) they depend on.
|
||||
Please note this is an ESPHome-internal value and any change will not be marked as a breaking change.
|
||||
Please note this is an ESPHome-internal value and any change will not be marked as a breaking change.
|
||||
Defaults to ``600``. For priority values refer to the list in the :ref:`esphome-on_boot` section.
|
||||
|
||||
|
||||
- See :ref:`Automation <automation>`.
|
||||
|
||||
.. _esphome-on_loop:
|
||||
@ -337,6 +339,14 @@ should be ``author_name.project_name``.
|
||||
name: "jesse.leds_party"
|
||||
version: "1.0.0"
|
||||
|
||||
.. _esphome-min_version:
|
||||
|
||||
Minimum ESPHome version
|
||||
-----------------------
|
||||
|
||||
This allows YAML files to specify the minimum version of ESPHome required to compile.
|
||||
This is useful in the case of packages where a published package might use features only
|
||||
available in a newer version of ESPHome. This allows for a more friendly error message.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
@ -6,7 +6,7 @@ BLE Client Sensor
|
||||
:image: bluetooth.svg
|
||||
|
||||
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
|
||||
:doc:`/components/ble_client`.
|
||||
@ -21,6 +21,7 @@ For more information on BLE services and characteristics, see
|
||||
|
||||
sensor:
|
||||
- platform: ble_client
|
||||
type: characteristic
|
||||
ble_client_id: itag_black
|
||||
name: "iTag battery level"
|
||||
service_uuid: '180f'
|
||||
@ -28,20 +29,34 @@ For more information on BLE services and characteristics, see
|
||||
icon: 'mdi:battery'
|
||||
unit_of_measurement: '%'
|
||||
|
||||
- platform: ble_client
|
||||
type: rssi
|
||||
ble_client_id: itag_black
|
||||
name: "iTag RSSI"
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client.
|
||||
- **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>`.
|
||||
- **type** (**Required**): One of ``rssi``, ``characteristic``.
|
||||
|
||||
rssi options:
|
||||
|
||||
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
|
||||
- All other options from :ref:`Sensor <config-sensor>`.
|
||||
|
||||
characteristic options:
|
||||
|
||||
- **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client.
|
||||
- **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:
|
||||
|
||||
@ -64,6 +79,7 @@ variable ``x`` of type ``std::vector<uint8_t>``. The function must return a sing
|
||||
|
||||
sensor:
|
||||
- platform: ble_client
|
||||
type: characteristic
|
||||
ble_client_id: t_sensor
|
||||
name: "Temperature Sensor 32bit float"
|
||||
...
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@ -80,7 +80,7 @@ See Also
|
||||
- :ref:`Binary Sensor Filters <binary_sensor-filters>`
|
||||
- :doc:`Inkplate 6 Plus </components/display/inkplate6>`
|
||||
- :doc:`EKTF2232 </components/touchscreen/ektf2232>`
|
||||
- :doc:`XPT2046 </components/binary_sensor/xpt2046>`
|
||||
- :doc:`XPT2046 </components/touchscreen/xpt2046>`
|
||||
- :apiref:`touchscreen/touchscreen.h`
|
||||
- :apiref:`touchscreen/binary_sensor/touchscreen_binary_sensor.h`
|
||||
- :ghedit:`Edit`
|
||||
|
@ -1,5 +1,5 @@
|
||||
XPT2046 Touch Screen Controller
|
||||
==================================
|
||||
XPT2046 Touch Screen Controller (Updated version)
|
||||
==================================================
|
||||
|
||||
.. seo::
|
||||
:description: Instructions for setting up XPT2046 touch screen controller with ESPHome
|
||||
@ -8,10 +8,7 @@ XPT2046 Touch Screen Controller
|
||||
|
||||
.. _xpt2046-component:
|
||||
|
||||
Component/Hub
|
||||
-------------
|
||||
|
||||
The ``xpt2046`` component allows using the touch screen controllers
|
||||
The ``xpt2046`` touchscreen platform allows using the touch screen controllers
|
||||
based on the XPT2046 chip
|
||||
(`datasheet <https://datasheetspdf.com/pdf-file/746665/XPTEK/XPT2046/1>`__,
|
||||
`AZ-Delivery`_) with ESPHome. Many cheap LCD displays contain this controller.
|
||||
@ -28,32 +25,20 @@ The :ref:`SPI <spi>` is required to be set up in your configuration for this sen
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
xpt2046:
|
||||
touchscreen:
|
||||
platform: xpt2046
|
||||
id: touchscreen
|
||||
cs_pin: 17
|
||||
irq_pin: 16
|
||||
interupt_pin: 16
|
||||
update_interval: 50ms
|
||||
report_interval: 1s
|
||||
threshold: 400
|
||||
dimension_x: 240
|
||||
dimension_y: 320
|
||||
calibration_x_min: 3860
|
||||
calibration_x_max: 280
|
||||
calibration_y_min: 340
|
||||
calibration_y_max: 3860
|
||||
swap_x_y: false
|
||||
|
||||
binary_sensor:
|
||||
- platform: xpt2046
|
||||
xpt2046_id: touchscreen
|
||||
id: touch_key0
|
||||
x_min: 80
|
||||
x_max: 160
|
||||
y_min: 106
|
||||
y_max: 212
|
||||
on_state:
|
||||
- lambda: 'ESP_LOGI("main", "key0: %s", (x ? "touch" : "release"));'
|
||||
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
@ -66,12 +51,12 @@ Base Configuration:
|
||||
- **cs_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The chip select pin.
|
||||
Often marked ``T_CS`` on the board.
|
||||
|
||||
- **irq_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The touch detection pin.
|
||||
- **interupt_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The touch detection pin.
|
||||
Often marked ``T_IRQ`` on the board. If not specified the component will use polling
|
||||
via SPI.
|
||||
via SPI. This key is renamed from **irq_pin**
|
||||
|
||||
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
|
||||
sensor. If ``irq_pin`` is specified the touch will be detected nearly instantaneously and this setting
|
||||
sensor. If ``interupt_pin`` is specified the touch will be detected nearly instantaneously and this setting
|
||||
will be used only for the release detection. Defaults to ``50ms``.
|
||||
|
||||
- **report_interval** (*Optional*, :ref:`config-time`): The interval to periodically
|
||||
@ -79,12 +64,6 @@ Base Configuration:
|
||||
|
||||
- **threshold** (*Optional*, int): The value to detect the touch or release. Defaults to ``400``.
|
||||
|
||||
- **dimension_x** (*Optional*, int): The dimension of the display in the horizontal
|
||||
direction. Usually in pixels but a percentage can be useful as well. Defaults to ``100``.
|
||||
|
||||
- **dimension_y** (*Optional*, int): The dimension of the display in the vertical
|
||||
direction. Usually in pixels but a percentage can be useful as well. Defaults to ``100``.
|
||||
|
||||
- **calibration_x_min** (*Optional*, int): The raw value corresponding to the left
|
||||
(or top if ``swap_x_y`` is specified) edge of the display. See :ref:`xpt2046-calibration`
|
||||
for the process to calibrate the touch screen. Defaults to ``0``.
|
||||
@ -100,65 +79,8 @@ Base Configuration:
|
||||
|
||||
- **swap_x_y** (*Optional*, boolean): If true the x and y axes are swapped. Defaults to ``false``.
|
||||
|
||||
- **on_state** (*Optional*, :ref:`Automation <automation>`): An automation to perform
|
||||
when the touch screen is pressed or released. See :ref:`xpt2046-on_state`.
|
||||
- All other options from :ref:`config-touchscreen`.
|
||||
|
||||
.. _xpt2046-on_state:
|
||||
|
||||
``on_state`` Action
|
||||
-------------------
|
||||
|
||||
This automation will be triggered when the XPT2046 touch screen detects a touch, a release
|
||||
or periodically each ``report_interval`` while touched.
|
||||
|
||||
This trigger provides three arguments: ``x`` and ``y`` are of the type int and specify the
|
||||
coordinates of the touch and a bool ``touched`` specifying whether a touch or release was
|
||||
detected.
|
||||
|
||||
Additionally to the coordinates, the touch status and the raw values needed for the calibration
|
||||
can be accessed as member variables.
|
||||
|
||||
The following code
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
xpt2046:
|
||||
on_state:
|
||||
- lambda: |-
|
||||
ESP_LOGI("main", "args x=%d, y=%d, touched=%s", x, y, (touched ? "touch" : "release"));
|
||||
ESP_LOGI("main", "member x=%d, y=%d, touched=%d, x_raw=%d, y_raw=%d, z_raw=%d",
|
||||
id(touchscreen).x,
|
||||
id(touchscreen).y,
|
||||
(int) id(touchscreen).touched,
|
||||
id(touchscreen).x_raw,
|
||||
id(touchscreen).y_raw,
|
||||
id(touchscreen).z_raw
|
||||
);
|
||||
|
||||
produces
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[20:17:37][I][main:065]: args x=145, y=261, touched=touch
|
||||
[20:17:37][I][main:073]: member x=145, y=261, touched=1, x_raw=1686, y_raw=3218, z_raw=424
|
||||
[20:17:37][I][main:065]: args x=145, y=261, touched=release
|
||||
[20:17:37][I][main:073]: member x=145, y=261, touched=0, x_raw=0, y_raw=0, z_raw=0
|
||||
|
||||
Binary Sensor
|
||||
-------------
|
||||
|
||||
The ``xpt2046`` binary sensor allows you to setup areas on the touch screen as virtual
|
||||
buttons. First, setup a :ref:`xpt2046-component` and then use this binary sensor platform
|
||||
to create individual binary sensors for each virtual button.
|
||||
|
||||
- **name** (*Optional*, string): The name for the binary sensor.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- **xpt2046_id** (*Optional*, :ref:`config-id`): Specify the ID of the component the sensor is part of. Useful when you have more than one touch screen.
|
||||
- **x_min** (**Required**, int): Left coordinate of the screen area to be detected as the virtual button.
|
||||
- **x_max** (**Required**, int): Right coordinate of the screen area to be detected as the virtual button.
|
||||
- **y_min** (**Required**, int): Top coordinate of the screen area to be detected as the virtual button.
|
||||
- **y_max** (**Required**, int): Bottom coordinate of the screen area to be detected as the virtual button.
|
||||
- All other options from :ref:`Binary Sensor <config-binary_sensor>`.
|
||||
|
||||
.. _xpt2046-calibration:
|
||||
|
||||
@ -168,7 +90,7 @@ Calibration
|
||||
To match the point of the touch to the display coordinates the touch screen has to be calibrated.
|
||||
The XPT2046 component returns raw values in the 0 to 4095 range. Those raw values are available
|
||||
as the ``x_raw`` and ``y_raw`` member variables and for example write them out as in the example
|
||||
:ref:`xpt2046-on_state`. The goal of the calibration is to identify the raw values corresponding
|
||||
:ref:`touchscreen-on_touch`. The goal of the calibration is to identify the raw values corresponding
|
||||
to the edges of the screen.
|
||||
|
||||
The calibration assumes a display oriented in a way that you will be using it, i.e. your
|
||||
@ -179,16 +101,13 @@ values nor ``swap_x_y``.
|
||||
.. code-block:: yaml
|
||||
|
||||
# Touchscreen
|
||||
xpt2046:
|
||||
touchscreen:
|
||||
platform: xpt2046
|
||||
id: touchscreen
|
||||
cs_pin: 17
|
||||
irq_pin: 16
|
||||
dimension_x: 240
|
||||
dimension_y: 320
|
||||
on_state:
|
||||
on_touch:
|
||||
- lambda: |-
|
||||
if (touched)
|
||||
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%d",
|
||||
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
|
||||
id(touchscreen).x,
|
||||
id(touchscreen).y,
|
||||
id(touchscreen).x_raw,
|
||||
@ -230,7 +149,8 @@ The vertical direction is fine. The configuration would thus be
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
xpt2046:
|
||||
touchscreen:
|
||||
platform: xpt2046
|
||||
calibration_x_min: 3848
|
||||
calibration_x_max: 281
|
||||
calibration_y_min: 347
|
||||
@ -250,7 +170,7 @@ Note that the touch screen is not extremely precise and there might be nonlinear
|
||||
or similar errors so don't expect a pixel-perfect precision. You can verify the touchpoint
|
||||
using a display lambda similar to the following.
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block:: yaml
|
||||
|
||||
display:
|
||||
- platform: ili9341
|
4
conf.py
4
conf.py
@ -66,9 +66,9 @@ author = "ESPHome"
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = "2022.9"
|
||||
version = "2022.10"
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = "2022.9.4"
|
||||
release = "2022.10.0-dev"
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
@ -55,6 +55,7 @@ Configuration example:
|
||||
# a notification is received, the corresponding binary_sensor
|
||||
# is briefly toggled.
|
||||
- platform: ble_client
|
||||
type: characteristic
|
||||
ble_client_id: itag_black
|
||||
name: "Black iTag btn"
|
||||
service_uuid: 'ffe0'
|
||||
@ -73,12 +74,18 @@ Configuration example:
|
||||
# support this characteristic, you will see 'Unknown' in the
|
||||
# HA frontend.
|
||||
- platform: ble_client
|
||||
type: characteristic
|
||||
ble_client_id: itag_black
|
||||
name: "Black iTag Battery"
|
||||
service_uuid: '180f'
|
||||
characteristic_uuid: '2a19'
|
||||
icon: 'mdi:battery'
|
||||
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
|
||||
-----------
|
||||
|
Loading…
Reference in New Issue
Block a user