Tuya Device Help

Ok I am new to HA but I have been using Tuya products for a while. I have the following setup in my config:

tuya:
username: !secret tuya_username
password: !secret tuya_password
country_code: !secret my_country_code
platform: smart_life

Now the first time I did this I could see the lights and sockets but then it all stopped and now I get an error saying I setup “tuya” wrong. Now not sure if this matters but some products were on Tuya_Smart app and others on Smart_Life app but I was able to ditch the Tuya_Smart and put them all under Smart_Life App for IFTTT support. I am at a loss on why it just stopped working. Am I missing an entry? I see some people have things like the below:

lights:

  • platform: ‘tuya’
    host: ‘192.168.0.111’
    device_id: ‘22222222dc4f221021b1’
    local_key: ‘aaaaa2a22a2222aa’
    id: 1
    I am not sure how to get the deivce_id or local_key. I saw a post on using another phone app to get them but did not seem to work right. Do I need this for every light, switch, socket, etc for Tuya devices? I have a list of all the assigned IPs so that I have just don’t know how to get the rest.

Any help would be great. After I get that fixed I need to work on Smartthings integration …not working so smooth with bridge and stuff.

Thanks

Greg

platform: smart_life

if you are using smart life app.

Yeah I did that too no joy. Comes back and says that Tuya line in config is wrong. Here is what I had:

tuya:
username: !secret tuya_username
password: !secret tuya_password
country_code: !secret my_country_code
platform: smart_life

The username / password / country code are correct.

Seems it is just not finding them.

Tuya do not work anyone for me since Home Assistant 0.87.1

other have the same issue?

`> Error during setup of component tuya
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File “/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py”, line 57, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File “/usr/local/lib/python3.6/socket.py”, line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 343, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 839, in _validate_conn
conn.connect()
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 301, in connect
conn = self._new_conn()
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 168, in _new_conn
self, “Failed to establish a new connection: %s” % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x732435b0>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py”, line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘px1.tuyaus.com’, port=443): Max retries exceeded with url: /homeassistant/auth.do (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x732435b0>: Failed to establish a new connection: [Errno -3] Try again’,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/tuya.py”, line 65, in setup
tuya.init(username, password, country_code, platform)
File “/usr/local/lib/python3.6/site-packages/tuyapy/tuyaapi.py”, line 44, in init
self.get_access_token()
File “/usr/local/lib/python3.6/site-packages/tuyapy/tuyaapi.py”, line 59, in get_access_token
‘from’: ‘tuya’
File “/usr/local/lib/python3.6/site-packages/requests/api.py”, line 116, in post
return request(‘post’, url, data=data, json=json, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/api.py”, line 60, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/adapters.py”, line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘px1.tuyaus.com’, port=443): Max retries exceeded with url: /homeassistant/auth.do (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x732435b0>: Failed to establish a new connection: [Errno -3] Try again’,))`

Anybody figures out how to control color, temp and brightness of a group of tuya light bulbs at the same time?

Updated to HomeAssistant .88 and my local tuya python stopped working as well

Using 0.88.1 and my tuya is working with 4 outlets and 1 dimmer switch. Sometimes when I have a power outage, I sometimes need to re-initialize any non-reporting devices to tuya app.

Can confirm 0.88.1 tuya is completely unreliable.

I suggest using tuya-convert to switch from the tuya firmware to ESPhome

I have 14 of these https://www.appliancesdirect.co.uk/p/iq-wifibulbgu10s/electriq-iqwifibulbgu10s-smart-bulb hooked up to a switch and they’re not listed as compatible on the wiki. Will consider for some tuya switches I have. To be honest the google home and app are flawless with tuya, it’s just that HA has a hard time picking them up and I believe the sheer amount of tuya devices and therefore 404s and subsequent retries lead my HA instance (on HASSIO RP3B+) to crash. I’m okay with the slight delay and the value gained using the tuya servers outweighs security concerns. When it works with HA i’m happy but I don’t want it to be so unstable that it continuously crashes my setup.

I wouldn’t mind betting that this would work with those globes, even if you had to change the GPIO allocation slightly

It’ll probably work. I have 2 spare so I’ll build a little rig to test out. At least it’ll help people in the future even if I don’t choose to use it. Will report back with findings.

Good stuff! If you do prove to get it working, please add to the Git page that I linked (or directly to Otto with his ESPhome site). The owner of that Git is planning to merge his findings with the ESPhome website to help create a database of known device configs

Will do thanks

I was able to make my tuya switches work with 0.88 again thanks to this person’s post:

post #29
[Tuya switch]

Also sharing my findings after using that method:
post #55
[Tuya switch]

I am seeing the same thing with the new version. It did work at first then stopped.

Does anyone know how to solve this problem?
I am getting every time the following issue in my logs:

Updating tuya cover took longer than the scheduled update interval 0:00:15
14:54 helpers/entity_platform.py (WARNING)

the only fix is to not use the cloud version. I believe this is just the tuya cloud being slow to respond to the HA poll.

(that said, maybe we both have slow/busy internet connections)

I get the same errors constantly for all my Tuya Cover Switches. I tried direct no-cloud access using DeviceId, Localkey etc but couldn’t make it work for a cover switch. They show up as on/off switch, not open/stop/close cover switch. If anybody can help…

so that means that it did not work fine with the “offline” version?
You roll it back to the online cloud functionality ?