Tuya Device Help

Yes, this is the error I have in the log file:

ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall switch.turn_on (c:xxxxxxxxxxxxxxxxx): entity_id=[‘switch.xxxxxxxxxxxxxxxxx’]>
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/core.py”, line 1177, in _event_to_service_call
await service_handler.func(service_call)
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 177, in handle_service
self._platforms.values(), func, call
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 250, in entity_service_call
permission=POLICY_CONTROL
homeassistant.exceptions.Unauthorized: Unauthorized

Not sure if this helps at all… but I was banging my head trying to figure out what to do with my Aldi Medion switches. Then I found through another forum that it was a Tuya clone. Finally managed to get them to register with the Smart Life Android app. then as you eventually discovered, they are currently not supported. BUT it turns out that scenes are! you can create two scenes in the app for each switch, one that turns it on, and the other to turn it off. Once you do a tuya.pull_devices, the scenes are discovered! Then created an mqtt switch and setup some automation logic in HA that executes the scene.turn_on and bingo! a working Aldi Medion switch working in HA!

1 Like

Thanks Mark for your comment. Actually, my problem was solved by upgrading HA to 0.84.5
Now I am able to switch off and on from the frondend. I hope this can somehow help you.

-Bump-

Like @teunehv, I’d really like to give the old integration a shot. Unfortunately, none of the old links to the github page or directly to the python file work. Can anyone provide an alternative link? It would be hugely appreciated.

See post here: Tuya switch
Someone uploaded it again.

If anyone needs assistance with configuring products under the Tuya umbrella (Merkury:Geenie, SmartLife, etc…) please check out this post:

doesnt work in 2019 - u have to update the app to use it, can’t use the 1.0.7 version anymore=(

Same here: problems with tuya - try to flash them and get rid of the china cloud:):slight_smile:

https://github.com/SynAckFin/TuyOTA

1 Like

Dear,
I would like to flash tasmota on my Arilux rgbw light bulb
Does this works with Ubuntu,
Please guide how to flash tasmota on my device

I dunno how but perhaps read the git provided in the link above.

1 Like

I just got a pair of switches working with local control (and without flashing the devices) last night and documented how I did it. Check out my post here and see if it helps.

Do anyone know this issue with tuya?
I get this message every minute. Sometimes the status of my devices are not update.

Log Details (WARNING)

Sun Jan 27 2019 20:10:05 GMT+0100 (CET)

Updating tuya cover took longer than the scheduled update interval 0:00:15

yup

2019-01-28 12:14:05 WARNING (MainThread) [homeassistant.components.switch] Updating tuya switch took longer than the scheduled update interval 0:00:30
2019-01-28 12:15:38 WARNING (MainThread) [homeassistant.components.switch] Updating tuya switch took longer than the scheduled update interval 0:00:30
2019-01-28 12:19:15 WARNING (MainThread) [homeassistant.components.switch] Updating tuya switch took longer than the scheduled update interval 0:00:30 

the tuya internet service is slow(ing?)

Unless you are getting this using the local package, in which case you have a different issue

So if I switch to local there are another issues ? To find the key plus the entity id ?

Is that not possible to change the time from 15 or 30 seconds to 1 Minute and see what happen? If yes where is the code to change ?

I believe this error is only if you are using the web IoT polling - is the poller complaining.

probably. no idea where.

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?