From 48cf64e8dcd928d9e6e61298bc0261f1a4d07e27 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Sun, 12 Jul 2020 10:04:48 +1200 Subject: [PATCH] Add Tuya Climate docs (#632) * Add docs for Tuya Climate devices * Use tuya image --- components/climate/tuya.rst | 59 +++++++++++++++++++++++++++++++++++++ index.rst | 1 + 2 files changed, 60 insertions(+) create mode 100644 components/climate/tuya.rst diff --git a/components/climate/tuya.rst b/components/climate/tuya.rst new file mode 100644 index 000000000..26cdc073e --- /dev/null +++ b/components/climate/tuya.rst @@ -0,0 +1,59 @@ +Tuya Climate +============ + +.. seo:: + :description: Instructions for setting up a Tuya climate device. + :image: air-conditioner.png + +The ``tuya`` climate platform creates a climate device from a tuya component. + +The Tuya fan requires a :doc:`/components/tuya` to be configured. + +.. code-block:: text + + [22:03:11][C][tuya:023]: Tuya: + [22:03:11][C][tuya:032]: Datapoint 1: switch (value: ON) + [22:03:11][C][tuya:032]: Datapoint 2: switch (value: OFF) + [22:03:11][C][tuya:034]: Datapoint 3: int value (value: 20) + [22:03:11][C][tuya:034]: Datapoint 4: int value (value: 19) + [22:03:11][C][tuya:034]: Datapoint 5: int value (value: 0) + [22:03:11][C][tuya:036]: Datapoint 7: enum (value: 1) + [22:03:11][C][tuya:046]: Product: '{"p":"ynjanlglr4qa6dxf","v":"1.0.0","m":0}' + +On this controller, the data points are: + +- 1 represents the climate on/off state. +- 2 represents the child lock switch. (use the :doc:`/components/switch/tuya` component to control this) +- 3 represents the target temperature. +- 4 represents the current temperature. +- 5 represents the timer but is not yet available to be used in ESPHome. +- 7 represents the eco mode switch. (use the :doc:`/components/switch/tuya` component to control this) + +Based on this, you can create the climate device as follows: + +.. code-block:: yaml + + climate: + - platform: tuya + name: "My Climate Device" + switch_datapoint: 1 + target_temperature_datapoint: 3 + current_temperature_datapoint: 4 + +Configuration variables: +------------------------ + +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- **name** (**Required**, string): The name of the climate device. +- **switch_datapoint** (**Required**, int): The datapoint id number of the climate switch. +- **target_temperature_datapoint** (**Required**, int): The datapoint id number of the target temperature. +- **current_temperature_datapoint** (**Required**, int): The datapoint id number of the current temperature. +- All other options from :ref:`Climate `. + +See Also +-------- + +- :doc:`/components/tuya` +- :doc:`/components/climate/index` +- :apiref:`tuya/climate/tuya_climate.h` +- :ghedit:`Edit` diff --git a/index.rst b/index.rst index 571e5f5b6..ab55cdb9f 100644 --- a/index.rst +++ b/index.rst @@ -310,6 +310,7 @@ Climate Components Custom Climate, components/climate/custom, language-cpp.svg PID Controller, components/climate/pid, function.svg IR Remote Climate, components/climate/ir_climate, air-conditioner-ir.svg + Tuya Climate, components/climate/tuya, tuya.png Misc Components ---------------