【IoT】Home Assistant 集成 Tuya(涂鸦) 设备

Posted by 西维蜀黍 on 2021-02-10, Last Modified on 2022-02-19

Install the old Tuya Home Assistant Integration

Adding Tuya to your Home Assistant instance can be done via the user interface, by taking the following steps:

  • Browse to your Home Assistant instance.
  • In the sidebar click on Configuration.
  • From the configuration menu select: Integrations.
  • In the bottom right, click on the Add Integration button.
  • From the list, search and select “Tuya”.
  • Follow the instruction on screen to complete the set up.

After completing, the Tuya integration will be immediately available for use.

During configuration, be careful to select the country code and the platform corresponding to those used by you in the app. Once configuration flow is completed, the devices configured in your app will be automatically discovered.

Additionally, if your username or e-mail address isn’t accepted, please try using your phone number (minus the country code) as your username.

Ref

Install the New Tuya Home Assistant integration (Tuya v2)

Tuya Home Assistant Integration Installation

# If install HA core on OS
$ sudo -u homeassistant -H -s
# enter /home/homeassistant/.homeassistant

$ git clone https://github.com/tuya/tuya-home-assistant.git
$ mkdir custom_components/tuya
$ mv tuya-home-assistant/custom_components/tuya_v2/* custom_components/tuya
$ rm -rf tuya-home-assistant

Restart Home Assistant

You can restart the Home Assistant server in Configuration > Server Controls > RESTART.

Set up the Tuya Integration

In Configuration > Integrations > ADD INTEGRATION, search for the keyword tuya and select Tuya v2.

Enter your Tuya credential

In the Tuya Integration window, select Smart Home PaaS and click SUBMIT.

Ref

Misc

How to Connect Tuya devices

  1. 关闭设备
  2. 打开设备
  3. 长按5s电源键,直到指示灯快速闪烁,再长按5s电源键,直到指示灯慢闪

How to Debug

Add the following to your configuration.yaml file:

logger:
  default: debug
  logs:
    custom_components.tuya_v2: debug

Then you can get the log from home-assistant.log

Reference