Is anyone else having a problem with Tuya?

Anyone having a problem with Tuya intergration?

I’m new so bare with me please, ha!

Last night and today, my lights are acting very strange. Turn them on from the dashboard, the on screen switch slides to the right, the light turns on in the room, a couple of seconds go by and the on screen switch moves back to the the left, so “off”. Have checked the state in developer tools and its showing “off” but the light is on.

Sometimes it works fine, sometimes it doesnt. Same happens the other way with on to off, lights showing as on when they’re off.

Very odd.

I’m getting this in HA logs also:

2021-12-15 01:22:29 ERROR (Thread-4) [tuya_iot] error while get mqtt config
2021-12-15 03:21:30 ERROR (Thread-4) [tuya_iot] error while get mqtt config
4 Likes

Sometimes the lights are unresponsive too. Click on the button but nothing happens, but rarely that happens. Sometimes they’re completely fine. Right now as I’m writing this, I’m flicking the switches and they seem fine.

I am getting the same symptoms and log errors.

This is the sixth or seventh such issue with Tuya in the last couple of months.

I’m starting to wonder why the Tuya Integration does not come with an active warning, such as, for example, the TP-Link Kasa integration does.

I noticed today that my Tuya plugs had renamed themselves and added “socket_1” to the end of each entity ID. Maybe check to see if the entity names have changed?

I am having the exact same problem with a Tuya switch. Home Assistant does not seem to be receiving the device status notifications from Tuya. I have checked all the authorisations and everything is fine.

If I revoke and reauthorise the Device Status Notification service on Tuya IOT and then restart Home Assistant, it starts working again only to fail with the same MQTT Config error.

1 Like

I get similar issues as well the last 2 days. Reloading the integration seems to get it in sync again.

Yeah I’m having the same thing assuming it the notifcation service had similar at the start of the v2 beta but I never got them working properly in the beta, production was near perfect at the start only sucked it up and did the upgrade last week but for about the last three days it’s been having issues reloading at least let’s me turn them off but it’s getting annoying now. Glad I’m not alone but anyway ime going to resetting the tyua intergartion up from scratch tomorrow including using tb tuya cloud side as I used the setup from the v2 beta let you know how I go or if someone else works it out let me know.

I’ve had a lot of issues with Tuya since the last update

So doing a full re-setup doesn’t seem to have done anything to resolve the issue, reloading the intergration seems to be the best stop gap at the moment there’s a few post in the core Tuya intergraion githubs for this looks to be something affecting a lot of people.

Some refrences Maxk99

MaxK99 commented 2 days ago

This is a recurring problem and/or related to:
#741 This has a refrence for making a scritp to auto reload the tuya intergariton on MQTT error I’m goign to give that a try
#731
#733
#740

home-assistant/core#59643
home-assistant/core#59689
home-assistant/core#59872
home-assistant/core#59874
home-assistant/core#59911
home-assistant/core#61820

I also have an issue with my tuya PIRs they have that beta behaviour.
i do not run them over mqtt.

/F

I have the same problem. Only reloading the integration gives me the right status for my devices when this happens. But I have to reload it very often.
Generally the command is given, the physical switch or light changes its state, but the button in HA gets back to previous state waiting for me to reload the integration.

For the moment that the problem is there (for over a month now I guess) is there no local script that can be applied to reload all Tuya appliances in 1 go maybe every 30 minutes or so?
I think I have seen a script for which you have to reload every singe device which is clearly a lot of work for some people. If you can do it with 1 mouse click on the integrations page then why should it not work with a simple script?

Any solution? I have the same behavior.

sorry i was late to the party .

What problem everyone is talking about ? using localtuya or TuyaV2 ?

Tuya integration in 2021.12 stops working after 1 hour. Reload makes it working again for 1 hour. The old integration works well.

1 Like

same here , workaround is localtuya

you can create an automation:

In configuration.yaml add (or confirm it contains):

system_log:
  fire_event: true

In automations.yaml, add:

- id: "TuyaIOT"
  alias: "TuyaIOT Restart"
  trigger:
  - platform: event
    event_type: system_log_event
    event_data:
      level: ERROR
      name: tuya_iot
  condition:
  - condition: template
    value_template: >-
      {{ "error while get mqtt config" in trigger.event.data.message[0] }}
  action:
  - service: homeassistant.reload_config_entry
    data:
      entity_id:
        - switch.living_room_lamp

Important! Change switch.living_room_lamp to the id of one of your system’s own Tuya entities.

Works like a charm by resetting Tuya when error while get mqtt config occurs.

3 Likes

Is this not fixed in 2021.12.6 from Update tuya-iot-py-sdk to 0.6.6 by frenck · Pull Request #62858 · home-assistant/core · GitHub ?

I’m facing issue with Local Tuya

I’ve defined two smart plugs yesterday and they were working fine.
Then I’ve unplugged both from electricity and this morning I’ve plugged again, but both are in an unknown state in HA.

They work fine from Smart Life app and I can see online from the IOT Tuya webpage.

I’ve tried also the automation in this thread, but both are still not working.

What else can I check?

Thanks