This guide provides a method to get full integration of Tuya WiFi and Zigbee devices behind a Tyua Zigbee Gateway working in Home Assistant.
This guide is about having BOTH local control and Cloud connectivity at the same time with the standard hardware.
This gives full local control AND cloud control of your devices at the same time.
No device hacks, firmware flashes or custom gateways needed.
BACKGROUND
In my setup, all Zigbee devices are paired with a Mercator Ikuu Zigbee Pro Hub SGW003 as my Zigbee gateway.
This is a rebranded generic Tuya TYGWZ-01 Ethernet Smart Gateway, also rebranded as LIDL, Silvercrest, Pearl.de, Revolt, Elesion and many more.
Note:
You don’t need this whole integration if you use a 3rd Party Zigbee stick in HA.
By using a 3rd party Zigbee stick, you already have full local control over all of your Zigbee devices.
Your Zigbee devices are paired to the Zigbee stick.
However, by using a 3rd party (non-Tuya) Zigbee stick, you will lose the ability to use the Tuya Cloud services, apps & automations, if that’s something you want.
If you want BOTH local control and Cloud connectivity at the same time, this guide is what you want.
GOALS
- Simplify on-boarding new Tuya WiFi & Zigbee devices to Home Assistant with Local Control.
AND - Retain existing Tuya Cloud integration so current automations and integrations are not disturbed.
NEEDS
You must have:
-
A Tuya Smart Life App Account on a mobile device: All in One App | Tuya Smart
-
A Tuya Developer Account: https://iot.tuya.com
A good getting started guide is https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md -
An API key setup for your Developer account will give you:
- Tuya IOT Access ID/Client ID
- Tuya IOT Access Secret/Client Secret
- Tuya IOT “Smart Home Basic” Service API (Added by default as a free replacement for the IOT Core service)
Service: Tuya Smart Developer Center
Docs: Smart Home Basic Service-Cloud Services API Reference-Tuya Developer
ASSUMPTIONS
- Your Tuya devices are online and already paired with Tuya Smart Home app.
- Your devices are functioning normally via the Tuya Smart Home app.
LOCALTUYA SETUP
@umu_ugg has created an excellent LocalTuya HACS project which allows local control of sub-devices behind a gateway.
- Github: GitHub - xZetsubou/hass-localtuya: 🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"
- Community Discussion: Local Tuya - Control Tuya devices locally (Fork from localtuya)
LocalTuya is a HACS integration that serves as a hub for your Tuya devices.
After setup, whether using cloud
or no cloud
, you can locally manage and control all your Tuya-based devices through Home Assistant.
Cloud Integration
LocalTuya uses the cloud only to obtain device data and pre-fill the required fields to simplify device setup.
LocalTuya does not use the Cloud for any automation or device controls.
LocalTuya can also be used independently of the cloud.
All existing Tuya Cloud integrations remain functional so current automations and integrations are not disturbed.
Features of this LocalTuya fork
- Auto-Discover Devices -
Discovers Tuya devices on your network
- Auto-Configure Device Features -
Requires a cloud API setup
- Bulk Device Onboarding -
Requires a cloud API setup
- Supports protocol
3.5
devices. - Support sub-devices
devices that works through gateways e.g. ZigBee and BLE
.
^ Sub Devices automatically discoverableif Cloud API account is set up
. - Configure devices with templates
ready-config yaml file shareable
.
^ Configured devices are exportable throughconfig-flow
. - Platforms
humidifers, button and siren
are supported. - Supports Multi-Hubs aka multi accounts.
INSTALLATION
Option 1:
- Visit GitHub - xZetsubou/hass-localtuya: 🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"
- Click the ‘Open HACS Repository on MY-HA’ button
Option 2:
- HACS → Integrations → menu (tree dots top right) → Custom repositories
- Add
https://github.com/xZetsubou/hass-localtuya
to field “Repository”. - Category → Integration
Manual installation:
- Download the latest version from GitHub releases extract the file.
- Copy
custom_components
directory into your HA config directory.