Thanks for these information.
I have now my local key and I configured local tuya with it. But the integration of my device (Konyks plug with power monitoring) is not providing me power measurements. It looks like the right DPs are not discovered by local tuya. I have only DPs 1, 2 and 7. And 2 and 7 are always 0!
But In Tuya IoT platform I can see power measurement values and also inside “Smart Life”.
So strange !
I have a problem adding devices to Local Tuya in Home Assistant. I am 99% certain that I have the correct ID’s and secret but I am getting an Unknown Error message.
Can any one tell me where I am going wrong from this ?
Logger: custom_components.localtuya.config_flow
Source: custom_components/localtuya/pytuya/init.py:704
Integration: LocalTuya integration (documentation, issues)
First occurred: 13:15:26 (3 occurrences)
Last logged: 13:20:50
Unexpected exception
Traceback (most recent call last): File “/config/custom_components/localtuya/config_flow.py”, line 580, in async_step_configure_device self.dps_strings = await validate_input(self.hass, user_input) File “/config/custom_components/localtuya/config_flow.py”, line 245, in validate_input interface = await pytuya.connect( File “/config/custom_components/localtuya/pytuya/init.py”, line 704, in connect _, protocol = await loop.create_connection( File “/usr/local/lib/python3.10/asyncio/base_events.py”, line 1064, in create_connection raise exceptions[0] File “/usr/local/lib/python3.10/asyncio/base_events.py”, line 1049, in create_connection sock = await self._connect_sock( File “/usr/local/lib/python3.10/asyncio/base_events.py”, line 960, in _connect_sock await self.sock_connect(sock, address) File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 500, in sock_connect return await fut File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 535, in _sock_connect_cb raise OSError(err, f’Connect call failed {address}’) OSError: [Errno 113] Connect call failed (‘192.168.1.159’, 6668)
Oh and the local key using the Tuya API Explorer to recover it.
Try to reload tuya integration or reinstall it.
It seems that some connection issue is the major reason for that error.
Hey friends, this is one of my favorite integrations because I was dumb enough to buy 45 Tuya wifi overhead lights.
I’m getting a Failed to Set DP error. Everything worked fine for about 3-5 months until recently (maybe after an update?)
Now, some of my devices disconnect and become unavailable until I restart HASS or sometimes reload LocalTuya and then restart HASS. Here’s the error:
Logger: custom_components.localtuya.common
Source: custom_components/localtuya/pytuya/__init__.py:259
Integration: LocalTuya (documentation, issues)
First occurred: 2:35:47 AM (88 occurrences)
Last logged: 3:08:11 AM
[eb0...8jz] Failed to set DPs {20: True, 22: 40, 21: 'white', 23: 230}
[eb4...m7m] Failed to set DPs {1: True, 3: 46, 2: 'white'}
[eb6...1yb] Failed to set DPs {1: True, 3: 46, 2: 'white'}
[ebd...v1m] Failed to set DPs {1: True, 3: 46, 2: 'white'}
[ebe...7ha] Failed to set DPs {20: True, 22: 46, 21: 'white'}
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/locks.py", line 390, in acquire
await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
return fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/localtuya/common.py", line 332, in set_dps
await self._interface.set_dps(states)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 557, in set_dps
return await self.exchange(SET, dps)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 486, in exchange
msg = await self.dispatcher.wait_for(seqno)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 259, in wait_for
await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout)
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
P.S. Watching closely, I noticed that sometimes the lights just go unavailable for a few seconds after I change a scene, then come back – until at some point they just won’t come back. (I.e. I change the scene, some of the lights go offline for about 5 seconds, but then can be controlled again.)
I don’t mind paying. But it’s $2500/mo USD
…which is a rip-off out of touch with reality
I seem to still be getting these errors. It’s really frustrating since I had it all working fine about 3-4 weeks ago. Now my entire house lighting is broken unless I restart HA every few hours.
Any ideas at all?
Logger: custom_components.localtuya.common
Source: custom_components/localtuya/pytuya/__init__.py:259
Integration: LocalTuya (documentation, issues)
First occurred: 1:29:35 AM (183 occurrences)
Last logged: 12:41:30 PM
[eb6...1yb] Failed to set DPs {3: 238, 5: '000e3a00e1ffee', 2: 'colour'}
[ebd...v1m] Failed to set DPs {5: '000e3a00e1ffee', 2: 'colour'}
[ebe...7ha] Failed to set DPs {24: '00e103e800ee', 21: 'colour'}
[eb8...xio] Failed to set DPs {5: '3a000e0159ffee', 2: 'colour'}
[ebc...2eh] Failed to set DPs {3: 238, 5: '3a000e0159ffee', 2: 'colour'}
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/locks.py", line 390, in acquire
await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
return fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/localtuya/common.py", line 320, in set_dp
await self._interface.set_dp(state, dp_index)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 553, in set_dp
return await self.exchange(SET, {str(dp_index): value})
File "/config/custom_components/localtuya/pytuya/__init__.py", line 486, in exchange
msg = await self.dispatcher.wait_for(seqno)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 259, in wait_for
await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout)
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
With 45 newly integrated wifi-lights, and most likely another huge amount of other wifi-devices, Zigbee device and “Disturbing” devices, i think i would start to look over my wifi-setting/setup, i doubt HA have problems handling the requests/communication, most likely you Router, or some interference on the 2.4ghz band
Lots of things could cause interference on 2.4ghz, also look into which Channels, the different integrations/device communicate over
December 2022 Updated steps:
Assuming device is added to Tuya Smart or SmartLife app already
- Go to https://iot.tuya.com/ and creat a project on cloud tab (on a computer). Make sure the data center you choose corresponds to the region you used to sign in to the app (for US, use West America Data Center).
- Go to Devices > Link Tuya App Account, click Add App Account, then from the Tuya Smart or SmartLife app (on mobile device) go to Me/Profile, click the scan QR code button in the top right, and scan the QR code, accept defaults
- Now under the Devices list, you should see your device(s). Copy the Device ID you want.
- Go to “Service API” tab at top, it will prompt you to authorize (or click “Go to Authorize”). Select IoT Core and authorize it.
- From sidebar menu go to Cloud > API Explorer Menu, and choose “Smart Home Device System” > “Device Management” > “Get Device Details”
- Insert the “Device ID” from step 3 and submit request
- At right you will see a list of details and you will find the requested local key
- Insert local key and device ID where needed in HA
After having used local tuya for a while, the sober reality is it is REALLY buggy. I have hit my head on the wall too many times troubleshooting these same issues. Until we get a lot of these resolved, I’ve switched back to the default tuya integration. There is a little more lag at times, but atleast I don’t have connection timeouts and resets every 2 weeks. Im hoping that eventually tuya devices will support homekit and/or matter and then we wont have to worry anymore.
Hello everybody and Happy New Year.
I am new in the home assistant and i would like your support.
I am using Local Tuya version 4.1.1 on a HA core
I’ve added a tuya device and i need to add additional entities. I cannot find the way to do it. It gives me the option to delete an entity but not to add one.
Also if i try to add another device and i make a mistake with an entity then i do not have the choise of deleting the new device. The only choise that i have is to delete the ntegration and rebuild the all devices.
Is there a simple way to resolve this issue or be able to edit the config file of the local tuya?
Thank you in advance
I have two outdoor BT lights that are connected to a Calex BT Mesh Gateway.
I can see and control the two lights via the Tuya app and can see them in the IoT platform website.
Local Tuya sees the BT Mesh and I’ve got the local key from the website, but I cannot add it to HA:
Connection to device succeeded but no datapoints found, please try again. Create a new issue and include debug logs if problem persists.
Has anybody setup Local Tuya with a BT Mesh?
Now, I can’t get the local key because the free plan it’s only for 30 days. And I get and error “No permissions. Your subscription to cloud development plan has expired.” when I try to get the device ID. So the devices that I add on those 30 days are working, but new devices that I brought last week, I can’t add them to HASS. The normal Tuya integration also stop working…Probably because of the same reason. Is thewre anyone with this problem? HASS and Tuya are up to date.
You should be able to subscribe for free for 6 or 12 month (forgot). After that period you can resubscribe for free.
@Loeffel is correct - you have to apply for a free subscription, explain in the text box somewhere that it’s just for your personal house, then wait a few days for them to approve it. But it does work eventually, for free.
Yhis is exactly what I have been looking for - TLDR I got a bunch of Teckin stuff for cheap on FB marketplace and have had a pain getting them to work in HA
I have tried linking both the Tuya and SmartLife apps to iot.tuya projects - except every time it says connected but does not list any devices. I have a good night routine set up with google assistant I want to import to HA as it’s a long routine and my home mini takes about 30s to start the routine. I want it local but both sidetable bulbs and the main light switch are Tuya and I cannot for the life of me get them viewable with the standard Tuya integration!
anyone else encounter this and have a solution? my smartlife app says I have reached my limit of 2 connections and I have 1(assuming there are also only 2) in tuya and no way of unlinking the accounts as they are not listed in either app to unlink and try again
Not anymore. But my subs are expired and it still works on the integration screen.
A Device you “Delete” in /Settings/Devices/Device/Device Info - 3small dots
In Normal Cases the Devices you have “paired” in a Tuya-Smart APP, will show up a Tuya.iot/your Project , And later in the ha integration, if correct installed
IF you want to add a Device that’s not in your Tuya-Project ( or even if it is ) , you go to /Settings/Integrations/ Tuya-Local / Configure / Add-Device (submit) / ADD New Device /… 3 smal horizontal dots, in the button … there you fill in what’s demanded
Sorry for not replying sooner.
Thank you for the information.
I will go through what you suggested and see from there.
Regards