Split the Tuya component documentation (#631)

* Split the Tuya component documentation

* Optimize image

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
Jesse Hills 2020-07-12 08:50:17 +12:00 committed by GitHub
parent d71c2e7db9
commit 6b7c18a919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 68 additions and 60 deletions

View File

@ -6,7 +6,7 @@ Tuya Fan
:image: fan.svg
The ``tuya`` fan platform creates a variable speed fan from a
tuya serial component.
tuya component.
.. figure:: images/tuyafan.jpg
:align: center
@ -14,35 +14,7 @@ tuya serial component.
A Tuya based fan controller wall plate.
There are two components, the Tuya bus and the fan that uses it. The ``tuya``
component requires a :ref:`UART bus <uart>` to be configured. Put the ``tuya`` component in
the config and it will list the possible devices for you in the config log.
.. code-block:: yaml
# Example configuration entry
# Make sure your wifi will connect
wifi:
ssid: "ssid"
password: "password"
# Make sure logging is not using the serial port
logger:
baud_rate: 0
# Enable Home Assistant API
api:
# Make sure you can upload new firmware OTA
ota:
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
# Register the Tuya MCU connection
tuya:
The Tuya fan requires a :doc:`/components/tuya` to be configured.
Here is an example output for a Tuya fan controller:
@ -93,6 +65,7 @@ Configuration variables:
See Also
--------
- :doc:`/components/tuya`
- :doc:`/components/fan/index`
- :apiref:`tuya/fan/tuya_fan.h`
- :ghedit:`Edit`

View File

@ -16,36 +16,7 @@ tuya serial component.
The dimmer switch I got would hang if the logger was configured to use the serial port
which meant it was bricked until I cut it open.
There are two components, the Tuya bus and the dimmer that uses it. The ``tuya``
component requires a :ref:`UART bus <uart>` to be configured. Put the ``tuya`` component in
the config and it will list the possible devices for you in the config log.
.. code-block:: yaml
# Example configuration entry
# Make sure your wifi will connect
wifi:
ssid: "ssid"
password: "password"
# Make sure logging is not using the serial port
logger:
baud_rate: 0
# Enable Home Assistant API
api:
# Make sure you can upload new firmware OTA
ota:
# My dimmer used the hardware serial port on the alternate pins
uart:
rx_pin: GPIO13
tx_pin: GPIO15
baud_rate: 9600
# Register the Tuya MCU connection
tuya:
The Tuya dimmer requires a :doc:`/components/tuya` to be configured.
Here is an example output for a Tuya dimmer:
@ -92,6 +63,7 @@ Configuration variables:
See Also
--------
- :doc:`/components/tuya`
- :doc:`/components/light/index`
- :apiref:`tuya/light/tuya_light.h`
- :ghedit:`Edit`

62
components/tuya.rst Normal file
View File

@ -0,0 +1,62 @@
Tuya MCU
========
.. seo::
:description: Instructions for setting up the Tuya component.
:image: tuya.png
The ``tuya`` component creates a serial connection to the Tuya MCU for platforms to use.
.. figure:: /images/tuya.png
:align: center
:width: 40%
The ``tuya`` serial component requires a :ref:`UART bus <uart>` to be configured.
Put the ``tuya`` component in the config and it will list the possible devices for you in the config log.
.. code-block:: yaml
# Example configuration entry
# Make sure your wifi will connect
wifi:
ssid: "ssid"
password: "password"
# Make sure logging is not using the serial port
logger:
baud_rate: 0
# Enable Home Assistant API
api:
# Make sure you can upload new firmware OTA
ota:
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
# Register the Tuya MCU connection
tuya:
Here is an example output for a Tuya fan controller:
.. code-block:: text
[12:39:45][C][tuya:023]: Tuya:
[12:39:45][C][tuya:032]: Datapoint 1: switch (value: ON)
[12:39:45][C][tuya:036]: Datapoint 3: enum (value: 1)
[12:39:45][C][tuya:036]: Datapoint 6: enum (value: 0)
[12:39:45][C][tuya:034]: Datapoint 7: int value (value: 0)
[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}'
See Also
--------
- :doc:`/components/fan/tuya`
- :doc:`/components/light/tuya`
- :apiref:`tuya/tuya.h`
- :ghedit:`Edit`

BIN
images/tuya.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -343,6 +343,7 @@ Misc Components
Debug Component, components/debug, bug-report.svg
TM1651 Battery Display, components/tm1651, tm1651_battery_display.jpg
RF Bridge, components/rf_bridge, rf_bridge.jpg
Tuya MCU, components/tuya, tuya.png
Additional Custom Components
----------------------------