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
874 stars 206 forks source link

tuya V2 suddenly unable to sync status #740

Open cyh801 opened 2 years ago

cyh801 commented 2 years ago

Door sensor wifi suddenly unable to sync status to hassio ,but it can sync status to tuya app.

core-2021.11.5 supervisor-2021.12.2 Debian GNU/Linux 11 (bullseye) tuya v2 - 1.6.0

Gferretta commented 2 years ago

Idem with lights..... dont sync or not able to ON/OFF Reloading integration on "Configuration -> Integration" and work again .... for a short time.

nrsfhass commented 2 years ago

Same here... Started after HA last update... If I RELOAD the integration it works for some time then stop working and get unsync.

Version | core-2021.12.2 Installation Type | Home Assistant Supervised Development | false Supervisor | true Docker | true User | root Virtual Environment | false Python Version | 3.9.7 Operating System Family | Linux Operating System Version | 5.10.63-v7l+ CPU Architecture | armv7l

nrsfhass commented 2 years ago

Looks related to issue: [https://github.com/tuya/tuya-home-assistant/issues/731]

FrankJaco commented 2 years ago

I concur with several of the above reported issues. Since the recent .12 HA update, the Tuya integration seems to "break". Lovelace controls do not report the current state, nor are able to change their state. A simple reload of the integration will fix the issuse every time. It will then work for awhile, then the problem returns. I have bulbs, dimmers and PIR's using Tuya and they all are affected. BTW: They are integrated via the "SmartLife" app. fj

ngdemigod commented 2 years ago

Yeah I agree I’m having the same issue and trying to find a solution

nrsfhass commented 2 years ago

As a workaroud you can make an automation to reload Tuya V2:

nrsfhass commented 2 years ago

You need to especify one tuya device but the hole integration will be reloaded.

Like this:

alias: Fix - Reload Tuya Integration description: '' trigger:

Source:https://github.com/home-assistant/core/issues/61854#issuecomment-996775002

DMWTI commented 2 years ago

Same here - switch states are correct on reload/reboot but change in switch state is not updated in UI whether or not the change was initiated by the UI. When initiating change via UI, it shows the switch to be in the opposite position for a few seconds, then changes back to initial state. The actual physical switch is activated or deactivated as expected, but then state shown is wrong.

flyingwolf79 commented 2 years ago

Noticed that this also coincided with the changeover to the IoT package at the Tuya account, it now only runs for a maximum of 6 months before needing to be requested again and approved.

developerminna commented 2 years ago

Also having problem with this. Device status not updating anymore after latest update. Same problem on two different HA instances with different tuya developer accounts.

flyingwolf79 commented 2 years ago

Also having problem with this. Device status not updating anymore after latest update. Same problem on two different HA instances with different tuya developer accounts.

Check out the automation suggestion by DMWTI above me, works a treat.

broizter commented 2 years ago

Don't think it's related to a recent home assistant update. Same problem on version 11.3

MaxK99 commented 2 years ago

This is a recurring problem:

https://github.com/tuya/tuya-home-assistant/issues/731 https://github.com/tuya/tuya-home-assistant/issues/733 https://github.com/tuya/tuya-home-assistant/issues/740

https://github.com/home-assistant/core/issues/59643 https://github.com/home-assistant/core/issues/59689 https://github.com/home-assistant/core/issues/59872 https://github.com/home-assistant/core/issues/59874 https://github.com/home-assistant/core/issues/59911 https://github.com/home-assistant/core/issues/61820

jocamane commented 2 years ago

enough for me. I will leave the home assistant and keep the smart life that has no or very few problems. It seems that the HA people don't care about the TUYA community and I had the information that after 1 year I have to pay tuya's IOT $5000 USD !!!! crazy man

nethead25 commented 2 years ago

Definitely seems Tuya related and not HA. Reverted from 12.2 to 11.3 backup that was working fine before and seeing the same behavior. I also recently re-upped my trial account for 6 months but it seems to have been fine for a while after that, so not sure it’s correlated.

Mucka911 commented 2 years ago

Yes same issue here thinking of just going local at this point I cannot keep fixing all my Tuya devices

eingram23 commented 2 years ago

For setting an automation to reload tuya, how often does it need to be reloaded? What interval?

flyingwolf79 commented 2 years ago

For setting an automation to reload tuya, how often does it need to be reloaded? What interval?

I set it for every minute in my case, takes only a moment to reload, won't hurt anything, very little overhead.

FrankJaco commented 2 years ago

Although I haven't timed it, I seem to get at least an hour or so before I have to go back and reload the Tuya integration again.

How do you script an reload?

fj

flyingwolf79 commented 2 years ago

enough for me. I will leave the home assistant and keep the smart life that has no or very few problems. It seems that the HA people don't care about the TUYA community and I had the information that after 1 year I have to pay tuya's IOT $5000 USD !!!! crazy man

This makes no sense.

Tuya IS SmartLife.

It is TUYA that is creating this issue, first, they locked up their API, then put it behind the login requirement, then changed the services without notice, and now have us in a limbo pattern of either being able to use the service we paid for (via the products we purchased) or paying them directly thousands of dollars to use the product despite the 3rd party that we purchased the products from already paying that, otherwise, the SmartLife app would not be working.

I wonder how heavily invested in Evergrand Tuya was, maybe that's why they need money now lol.

Home Assistant is running in circles trying to keep your things working as Tuya makes breaking changes weekly.

So why are you mad at Home Assistant and going directly to the company causing the issue in the first place?

flyingwolf79 commented 2 years ago

Although I haven't timed it, I seem to get at least an hour or so before I have to go back and reload the Tuya integration again.

How do you script an reload?

fj

https://github.com/tuya/tuya-home-assistant/issues/740#issuecomment-997017887

Gferretta commented 2 years ago

You need to especify one tuya device but the hole integration will be reloaded.

Like this:

alias: Fix - Reload Tuya Integration description: '' trigger:

  • platform: time_pattern minutes: '01' seconds: '01' condition: [] action:
  • service: homeassistant.reload_config_entry target: device_id: ADD YOUR OWN TUYA DEVICE HERE mode: single

Source:https://github.com/home-assistant/core/issues/61854#issuecomment-996775002

I did the automation to reload the integration every hour. But not everything is good, since every time it recharges, the states of the devices are lost, and certain automations that I have armed on the TUYA devices, I had to adapt them because they were always executed. I hope this error will be solved from the root, either by HA core or by TUYA side.

steveguitar78 commented 2 years ago

Hi, same issue. I hope this will be solved.

flyingwolf79 commented 2 years ago

Heads up, chances are you did not get the email from TUYA that they changed out the api access you signed up for, you need to go back to the site, navigate to the API services, and reapply, it is free, but only good for 6 months now.

controller999 commented 2 years ago

well thats it for me, i will replace my tuya devices with devices that actually work. I expect an addon to work out of the box and not have to find a work around or renew it every 6 months. I'm not too sure about home assistant either, i do have a life to lead

Aasikki commented 2 years ago

@jocamane it's tuya that doesn't care about home assistant. I've already bought my last Tuya product, enough of this beta integration released as stable.

flyingwolf79 commented 2 years ago

well thats it for me, i will replace my tuya devices with devices that actually work. I expect an addon to work out of the box and not have to find a work around or renew it every 6 months. I'm not too sure about home assistant either, i do have a life to lead

Tuya does work out of the box, with their software.

If you want it to work with a 3rd party software that by its very nature is an enthusiast's program that requires manual manipulation of configuration files, then you are in for a bad time.

If you want a 3rd party program that has licenses and works with the product and is easy to use, requires no coding skills, and does not require you to tinker with things, then you can expect to pay more than 0 for it.

What you are asking for is for a 3rd party, highly polished, fully working, partnered program, for free.

You are not going to get that.

flyingwolf79 commented 2 years ago

@jocamane it's tuya that doesn't care about home assistant. I've already bought my last Tuya product, enough of this beta integration released as stable.

Agreed.

HA has done the best they could with working past the deliberate breaking changes by Tuya and then working together to create the current system, HA has gone out of its way to make it work.

From now on I will be voting with my dollar and while I may spend slightly more, it will be worth it to work with a system that is not going to put up roadblocks in the way of its userbase.

martijn1247812 commented 2 years ago

Same issue here, even with Smart Life app one zigbee device is not responding (correctly/stable) (only one I have because I use the Google Assistant - Tuya integration for voice control, and the others are 'directly' via Zigbee2MQTT) . I think Tuya uses also MQTT , maybe that's conflicting?? I receive an error in the HA-logs:

Logger: tuya_iot
Source: /usr/local/lib/python3.9/site-packages/tuya_iot/openmq.py:161
First occurred: December 21, 2021, 20:08:25 (8 occurrences)
Last logged: 10:31:37
error while get mqtt config

Also in the iot dashboard of Tuya I see a lot of errors occuring; starting from 14-dec)

And I see a warning in My Services - Resource Pack: Resource Pack Name Start Date End Date Service Status Operation Trial Resource Pack 2021-11-24 13:20:59 2021-12-24 13:20:59 Resource exception View Usage Resource Details

Click on Resource exception:

jocamane commented 2 years ago

@jocamane it's tuya that doesn't care about home assistant. I've already bought my last Tuya product, enough of this beta integration released as stable.

yep, but if i work with tuya smartlife i don't have any problems. In HA every day exists problems. this is a fact. I don't care whose fault it is. I want is a stable system 99% of my devices are tuya.

MrPaulAR commented 2 years ago

Can we please keep this on topic which is discussions specific to how a developer can solve this issue.

On Wed, Dec 22, 2021 at 9:55 AM jocamane @.***> wrote:

@jocamane https://github.com/jocamane it's tuya that doesn't care about home assistant. I've already bought my last Tuya product, enough of this beta integration released as stable.

yep, but if i work with tuya smartlife i don't have any problems. In HA every day exists problems. this is a fact.

— Reply to this email directly, view it on GitHub https://github.com/tuya/tuya-home-assistant/issues/740#issuecomment-999683050, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4XLQEN3ZCMXKSQOXB3W4TUSHYGZANCNFSM5KINIGLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

pjtxxx commented 2 years ago

I don't know if this is just coincidence and it's been fixed but i was having t his issue when running on a pi 4 in argon 1 with ssd. have just swapped to an old acer comp and everything is now ok

System Health

version core-2021.12.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.83
arch x86_64
timezone Europe/London
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4288 Installed Version | 1.18.0 Stage | running Available Repositories | 986 Installed Repositories | 29
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 13 January 2022, 00:00 relayer_connected | true remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | false remote_server | eu-west-2-0.ui.nabu.casa can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 7.0 -- | -- update_channel | stable supervisor_version | supervisor-2021.12.2 docker_version | 20.10.9 disk_total | 118.5 GB disk_used | 8.0 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | Duck DNS (1.14.0), MariaDB (2.4.0), Samba share (9.5.1), Studio Code Server (3.7.0), Mosquitto broker (6.0.1)
Lovelace dashboards | 2 -- | -- resources | 13 views | 7 mode | storage
nethead25 commented 2 years ago

Not yet resolved for me. It does take a break and stay working for a bit, but when it's happening it is exactly every two hours (well two hours and one minute, oddly enough), which certainly feels artificial. I set up the automation provided in the other github issue to catch the log errors, and the most recent triggers have been (US EST) at 6:18pm, 8:19pm, 10:20pm, 12:21am, 2:22 am, 4:23am, 6:24 am. It looks like it only died once yesterday before that, and it was 'due' to break today at 8:25am but it did not, so it's not 100% consistent.

martijn1247812 commented 2 years ago

Hi, all the people who have issues with Tuya, do you all use also use Zigbee devices connected to Tuya? Thus via a bridge? I was not able to connect HA to any Tuya device anymore (Wifi & zigbee). Also at some point I was not able to control my zigbee-Tuya-bridge devices anymore from Google Assisistent. This triggered me and found out that I was not able to control Tuya-zigbee devices from out of my home-network (eg cellular); the wifi tuya deviced i still could control. I disconnected my zigbee-tuya bridge and reconnected: problems seems to be disappeared. (to be complete I must say that I also had to restart my HA for other reasons, bur earlier the Tuya connection didn't work correctly after restarting HA or reloading the Tuya integration) Keep you posted!

nethead25 commented 2 years ago

Nothing zigbee related over here. Everything is native tuya

flyingwolf79 commented 2 years ago

No zigbee devices here. I have to reload the integration every hour to ensure my automation works.

tabnul commented 2 years ago

seems the same as https://github.com/tuya/tuya-home-assistant/issues/743

tabnul commented 2 years ago

https://github.com/tuya/tuya-iot-python-sdk/pull/51

irarkh commented 2 years ago

I am so happy that I just get 2 tuya devices! Same issue here. Although I renewed my tuya iot for another 6 months, as in the new platform it is valid for one month of free use, but the issue continues. My concern is while it is a general fault for tuya integration no one gave a stable solution. Just thousands of issue reports with no solution shows the time to forget stupid tuya devices!

tabnul commented 2 years ago

I am so happy that I just get 2 tuya devices! Same issue here. Although I renewed my tuya iot for another 6 months, as in the new platform it is valid for one month of free use, but the issue continues. My concern is while it is a general fault for tuya integration no one gave a stable solution. Just thousands of issue reports with no solution shows the time to forget stupid tuya devices!

See link above. There is a stable solution, actually allready fixed in python sdk and you can patch it by hand if you like .

Now wait for HA to include it..

tabnul commented 2 years ago

solved by installing homeassistant 12.6

flyingwolf79 commented 2 years ago

solved by installing homeassistant 12.6

Does 12.6 include the updated python code?

EDIT: Confirmed, checked the changelog, https://github.com/home-assistant/core/pull/62858

tabnul commented 2 years ago

solved by installing homeassistant 12.6

Does 12.6 include the updated python code?

EDIT: Confirmed, checked the changelog, home-assistant/core#62858

Yes

martijn1247812 commented 2 years ago

It’s not working properly, the switch jumps back however after a while the switch is set, but the behaviour of the HA front end is undesirable.

kidrocker151 commented 2 years ago

I'm on 12.7 and it's still an issue. Reloading the integration gets it working again. Gonna set up the automation to reload it as described earlier in this thread to at least get it working for now.

jocamane commented 2 years ago

hi. I have the same problem. some tuya devices no sync status and automations faill. I have 12.7 and is not solved. This is a very old problem

Jucgshu commented 2 years ago

Add me to the 'I still have problems with tuya's ha integration'. Bugs happen all the time, and it's okay. Bugs that last that long are irritating.

EDIT: I just read the readme mentioning Tuya won't support this integration anymore. Damn, those guys blew it.

irarkh commented 2 years ago

Guys if you have still problem with tuya integrated devices after upgrading to the latest HA core let's give a try to the way I managed to solve my same problem. I removed my devices from my tuya iot and add them back. By this way my problem was solved. Be sure to request iot extension for 6 months first. Then remove and add back devices. Last restart your HA core.

mikeybatoz commented 2 years ago

You need to especify one tuya device but the hole integration will be reloaded.

Like this:

alias: Fix - Reload Tuya Integration description: '' trigger:

  • platform: time_pattern minutes: '01' seconds: '01' condition: [] action:
  • service: homeassistant.reload_config_entry target: device_id: ADD YOUR OWN TUYA DEVICE HERE mode: single

Source:https://github.com/home-assistant/core/issues/61854#issuecomment-996775002

thanks this worked fantastically, granted i only have two things on this integration which work in conjunction of each other. Again thank you

mikeybatoz commented 2 years ago

also i dont know if this helps but i found on tuya iot cloud site , i had to go from eastern to western us zones to pickup devices.

then i downgraded to tuya v2 5.0 to be able to integrate my devices, they failed on 4.2 and 6.0. I havent upgraded it yet, i did integration yesterday