tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
856 stars 206 forks source link

Slow response between Homeassitent and Devices #704

Open 4411nash opened 2 years ago

4411nash commented 2 years ago

Describe the bug When clicking a button in HA it takes multiple seconds before a device is responding. Buttons in HA switching by its self to on en off state by it self.

Expected behavior When trigger a button a light goś on direct. The button in in HA stayes on.

Screenshots

Home Assistant Version My normal system:

System Health

version core-2021.11.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.17-v8
arch aarch64
timezone Etc/GMT
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 5000 Installed Version | 1.17.2 Stage | running Available Repositories | 912 Installed Repositories | 10
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | pending
Home Assistant Supervisor host_os | Home Assistant OS 6.6 -- | -- update_channel | stable supervisor_version | supervisor-2021.10.8 docker_version | 20.10.8 disk_total | 58.0 GB disk_used | 6.2 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | Duck DNS (1.14.0), File editor (5.3.3), Let's Encrypt (4.11.0), Mosquitto broker (6.0.1), Samba share (9.5.1), Terminal & SSH (9.2.1)
Lovelace dashboards | 5 -- | -- resources | 1 views | 21 mode | storage

And a clean install only with Tuya V2

System Health

version core-2021.11.4
installation_type Home Assistant Core
dev false
hassio false
docker false
user homeassistant
virtualenv true
python_version 3.9.8
os_name FreeBSD
os_version 12.2-RELEASE-p10
arch amd64
timezone Europe/Amsterdam
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Lovelace dashboards | 1 -- | -- resources | 0 mode | auto-gen

Device info (please complete the following information, which can be found in log): like this: 2021-11-18 10:17:49 WARNING (MainThread) [haffmpeg.tools] Timeout reading image.

This is all in the log from the clean system.

Additional context Add any other context or logs about the problem here.

maxxadytzu commented 2 years ago

Hello , I do have same problem on the latest version, the buttons are not responsive and it takes a while to update the status of the device. Thank you

mohsenheravi commented 2 years ago

Same here. I'm removing all smart devices off my property. I will sell them on ebay, use the money on a good meal, and won't ever look back. If the smart home industry doesn't respect the consumers time and money to come up with a decent system and continues wasting our time, I guess people should just stop buying their garbage. I really regret wasting my time on poorly developed systems like tuya or broadband and trying to get home assistant to work.

goobags commented 2 years ago

Worthwhile noting that through the Smart Life app, the response time is very fast as usual, just through HA it has become painfully slow or not responsive at all. I have noticed it will generally fire the correct state, but not update in HA, therefore if you rely on state changes for other automations, it's useless.

Agree with above comment, Home Assistant and Nabu Casa are doing great things but the OEMs need to sort it out. C'mon local Tuya!

74Rog commented 2 years ago

Same issue as goobags reported. Tuya Smart Life app works perfectly. But there is a considerable delay in home assistant identify a state change. Until the state change has been registered, (e.g. off to on) you cannot change the state again through HA until the state change is updated.

mohsenheravi commented 2 years ago

I understand that right now, it's more about home assistant and Tuya is working fine, but they have their moments every now and then, too. I have not been able to install local Tuya yet and am using the old one. Tuya2 integration returns authorisation error no matter what. I honestly realized I have wasted just too much time on this. As long as we do the leg work for IoT manufacturers, they won't feel like they need to fix their products because the consumer will find a way to get their ...rap to work. I mean, Broadlink for example. I bought a 4-Button for $40. It won't work with Home Assistant, it is recognized as 4 sensors in Amazon and may or may not trigger routines based on Jeff Bezos' mood, even might or might not be detected when I press the button. Now I looked everywhere to fix it, and the company is so arrogant they don't even bother acknowledging the problem. I realized it's our fault. We are throwing our money at them, and cheer in joy when we find a way to get their garbage to work. Not any more I am not!

mohsenheravi commented 2 years ago

I know it is irrelevant to HA and apoligize for that, but just to support my argument above, since today Tuya (or Amazon) has messed up my Alexa, too. When I ask Alexa to turn on my TV using my IR Tuya blaster, Alexa doesn't respond to volume change commands (its own volume). The response from Alexa will be "TV doesn'y support that"!!! You have to ask Alexa about weather or something first to get volume functions to work again.

4411nash commented 2 years ago

The front page claims that Tuya is cooperating with this integration. I have now found out that the slow response of buttons in HA and the response of the Tuya devices is not due to this plugin, but to the Tuya system itself.

I find it strange that there is absolutely no reaction here from the makers and from Tuya himself.

Canonfodda commented 2 years ago

The same issue as goobags and 74rog reported. Tuya Smart Life app works perfectly. But there is a considerable delay in-home assistant identifying a state change. Until the state change has been registered, (e.g. off to on) you cannot change the state again through HA until the state change is updated. There do not seem to be any errors reported in the logs. I suspect this may be at the HA to Tuya interchange as my log files on the Tuya developer site are showing unknown entries in the logs as well as valid entries. This is new since core-2021.11.4 and supervisor-2021.10.3 were installed. I don't remember supervisor-2021.10.2 having problems but I don't have documentation to support this. I'm based in Australia and Tuya is setup to use the Europe data center as spec'd in the Tuya notes...... Dont know why Tuya would require Europe as New Zealand is spec'd as connecting to Western US data center. (same pacific link networks and same geo aliances)

joseal70 commented 2 years ago

I was on HA 2021.11.1 and it was working fine without delay, and yesterday the HA delay started happening to me. Today I have updated to 2021.11.5 and it continues with the same delay. In the Tuya app it works correctly.

Usandu commented 2 years ago

The same problem here guys, I have plenty of automation done via, Door/windows sensors which are all Tuya based and talk with its ZigBee bridge. However, it is totally useless at the moment because sometimes it takes up to 10min to even notice that door/window has been opened, so not a single automation triggers. Same applies to tuya thermostats, the temperature may change a few times before anything gets registered in Home Assistant.

Hopefully Tuya/Home Assistant can look into this, I could accept 15sec delay, but sometimes up to 15mins, it's way too high. It is all instant for both Smart Life APP, as well as google home, I can see state changes appear there almost immidietly, must be something on the line between HomeAssistant and Tuya.

oscarvanhees commented 2 years ago

I have the same problem. Buttons stay on or off for a while and can sometimes only be reset manually. This was not the case for the last of HA. The TUya/smartlife app does work properly. I hope this bug can be fixed.

edit 22.11.2021 : I do believe that there will be a solution in the future, but I don't want to wait for this. I've wanted to switch to local-tuya for some time and now I've seized these problems to switch......

With more than 30 tuya devices quite a bit of work, but once it is installed it works perfectly (is also faster)...........

willsmarthome commented 2 years ago

I Have the same problem here!!!! Not only slow, but sometimes it seems stop working totaly. When I restart the Tuya Integration it works again and the devices are updated. HA is running on the latest Core and OS versions,

Usandu commented 2 years ago

Yup same thing it is really slow to respond at first and then stops working totally until I fully reload integration. Smart Home and Google home at the same time keep responding with tuya stuff perfectly

IvesCoppens commented 2 years ago

Same here! Very slow response and sometimes doesn't work anymore.

Docas09 commented 2 years ago

The status of all devices takes a long time to update, or never changes. The switches automatically switch status by themselves... I use the HA 2021.11.5 In tuya v2 1.5 it worked perfectly. The Tuya v2 1.6 version is a shame, as it spoiled all the good service achieved and practically nothing works. I had to go back to Tuya v2 1.5 which is fabulous. I'm fed up with Tuya and her experiences. LocalTuya is not a solution as I cannot integrate the 36 door sensors and the 27 motion sensors. I'm switching to Shelly and Zigbee devices.

moyuehan commented 2 years ago

Till yesterday everything on my home automation using HA/Tuya devices worked fine. Today all connections seem lost. I checked in the Tuya IoT Development Platform for any changes to the Service API for my project. I found one : IoT Core trial period of 1 month expired today, 2021/11/21. I signed up for an extension today 14:30 Brussels time. I am waiting now for "your applicaton for extension is being reviewed" by Tuya. My HA core 2021.11.4. I uploaded both HA core 2021.11 and new Tuya integration 2021/11/05. I made a Tuya IoT Development Account 2021/10/21. 21/11/21 16:00 I subscribed again for IoT Core and have now an expiration Time : 2021-12-21. Lets see for any effect.

4411nash commented 2 years ago

Hello,

Is there sombody how has a link to download version Tuya v2 1.5?

Docas09 commented 2 years ago

Olá,

Tem alguém como tem um link para baixar a versão Tuya v2 1.5?

No link required. If you go to HACS and ask to reinstall, it indicates the latest version and has a menu to choose the version you want to install.

frenck commented 2 years ago

⚠️ Please...

If you want to say: "I have the same issue", please don't! Just add a 👍 to the first issue post.

Thanks 👍

cwquek commented 2 years ago

I have the similar problem, switching my light switch or power strip with SmartLife app is stantaneous. But when using Home Assistant 2021.11.4 it takes a long timel, requires a number of attempts to switch before it actually does. I just upgraded to HA2021.11.5 same issue. Also reported here : https://github.com/tuya/tuya-home-assistant/issues/706

mrchappell100 commented 2 years ago

Same issues here... tuya app responds perfectly but HA continously lagging and sometimes not responding at all...

wbg0 commented 2 years ago

Toggling the switch in HA, to refresh your devices in Tuya Smart Life and then refreshing HA screen will update it right away. Maybe the Tuya integration could use an extra API refresh call or something to force a refresh with Tuya IoT.

steve1011011 commented 2 years ago

Looking at the Tuya Responses on the IoT platform, its not very intuitive..... If you send this :

image

The response you get is this :

image

If you send this :

image

The response is exactly the same......

image

not sure exactly what "result" means in this context, and why it is different to "success". Why double up on a success response of an API request. If "result" was the state of the switch from the original request, then HA could simply use that information to update the toggle statuses rather than waiting on Device Status Updates .

EDIT

ok, I read their API docs, and result can potentially be an object containing other info. Not sure why its a boolean in the case of lights and switches. Hopefully there aren't any decisions being made on this value in HA .

4411nash commented 2 years ago

I found a older version of Tuya V2, installed it, no success. Moved back Hassio to 2021.10, no success. Installed Tuya local, no success.

So is this a problem a plugin problem?

steve1011011 commented 2 years ago

Local Tuya is working fine for me for local - this is what my lovelace looks like - i've marked the devices entities relying on integrated Tuya here - note the mismatching device status :

image

Additionally, the log indicates that there is clearly a delay in the device status coming back from Tuya :

2021-11-23 11:24:27 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device 27845426dc4f22a75a16: [{'code': <DPCode.SWITCH_1: 'switch_1'>, 'value': False}]

2021-11-23 11:24:35 DEBUG (Thread-6) [homeassistant.components.tuya] Received update for device 27845426dc4f22a75a16: {'switch_1': False, 'countdown_1': 0}

The above took 8 seconds before receiving a response. Sometimes its longer. Sometimes nothing ever comes in .

Considering noone can fix it, even by rolling back, I suspect the issue is on the Tuya side and they must be handling / throttling dev api channel of hass, differently than say tuyasmart or tuyasmartlife .

Kinda makes sense, since they've probably had to segment the Hass traffic coming at them since the new integration went live, and god knows what issues they've been having .

Usandu commented 2 years ago

Local tuya is the only thing that works for me when it comes to responsiveness, unfortunately it cannot be applied to Thermostats and Window Sensors.

Everything else is as Steve above said, very slow at response or not responding at all as long as tuya cloud API is in use.

elyobelyob commented 2 years ago

If it was my business I wouldn't point a finger, but I'd let my users know the issue. We are all in the dark, and after the excitement, we are in ****ville. The silence is deafening.

Romancc commented 2 years ago

For me local tuya was the only working solution at the moment, it really seems to be a tuya cloud issue and not HA issue

steve1011011 commented 2 years ago

judging by the Tuya IoT platform....they charge a decent wodge for their different packages.....I do wonder if ultimately Home Assistant, being its own "Developer Channel" is being throttled so as not to impact their other paying customers.

image

mohsenheravi commented 2 years ago

I tried using local Tuya to see if that resolves the issue, but I keep recieving authentication error when I put my username and password in HA integration definition. There's a lot on that subject in the forum but long story short, they are all about using App credentials instead of cloud or avoiding gmail accounts etc., but nothing works for me. So I am stuck with cloud Tuya and well, it doesn't work anymore. I built everything based on Tuya and Home Assitant, and my whole home automation is down now. I really need this to be resolved.

svante-jacobsen commented 2 years ago

judging by the Tuya IoT platform....they charge a decent wodge for their different packages.....I do wonder if ultimately Home Assistant, being its own "Developer Channel" is being throttled so as not to impact their other paying customers.

Yes, this is a vald concern! One of many that had me replace all Tuya devices (very much fueled by last week's problems). Got my last 3 replacement devices delivered today. Goodbye Tuya!

zlinoliver commented 2 years ago

Hi guys, we are working hard on fixing slow response issue and will inform everyone once it’s fixed. Sorry for the inconvenience!

rasho6169 commented 2 years ago

I to have and still experiencing problem. What I have noted is that on my Tuya IOT developer the API Smart Home Device Management is no longer in API subscription, nor available as a selection. Could this be the root cause to recent Tuya Devices within HA

caitotheonlypotato commented 2 years ago

I am also having issues.

If a Tuya light is on, when restarting HA server all Tuya switch states are correct. If I then toggle the light in HA to 'Off', the state changes to off in HA and the light instantly turns off, however HA then reverts to state back to On, even though the light is off, so they are now out of sync. If I then try and toggle the switch in HA again, the light won't toggle because technically as far as HA is concerned I'm toggling from 'On' or 'Off' and the light is already off, unless I toggle 3 times in quick succession in HA. If I toggle a switch in the SmartLife app, it can take 10sec to a few minutes for HA to recognise the state change.

This renders critical automations relying on tuya product's sensors useless.

steve1011011 commented 2 years ago

I to have and still experiencing problem. What I have noted is that on my Tuya IOT developer the API Smart Home Device Management is no longer in API subscription, nor available as a selection. Could this be the root cause to recent Tuya Devices within HA

No....if you read the alerts Tuya put out, they have stated they moved all of Device Management into IoT Core subscription. The issue here seems to be how HA / Tuya are handling Device Notifications for Hass ( which is the Device Notification Service ). For some reason there is a delay / throttling of those notifications that started between 1 - 2 weeks ago . They are investigating.

maxxadytzu commented 2 years ago

Hi @zlinoliver

Thank you letting us know.

Do you have a timeline for when this will be sorted?

Thank you

svante-jacobsen commented 2 years ago

if you read the alerts Tuya put out

@steve1011011 where can we find these alerts?

steve1011011 commented 2 years ago

if you read the alerts Tuya put out

@steve1011011 where can we find these alerts?

They posted it on this page as a notice.....so only easy to find if you read the docs :

https://developer.tuya.com/en/docs/iot/membership-service?id=K9m8k45jwvg9j

web316 commented 2 years ago

Just received this somewhat unhelpful reply from Tuya suport:

Dear users,

We apologize for the inconvenience caused to you. Our technical staff replied: It may be that the mobile phone network is not good and it cannot be loaded in time. It is recommended that you try to change the mobile phone network or use a 4G network to configure the device. If the problem persists, it is recommended to uninstall the app, then download the latest version of the app from the app store and try again. If the problem persists, please provide us with the screen recording, APP name and version. Thank you for your support and understanding.

Best wishes,

svante-jacobsen commented 2 years ago

Just received this somewhat unhelpful reply from Tuya suport:

@web316, sounds exactly like my first response last week.

tubalainen commented 2 years ago

@web316 Its not 1st of April... WTx..?! For real?

Top 3 dumbest support answers of all time.

mohsenheravi commented 2 years ago

I don't mind if the esteemed moderator deletes my comment again, I still think the solution is to stop buying IoT garbage until they get their ducks in a row, Tired of researching and fixing my system everytime they break it.

steve1011011 commented 2 years ago

Not sure why people are contacting Tuya support. They won't want to know. Their support is with the Developers who subscribe to their plans, and ultimately the users of those cloud products going through paid for product apps ( e.g. Teckin / Woox / LePro ....etc..)

You are getting a free service here, a service which costs money to run and support on the platform. The apps that these products were made for, are fully working......therefore there is nothing you have to complain about.

I pay a Nabu Casa subscription.....I would very much support the Home Assistant Dev if they chose to implement a guaranteed service to the Tuya IOT platform for those subscribers . Who knows..... maybe that is the way it is headed? Its is certainly something I would consider if I was in this business as it would be beneficial to Tuya and Nabu Casa.

web316 commented 2 years ago

I am glad your app is working okay but mine isn't, I am having very similar issues on the Android app as on Home Assistant. Just this morning, I tried turning a light on and there was a gap of around ten seconds before it turned on and that was from the app, if I then go the the device control panel, many devices simply time out and I cannot get there. These devices which do not work as advertised cost me money, that is why I have something to complain about.

mohsenheravi commented 2 years ago

You are getting a free service here

I do apologise. I didn't realise Tuya is a charity service. All those good people working in China so that the mankind can flourish and prosper. I on the other hand, am a cheap selfish jerk who has spent just a few hundred dollars on devices that are supposed to be compatible with my system but are useless now, and for some strange reason I expect them to work. I also understand that I am an ungrateful vicious person that expects a system like Home Assitant work just because I have spent a couple of hundreds of hours to learn and implement the system tha has promised to work as a reliable IoT control system. So while people can complain if Instagram (also a free service) goes down for one hour and they can't receive 'likes' on their profile in that one hour, I should just shut up despite the fact that I had to replace the ligths and switches and revert back my garage door to manual in my home since the 'free' system is not working anymore! Nice.

steve1011011 commented 2 years ago

I don't mind if the esteemed moderator deletes my comment again, I still think the solution is to stop buying IoT garbage until they get their ducks in a row, Tired of researching and fixing my system everytime they break it.

Go local.

I am glad your app is working okay but mine isn't, I am having very similar issues on the Android app as on Home Assistant. Just this morning, I tried turning a light on and there was a gap of around ten seconds before it turned on and that was from the app, if I then go the the device control panel, many devices simply time out and I cannot get there. These devices which do not work as advertised cost me money, that is why I have something to complain about.

What App are you specifically having an issue with, because noone has mentioned they are having App issues so far with SmartLife or TuyaSmart....ONLY with HomeAssistant. I'm genuinely interested here as it might help me understand what is going on. fyi...if you have a Tuya device, you can go to any of those other apps easily, and it will work for you.

mohsenheravi commented 2 years ago

Go local.

Tried that, but I keep getting the "Authentication error" in home assistant integration. There are tens of remedies in forums on that, which as you might have guessed, none of them work.

steve1011011 commented 2 years ago

You are getting a free service here

I do apologise. I didn't realise Tuya is a charity service. All those good people working in China so that the mankind can flourish and prosper. I on the other hand, am a cheap selfish jerk who has spent just a few hundred dollars on devices that are supposed to be compatible with my system but are useless now, and for some strange reason I expect them to work. I also understand that I am an ungrateful vicious person that expects a system like Home Assitant work just because I have spent a couple of hundreds of hours to learn and implement the system tha has promised to work as a reliable IoT control system. So while people can complain if Instagram (also a free service) goes down for one hour and they can't receive 'likes' on their profile in that one hour, I should just shut up despite the fact that I had to replace the ligths and switches and revert back my garage door to manual in my home since the 'free' system is not working anymore! Nice.

You know what you are getting into with Cloud based Home Automation. A company could go bust, they could change an API ( look at what happened with the Nest Dev API when it moved to Google ). I have been in this game a while and my advice is to diversify or stick to a technology that won't be impacted by a cloud service going down or even your internet.

I have - Tuya switches and bulbs / Hue Bulbs / Zigbee2mqtt / Blink Camera / Nest Thermostat / Zigbee Thermostat / Tuya based Cameras . My main use is for home security / lighting / Heating Control, therefore to ensure maximum coverage, if one cloud service lets me down, I have a reasonable and cost effective backup.

When this issue occurred, I setup TuyaLocal . As others have said, I will now concentrate on shoring up my local devices elsewhere ( considering a google Coral USB accelerator and a cheap RTSP camera with Frigate for motion detection as I am certain the Blink integration will break one day for good ) .

Going all in on Tuya, without full LocalTuya HA dev support ( which by the way, we are told is coming ), is not a good idea until it arrives.

mohsenheravi commented 2 years ago

You know what you are getting into with Cloud based Home Automation. A company could go bust, they could change an API ( look at what happened with the Nest Dev API when it moved to Google )

That is my whole point! I didn't go after small companies for exactly the same reason. Tuya is a big big, big big big company now. Same for Smartthings, or Apple Home. If you can't trust even these companies, we'd be better off without IoT. I can't buy six cars from six different companies just because five of them might not start in the morning. What's next? 10 TVs, 6 coffee makers, 7 fridges, ...? I would just take the short cut and die in vain personally instead telling my wife that we need 10 different systems in the house to make it work. If they sell a service, directly or indirectly, it MUST work.

elyobelyob commented 2 years ago

Can we calm this down please.

The issue has been acknowledged by Tuya, they are looking to fix. We have to wait. It's not ideal, but it's technology and does sometimes go wrong.