Working TUYA LOCAL Tutorial on core-2021.2.1 TESTED ON 7/02/2021

I got excited when i saw this working. however if i use switch: i get a startup error

2020-01-21 22:53:12 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for localtuya which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-21 22:53:14 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform localtuya
  File "/config/custom_components/localtuya/switch.py", line 68, in setup_platform
  File "/config/custom_components/localtuya/switch.py", line 129, in __init__
  File "/config/custom_components/localtuya/switch.py", line 111, in status
  File "/config/custom_components/localtuya/switch.py", line 87, in __get_status
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 311, in status

If i use light:, i get an error when trying to change its status as per @francisp

yes it is, message me, i am still using it to this day, with the same method

Thanks for replying but I ended up moving away from using Tuya local and started custom firmware flashing my plugs with Tuya-Convert as was suggested by many people on this forum. I flash them with tasmota and after I had done 1 I never looked back, I’ve done over 20 plugs, about 10 bulbs and a couple of LED controllers.
Thanks anyway

I would, if the 2 lights I have had a esp inside. Unfortunately, it is a realtek, so can’t be flashed. And local tuya still does not work :frowning:

Take a look at https://github.com/TradeFace/tuyamqtt/ That might solve your problem. I be releasing v1.1 in a few days. TuyaFace ( the library to connect to the devices was released yesterday v1.3.1)

1 Like

Thanks. I will check it out !

same, flashed my first bulb coulple days ago and it is working like a charm!

Quick question, I can’t seem to find the answer.

Where you have…

  host: 192.168.0.12

… is this the IP address of your HASSIO computer? Or the IP address of the bulb/socket?

Thanks!!

the IP of the tuya device

Hi

Is it possible to install this onto a Home Assistant Raspberry Pi instance?

I have a few Tuya devices, curtain and blind controllers I would love to get away from using the Tuya Integration and the cloud.

I have looked at your installation instructions but seems to use PIP which I dont have on the pi

my method uses a pc running Windows 10. No need for raspberry pi. after you have local key use https://github.com/rospogrigio/localtuya. Get from HACS store.

1 Like

Thanks, I have managed to get the device keys from Tuya but I now have problems installing LocalTuya.

I can install the Hack but I cant find the Integration it doesnt appear in the list

Any ideas?

You have to get from the HACS STORE. Do you have it installed? If so it will be in the “integrations” and search for local tuya. After installation go to the settings, integration click plus icon in corner search for local tuya. It will scan all devices, when adding device make sure to force close smart life or tuya app on all devices. Just follow instructions for the github.

Thanks for the quick reply.

I did install the hack which stemmed ok but I couldn’t find local tuya in integrations.

I will try again tomorrow

Have the HAC installed and I can see the files in \custom_components\localtuya

but when I go into Configuration\Integrations and do Add Integration LocalTuya does not appear in the list of integrations.

I rebooted after installing the HACK but still nothing

Thanks for the help

I sorted it by shutting down the Pi and restarting, it then appeared in the list.

Now have to work out how to set the devices (covers)

Hey! Did you figure it out? :slight_smile:

No, in fact I have moved away from mqtt and zwave mqtt altogether because it was just too slow. Gone back to integrating the hubs

I’ve been trying to add my localtuya service to a 2nd ha server.
Using the same api keys and a device id on the list using the cli wizard, it will not return any local keys.

‘cannot fetch device. make sure id or account is correct’

Used the same keys for the wizard on my 1st ha server and still works fine.

Does localtuya iot only work on 1 instance?

In my case help was to try multiple times and turn sensor on and off combinatiob