Any stable way to control Tuya devices?

I’m really reaching the end of my tether with my Tuya devices, and right now I’m thinking of flinging them all out in exchange for something else :frowning:

I have tried both the cloud integration and the local integration and both seem to have their problems…

With the standard cloud version, I seem to get no reporting of state changes (which makes toggling somewhat tricky) - seems I’m not alone

With the local version, I’m having issues actually adding devices… some have added fine, others add fine then stop working, some receive an “unknown error” which when checking the logs is related to Asyncio.py (i think - log below - also seems others have this issue on github)

I have managed to add some devices after a restart once receiving this error but not others…

Given how prolific Tuya devices are, I figure there must be some people around here who have managed to get things working stably with Tuya?! If so, can someone advise how!

Thanks

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/config_flow.py", line 533, in async_step_configure_device
    self.dps_strings = await validate_input(self.hass, user_input)
  File "/config/custom_components/localtuya/config_flow.py", line 242, in validate_input
    detected_dps = await interface.detect_available_dps()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 539, in detect_available_dps
    data = await self.status()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 481, in status
    status = await self.exchange(STATUS)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 476, in exchange
    return await self.exchange(command, dps)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 460, in exchange
    msg = await self.dispatcher.wait_for(seqno)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 247, 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

My plan is to replace the chip on them.
I have bought the chips, I just need the time to do it.

2 Likes

Tell me more… How do you change the chip on them?

This is one option for sure.

Another one might be on the horizon for some tuya chips:

I have more or less promised myself to never buy a Tuya device again, at least not a wifi Tuya.
Perhaps one day they will fuck up their ZigBee devices too and they are completely removed from my list.

1 Like

Thanks, so what’s the advantage of changing the chip vs flashing tasmota or similar (which I think I saw ages ago but mostly ignored!)

This looks interesting, tho very early! I’d like to get something sorted sooner rather than later!!!

To be able to flash tasmota (or esphome) you need to have a compatible chip first. Here comes the transplant into the game - you change the incompatible chip against one you can “own” (flash with *ware you want) to be finally be free :dancing_men:

This project actually is envolving very quickly. The main author is very active and can be easily reached on discord were people already announcing success freeing devices :rocket:

It even works with tuya-cloudcutter :cloud::scissors: which might make it possible to “own” devices over the air (like the good old tuya convert)

I might need to take a look at Tuya convert - I think many of my plugs are ‘old’ so perhaps that may still work :question:
EDIT: quick peek and it seems related to firmware version as opposed to hardware version… my devices have almost certainly updated :frowning:

My solution to tuya or sonoff wifi devices was to replace them with zigbee ones. This was only permanent solution for that problem. And I tried everything. I even managed to unpair tuya wifi switches from the cloud and use local tuya only i flashed firmware on sonoff devices and replaced it with tasmota but basically nothing changed in long run.

This pretty much sums up how I’m feeling about them right now
I actually don’t care about using them in the cloud for most of my devices… IF THEY WORKED!
The fact that they don’t is the kicker

Yeah I know. Go for zigbee ones and replace everything that doesn’t work. I have around 10 tuya switches left and they are working more or less fine bit they are also for replacement.

I bought my first sonoff back in the year 2017 (more than five years ago) and I tried all the *wares available at the time like tasmota, espeasy or espurna. It was a game back then but already awesome what all is possible if one is not only owning the hardware but the software/firmware too! :+1:

The game went on and with esphome the game changer was born. I think it was 2019 when I successively moved all my esp based hardware over to esphome and were able to turn the obsolete mqtt broker of because till today I rely on the native api for the communication between ha and esphome. This type of communication is “Local Push” and the best of all possible means available. :rocket:

Today my “smart home” almost only exists of esp based devices all flashed with esphome. There is a lots of benefits “really” owning devices (not only the hardware) as it allows to implement extra features the vendor didn’t include. For example safety features like a automatic turn off when a certain wattage is detected for a certain time (very useful to protect pumps of running dry for example). Another thing could be to improve the send interval of power metering hardware - typical z-wave/bee/etc. hardware often has a fixed interval at might only report every 10 seconds for example. For my whole house energy monitoring with esphome I use a 0.1 second interval which makes it possible (with other esphome based hardware) to do load control (if one has for example high/low energy tariffs or wants to maximize their on solar usage) :sunny:

The cloud will never achieve the reliability you can expect from devices working with local push :bulb:

Okay, I’m starting to get a little out of my knowledge depth here, so probably need to do a little research, but if I’m understanding correctly…
I may be able to flash esphome onto my Tuya devices OTA? Which will then give them local push?
Is there a good guide for this (or to identify if it will work on a specific device?)

If that will work you essentially drop the stock firmware (“operating system”) with esphome which will allows you using the native api (local push) communication with ha.

I didn’t do that myself because I avoid all products that don’t have a esp inside as they don’t allow me full ownership (that’s what I want because I like local control and privacy :stuck_out_tongue: )

As this is still very much in development it is not to easy yet - but I guide can be found here:

And a test if a device is “ownable” can be found in the githubs of tuya-cloudcutter :cloud::hocho:

Thanks. I just came across some different instructions here: Prepare a device with tuya-convert | ESPHome-Devices - that suggest Tuyaconvert (vs LibreTuya)

Is tuyaconvert no longer a sensible way to do things?

For example - I have a few of these Maxico W-UK007S | ESPHome-Devices - seems they’re supported by ESPHome so would be great to get local control…

1 Like
  • Tuya-convert only worked for esp based tuya products and mostly doesn’t work anymore on newer devices because of firmware fixes in the tuya stock firmware.

  • Tuya-cloudcutter is for some non-esp based tuya devices. For this non-esp based chips LibreTuya is in development to make them compatible with esphome.

Then you are lucky because they have esp inside already! No need to do a transplant and with some luck (if they are older devices) you might be able to “free” them over-the-air with tuya-convert :rocket:

What is always possible if you have esp based :brain:'s inside is to flash them the “hard” way by attaching a serial adapter… depends of the device that can be quite time consuming (specially opening devices which are not really designed to be opened :put_litter_in_its_place:)

1 Like

Looking at an image of the device there is an interesting circle in the middle.
I would definitely try an open it and connect wires. If it is as easy as it looks then it might be faster than trying to get tuya convert working.

1 Like

Maxcio W-UK007S Power Monitoring Plug Configuration for Tasmota
Successfully flashed via Tuya-convert as of November 2020.

Might just work but setting up all the tuya-convert stuff is indeed a time consuming and somewhat confusing experience. If the device is easy to open (typically screws allow that) than flashing with serial might be really the fastest and less frustrating possibility :+1:

1 Like