What is Tuya Local and how to set up the Oz Smart Rotary Dimmer in Home Assistant.

What is Tuya Local and how to set up the Oz Smart Rotary Dimmer in Home Assistant.

What is Tuya Local?

Tuya Local is an integration that allows Home Assistant to control Tuya devices over the local network without relying on the Tuya cloud. This integration enhances response times, reliability, and privacy by ensuring all communications occur within your local network.

How Tuya Local Works with Home Assistant

  1. Device Discovery: Home Assistant identifies Tuya devices on your local network.
  2. Local Key Retrieval: Obtain the device's ID and local key. This step can be tricky and often involves intercepting data during the device setup or using specific tools and guides available online.
  3. Integration Configuration: Configure the LocalTuya integration in Home Assistant by inputting the local IP address, device ID, and local key.
  4. Control and Automation: After setup, you can control your Tuya devices from Home Assistant and incorporate them into your automations and scenes.

Benefits of Using Tuya Local

  1. Enhanced Privacy: Data remains within your local network, reducing exposure to the internet.
  2. Improved Reliability: Direct communication between Home Assistant and your devices can lead to faster and more reliable control.
  3. Reduced Latency: Local control often results in quicker responses from devices.
  4. Cloud Independence: Your smart home system remains functional even if the Tuya cloud service experiences downtime or issues.

Setting Up a Tuya Dimmer Locally in Home Assistant

Setting up a dimmer in Home Assistant using the LocalTuya integration involves several steps. Here’s a general step-by-step guide:


  • Home Assistant installed and running.
  • A Tuya dimmer switch set up through the Tuya or Smart Life app.

Steps to Set Up Tuya Dimmer Locally

  1. Get Tuya Device Local Key:

    • Obtain the device's ID and local key. This typically involves intercepting the Tuya app’s API calls during the device setup process. There are various guides and tools available online to help with this.
  2. Install LocalTuya:

    • Use Home Assistant’s HACS (Home Assistant Community Store) to install the LocalTuya integration.
    • If you don’t have HACS, install it first following the instructions on the HACS website.
    • After installation, restart Home Assistant.
  3. Add LocalTuya Integration:

    • Navigate to Configuration -> Integrations in the Home Assistant UI.
    • Click on ADD INTEGRATION and search for "LocalTuya."
    • Add your device using its IP address, Device ID, and Local Key obtained earlier.
  4. Set Up the Dimmer:

    • During the setup in the LocalTuya integration, configure the device functions.
    • For a dimmer, set it as a light with dimming capabilities.
    • Save the configuration.
  5. Add to Lovelace UI:

    • Add the dimmer to your Lovelace UI dashboard.
    • Go to your dashboard and edit it to include the new dimmer entity.
    • The dimmer should have dimming controls by default.
  6. Optional (YAML Configuration):

    • If you prefer YAML, you can configure LocalTuya using YAML.
    • Refer to the LocalTuya GitHub repository or documentation for specific YAML configuration examples.
  7. Test Your Dimmer:

    • Control your dimmer from the Home Assistant interface, including adjusting its brightness level.


By setting up your Tuya dimmer locally using the LocalTuya integration, you gain enhanced privacy, reliability, and control over your smart home devices. Although the process can be more involved than using the cloud, the benefits of local control are significant, making it a worthwhile endeavor for any smart home enthusiast. Always remember to back up your Home Assistant configuration and document any changes for easy troubleshooting and maintenance.

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.