From f30cc647cd4a2c455e0bc3df4e64a8a32bc7a7ea Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 11 May 2022 12:50:42 +1200 Subject: [PATCH 01/35] Bump version to 2022.6.0-dev --- Doxygen | 2 +- Makefile | 2 +- _static/version | 2 +- conf.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Doxygen b/Doxygen index 3c3af8b6c..8780564ca 100644 --- a/Doxygen +++ b/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.5.0-dev +PROJECT_NUMBER = 2022.6.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 diff --git a/Makefile b/Makefile index 58edd6027..299496721 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ESPHOME_PATH = ../esphome -ESPHOME_REF = 2022.4.0 +ESPHOME_REF = dev .PHONY: html html-strict cleanhtml deploy help live-html Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify diff --git a/_static/version b/_static/version index d102e49bc..da61ca8c4 100644 --- a/_static/version +++ b/_static/version @@ -1 +1 @@ -2022.5.0-dev \ No newline at end of file +2022.6.0-dev \ No newline at end of file diff --git a/conf.py b/conf.py index 6aa9f2c58..eadb482c3 100644 --- a/conf.py +++ b/conf.py @@ -66,9 +66,9 @@ author = "ESPHome" # built documents. # # The short X.Y version. -version = "2022.5" +version = "2022.6" # The full version, including alpha/beta/rc tags. -release = "2022.5.0-dev" +release = "2022.6.0-dev" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 306f5f55e8b5ca6a37836f9e4523579d22b4e4c8 Mon Sep 17 00:00:00 2001 From: swifty99 Date: Thu, 12 May 2022 06:53:37 +0200 Subject: [PATCH 02/35] TCS34725 automatic integration times (#1951) Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- components/sensor/tcs34725.rst | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/components/sensor/tcs34725.rst b/components/sensor/tcs34725.rst index 251bfc42d..42dfa4af1 100644 --- a/components/sensor/tcs34725.rst +++ b/components/sensor/tcs34725.rst @@ -60,9 +60,10 @@ Configuration variables: - **illuminance** (*Optional*): Get the total illuminance of the sensor in lx. - **color_temperature** (*Optional*): Get the calculated color temperature of the light in Kelvin. - **gain** (*Optional*): Set the gain for the internal ADCs to work better in certain low-light conditions. Valid - values are ``1x`` (default), ``4x``, ``16x``, ``60x`` (highest gain). + values are ``1x`` (default), ``4x``, ``16x``, ``60x`` (highest gain). Will be overwritten if auto integration time + is used - **integration_time** (*Optional*): The amount of time the light sensor is exposed. Valid values are - ``2.4ms`` (default), ``24ms``, ``50ms``, ``101ms``, ``120ms``, ``154ms``, ``180ms``, ``199ms``, + ``auto`` (default), ``2.4ms``, ``24ms``, ``50ms``, ``101ms``, ``120ms``, ``154ms``, ``180ms``, ``199ms``, ``240ms``, ``300ms``, ``360ms``, ``401ms``, ``420ms``, ``480ms``, ``499ms``, ``540ms``, ``600ms``, ``614ms``. - **glass_attenuation_factor** (*Optional*): The attenuation factor of glass if it's behind some glass facia. Default is ``1.0`` means ``100%`` transmissivity. ``2`` means ``50%`` transmissivity etc. @@ -70,6 +71,23 @@ Configuration variables: - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. +For many applications, you can use AUTO timing or leave integration time empty to have the ESP select a suitable gain +setting based on the previous measurement. If light levels change dramatically this may cause the next reading to saturate, +after which the gain will adjust down and subsequent readings will be in range. +If auto is used in a dynamic environment an update rate of 1 second is best. Filters can be used to throttle the output and +prevent updates of marginal changes like: + +.. code-block:: yaml + + illuminance: + name: "TCS34725 Illuminance" + filters: + - or: + - delta: 50 + - throttle: 60sec + +When using integration times lower than 154ms the accuracy of the sensor drops with no further gain in possible light +accumulation. Use faster timings only if fast readout is necessary with stable light conditions recommended. See Also -------- From ecd45454e96c1d5697f6f86e10a557017665271a Mon Sep 17 00:00:00 2001 From: Maxim Ocheretianko Date: Sun, 15 May 2022 22:49:48 +0300 Subject: [PATCH 03/35] Add Tuya select documentation (#2075) --- components/select/tuya.rst | 69 ++++++++++++++++++++++++++++++++++++++ index.rst | 1 + 2 files changed, 70 insertions(+) create mode 100644 components/select/tuya.rst diff --git a/components/select/tuya.rst b/components/select/tuya.rst new file mode 100644 index 000000000..670adbd4b --- /dev/null +++ b/components/select/tuya.rst @@ -0,0 +1,69 @@ +Tuya Select +=========== + +.. seo:: + :description: Instructions for setting up a Tuya device select. + :image: tuya.png + +The ``tuya`` select platform creates a select from a tuya serial component +and requires :doc:`/components/tuya` to be configured. + +.. code-block:: text + + [08:51:09][C][tuya:032]: Tuya: + [08:51:09][C][tuya:043]: Datapoint 1: switch (value: ON) + [08:51:09][C][tuya:045]: Datapoint 24: int value (value: 220) + [08:51:09][C][tuya:045]: Datapoint 16: int value (value: 22) + [08:51:09][C][tuya:049]: Datapoint 2: enum (value: 1) + [08:51:09][C][tuya:045]: Datapoint 19: int value (value: 40) + [08:51:09][C][tuya:045]: Datapoint 101: int value (value: 1) + [08:51:09][C][tuya:045]: Datapoint 27: int value (value: -2) + [08:51:09][C][tuya:049]: Datapoint 43: enum (value: 1) + [08:51:09][C][tuya:049]: Datapoint 102: enum (value: 1) + [08:51:09][C][tuya:051]: Datapoint 45: bitmask (value: 0) + [08:51:09][C][tuya:043]: Datapoint 10: switch (value: ON) + [08:51:09][C][tuya:041]: Datapoint 38: raw (value: 06.00.14.08.00.0F.0B.1E.0F.0C.1E.0F.11.00.16.16.00.0F.08.00.16.17.00.0F (24)) + [08:51:09][C][tuya:049]: Datapoint 36: enum (value: 1) + [08:51:09][C][tuya:057]: GPIO Configuration: status: pin 14, reset: pin 0 (not supported) + [08:51:09][C][tuya:061]: Status Pin: GPIO14 + [08:51:09][C][tuya:063]: Product: '{"p":"gogb05wrtredz3bs","v":"1.0.0","m":0}' + +On this controller, the datapoint 36 represents the temperature sensor selection +setting which is what we are interested in controlling using this platform. + +Based on this, you can create the select as follows: + +.. code-block:: yaml + + # Create a select + select: + - platform: "tuya" + name: "Sensor selection" + enum_datapoint: 2 + optimistic: true + options: + 0: Internal: + 1: Floor: + 2: Both: + +Configuration variables: +------------------------ + +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- **name** (**Required**, string): The name of the switch. +- **enum_datapoint** (**Required**, int): The enum datapoint id number for the select. +- **options** (**Required**, Map[int, str]): Provide a mapping from values (int) of + this Select to options (str) of the *enum_datapoint* and vice versa. All options and + all values have to be unique. +- **optimistic** (*Optional*, boolean): Whether to operate in optimistic mode - when in this mode, + any command sent to the Select will immediately update the reported state. + +- All other options from :ref:`Select `. + + +See Also +-------- + +- :doc:`/components/select/index` +- :apiref:`tuya/select/tuya_select.h` +- :ghedit:`Edit` diff --git a/index.rst b/index.rst index 372c831c0..a1aabee4c 100644 --- a/index.rst +++ b/index.rst @@ -620,6 +620,7 @@ Select Components Select Core, components/select/index, folder-open.svg Template Select, components/select/template, description.svg Modbus Select, components/select/modbus_controller, modbus.png + Tuya Select, components/select/tuya, tuya.png Lock Components ----------------- From 01b6a6df8ef2333fa73325c1122bd35eabd8a06d Mon Sep 17 00:00:00 2001 From: Maxim Ocheretianko Date: Sun, 15 May 2022 22:44:18 +0300 Subject: [PATCH 04/35] Tuya status gpio support (#2072) --- components/tuya.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/components/tuya.rst b/components/tuya.rst index a458fe1ce..79f5d3818 100644 --- a/components/tuya.rst +++ b/components/tuya.rst @@ -40,12 +40,38 @@ Here is an example output for a Tuya fan controller: [12:39:45][C][tuya:032]: Datapoint 9: switch (value: OFF) [12:39:45][C][tuya:046]: Product: '{"p":"hqq73kftvzh8c92u","v":"1.0.0","m":0}' +Here is another example output for a Tuya ME-81H thermostat: + +.. code-block:: text + + [08:51:09][C][tuya:032]: Tuya: + [08:51:09][C][tuya:043]: Datapoint 1: switch (value: ON) + [08:51:09][C][tuya:045]: Datapoint 24: int value (value: 220) + [08:51:09][C][tuya:045]: Datapoint 16: int value (value: 22) + [08:51:09][C][tuya:049]: Datapoint 2: enum (value: 1) + [08:51:09][C][tuya:045]: Datapoint 19: int value (value: 40) + [08:51:09][C][tuya:045]: Datapoint 101: int value (value: 1) + [08:51:09][C][tuya:045]: Datapoint 27: int value (value: -2) + [08:51:09][C][tuya:049]: Datapoint 43: enum (value: 1) + [08:51:09][C][tuya:049]: Datapoint 102: enum (value: 1) + [08:51:09][C][tuya:051]: Datapoint 45: bitmask (value: 0) + [08:51:09][C][tuya:043]: Datapoint 10: switch (value: ON) + [08:51:09][C][tuya:041]: Datapoint 38: raw (value: 06.00.14.08.00.0F.0B.1E.0F.0C.1E.0F.11.00.16.16.00.0F.08.00.16.17.00.0F (24)) + [08:51:09][C][tuya:049]: Datapoint 36: enum (value: 1) + [08:51:09][C][tuya:057]: GPIO Configuration: status: pin 14, reset: pin 0 (not supported) + [08:51:09][C][tuya:061]: Status Pin: GPIO14 + [08:51:09][C][tuya:063]: Product: '{"p":"gogb05wrtredz3bs","v":"1.0.0","m":0}' + Configuration variables: ------------------------ - **time_id** (*Optional*, :ref:`config-id`): Some Tuya devices support obtaining local time from ESPHome. Specify the ID of the :ref:`Time Component