Tuya Integration

WOW! So easy. I tried to make it difficult. I have a pair of TanTan outlets. Following the directions that came with them, I downloaded the SmartLife app and installed it on my tablet. Then commenced to pairing one at a time. The app found them with no problems encountered. I named them Tuya1 and…Tuya2! :slight_smile: Wouldn’t you know it, I had forgot my username and password. After some looking around I finally got that info to use for the config in config.yaml. After a restart, I looked in the entities, and there they were switch.18436572…Turns out that is the virtual ID Tuya gave each device in the app. I went into Lovelace and created a pair o switches, and VOILA! They work with very little delay (maybe a second or two).

Any one know if Tuya can tell me about the power of the item?

like if the item end i will make automation to send me a message ?

Hello mp3lllll,

look at this, maybe it will help you …

https://community.home-assistant.io/t/tuya-switches-with-energy-monitoring-support/61204

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’,))`

I still have 0.86.2 and the Tuya sockets are still working great. I also have no energy monitoring !! Will then wait for another update, hope that the problems with Tuya then fixed, alternative would have to halt but just “Tasmota” flash

Hello all

I have this issue tuya-component-doesnt-work-with-this-digoo-dg-sp01-plug

Can anyone please help me in order to solve ?

Thank you in advcance or your support !

Thanks everyone for the help.

here is what I did…

Teckin USB sockets.
HassIO 9.2

Added the Tuya into Hass…
Note, I use Smart Life app but I still had to register an account at Tuya. The App information may be different than the tuya.com website (including country if you have set it)

#Tuya
tuya:
username: (my email)
password: (my pass)
country_code: (my country as a number, no + before)
platform: smart_life

Then restarted. Just in case, I did a developer Tools, drop down box to Tuya Pull Devices.
Then they showed up int he dashboard. A quick rename and working perfectly

image

1 Like

So I got the integration working, but I cant work out how to assign the discovered devices to room groups - Tuya doesnt appear in the WEb UI list of integrations. Any help appreciated :slight_smile:

For some reason, only the scenes on my tuya/smart-life account comes through. And I can’t see any of the devices. Any ideas??

which devices? not all devices supported in the app(s) are supported in the integration

sorry if i missed what needs to be done here… i have 12 devices connected to my tuya account all show up in HA but one the garage door opener i cant not figure out why… the other 11 are switches and plugs again they are fine

it’s a smart IR

I bought 2 door contacts. They are not working with home assistant. As I understood, they do not have all tuya component integrated: at the moment only bulbs and switches.

that sucks anyone figure out a work around for this…

Nope. And the worst part is that I can’t find any chinese IR remote sensor that integrates with HA.

my Haasio keeps telling me

The following components and platforms could not be set up:

Please check your config.

My config is as below, I have checked the sign in details are correct on the app on my iPhone and the devices show up and I can control them.

tuya:
  username: [email protected]
  password: xxxxxxxxx
  country_code: 44
  platform: smart_life

Any ideas why I keep seeing the error, it being doing it for the past 5 or 6 versions of hassio now.

1 Like

Same for me.

you have the smart_life app on your iphone? not the tuya branded one, or jinvoo one?

Yes its the Smart Life one

hmm - I dont see anything obvious.

mine:

tuya:
  username: 04xxxxxxxx
  password: somepassword
  country_code: 61