Is Tuya Broken?

everthing Tuya related just stopped worked. I am running hassio on a raspberry pi3. it still works through the app but HA is showing everything as entity not found.

found this in the logs:

Thu Mar 07 2019 06:34:05 GMT-0500 (Eastern Standard Time)
Error during setup of component tuya
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.7/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.7/socket.py", line 748, 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.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 301, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/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 0x7301b3b0>: 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.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.7/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 0x7301b3b0>: 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.7/site-packages/homeassistant/setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/tuya/__init__.py", line 60, in setup
    tuya.init(username, password, country_code, platform)
  File "/usr/local/lib/python3.7/site-packages/tuyapy/tuyaapi.py", line 44, in init
    self.get_access_token()
  File "/usr/local/lib/python3.7/site-packages/tuyapy/tuyaapi.py", line 59, in get_access_token
    'from': 'tuya'
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/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 0x7301b3b0>: Failed to establish a new connection: [Errno -3] Try again'))

What version of HA are you running? I saw something about a tuya problem in the 0.89 release thread.

.88.2.

.89 isn’t out on hassio yet. I will go check the release notes though. it’ll probably be on hassio today or tomorrow…lol

Only thing I found in the release notes is one other guy saying it’s broken after the upgrade.

But I haven’t upgraded yet.

interesting, while looking at the logs I found the same error about connection with DarkSky…

Unable to connect to Dark Sky: HTTPSConnectionPool(host=‘api.darksky.net’, port=443): Max retries exceeded with url: /forecast/54008e0c50212d1eb7c5be6b61d170a9/34.089572,-84.184736?units=us&lang=en (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x72d6a970>: Failed to establish a new connection: [Errno -3] Try again’))

What is this NewConnectionError:

NewConnectionError('&lt;urllib3.connection.VerifiedHTTPSConnection object at 0x72d6a970&gt;: Failed to establish a new connection: [Errno -3] Try again'))

I have all kinds of Tuya connection errors as well. Worked slowly for a while but eventually it broker all together and I had to restart.

I just switched mine all over to Sonoff-Tasmota and use MQTT. A lot more reliable and I wasn’t really too fond of everything going to someplace I don’t know anything about.
You can do it pretty easily without having to solder anything, it’s all OTA.

Yep, at some point that would be my goal… But I’m only 4 weeks info using HA. I’ll learn mqtt at some point

Same issue here. All Tuya bulbs are now broken (not physically) and the same error as the OP is displayed on my hassio instance, too.

Is it still working in the tuya app?

hi guys, i am running the last version of HA 0.89.1 and my bulb not working on ha but phiisically yes, and the app works fine.

i dont have any error on HA, but bulb not shows on entities.

2019-03-10 00:20:08 INFO (MainThread) [homeassistant.setup] Setting up tuya
2019-03-10 00:20:11 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=tuya>
2019-03-10 00:23:54 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=tuya, service=force_update, service_data=>
2019-03-10 00:23:54 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.281473045796792] Sending {'id': 7, 'type': 'event', 'event': {'event_type': 'call_service', 'data': {'domain': 'tuya', 'service': 'force_update', 'service_data': {}}, 'origin': 'LOCAL', 'time_fired': datetime.datetime(2019, 3, 10, 0, 23, 54, 900017, tzinfo=<UTC>), 'context': {'id': '9a03419b34d24fa5bb2a3003cc9c1a47', 'user_id': '0202b672ee1542d99b7354466796216a'}}}

What comes next in the logs?

Has this changed at all? Could it be that tuya has changed something? (That is a pain with unofficial hacked solutions, you rely on a cloud provider not to lock you out, see post by @sleeepy2

All mine stated working again today… I didn’t do anything, just woke up and all is well…

I’m guessing tuya did something

Or their server was just down temporarily.

I have just updated to Hassio v0.90 and my Tuya is now not working.

Not changed anything in the config, and all was working fine before.

Just to add - the tuya app controls the light fine.

I get the following message:

Error during setup of component tuya
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/tuya/__init__.py", line 60, in setup
    tuya.init(username, password, country_code, platform)
  File "/usr/local/lib/python3.7/site-packages/tuyapy/tuyaapi.py", line 44, in init
    self.get_access_token()
  File "/usr/local/lib/python3.7/site-packages/tuyapy/tuyaapi.py", line 68, in get_access_token
    raise TuyaAPIException(message)
tuyapy.tuyaapi.TuyaAPIException: Get accesstoken failed. Username or password error!

I’ll upgrading later this week when I have time. I’ll let you know if I had the same issue

I upgraded from 0.90 to 0.91 today and encountered the same error as everyone else. Upgrading seems to be a no-no for this component.

I’m on 0.91.2 and still getting this issue. Reboot clears the problem 90% off the time.

Would be nice to have a little More insight though

I made an account just to reply to this, but it seems that tuyaus.com has been added to the blacklist of some adblockers.

Adding tuyaus.com to my whitelist seems to solve this problem.

1 Like