core: Tuya - Error While Get MQTT Config

The problem

Receiving this error in the Core log:

[2021-12-14 07:02:53,221] [tuya-openmq] error while get mqtt config 2021-12-14 07:02:53 ERROR (Thread-9) [tuya_iot] error while get mqtt config

Note: All Tuya devices are working correctly.

What version of Home Assistant Core has the issue?

core-2021.12.1

What was the last working version of Home Assistant Core?

core-2021.12.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tuya

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya/

Example YAML snippet

N/A

Anything in the logs that might be useful for us?

[2021-12-14 07:02:53,221] [tuya-openmq] error while get mqtt config
2021-12-14 07:02:53 ERROR (Thread-9) [tuya_iot] error while get mqtt config

Additional information

Just noticed this happening after upgrading to 2021.12.1. I do not know if the upgrade caused the problem (I did not revert to 2021.12.0 and I do not plan to since everything is working ok). This has occurred ~ 3 time in a 24 hour period. All Tuya devices are working as expected.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 10
  • Comments: 30 (4 by maintainers)

Most upvoted comments

@frenck I am sorry for the confusion. I thought this was the place to document issues with a Home Assistant integration - I did not know, and still don’t know, if this is a Home Assistant integration issue or a Tuya API issue, or both. And I am not sure I understand how to distinguish one from the other given the information I currently have (documented above).

My assumption was that since this issue was labeled tuya:integration and 3 of the 4 code owners listed above appear to be associated with Tuya, and you with Home Assistant, this was the correct place to work with the community to try to resolve this.

I have an open ticket with Tuya.com about this issue and I will provide an update when I hear back from them.

Any help or pointers that you can give on how I can do better in the future will be greatly appreciated.

Again, sorry for the confusion.

I thought opening a github issue that lists @tuya was contacting Tuya. How should we contact them about this issue?

I open ticket at iot.tuya.com. But without result

All of the above is not caused by Home Assistant, but Tuya: please contact Tuya about the issue.

I received a response from Tuya support:

Tuya engineer12-22 22:25:48 Hello, thank you for your feedback. As for the problem of HA disconnection, we have located the problem and are fixing it.

I has the same situation. (( After upgrade from 2021.11.02 to 2021.11.05 periodically “error while get mqtt config” in the logs. After that cant control switch in dashboard, cant toogle switches, sensor humidity and temperature freezen. After restart HA works fine for a while, but then again “error while get mqtt config”

The automation to restart Tuya integration when it fails seems to be working well here. Thanks to restenarquois.

This issue seems to have lots of duplicates. There is a workaround to reload the integration on disconnect on this thread https://github.com/home-assistant/core/issues/61854

I ran a packet capture for the entire day between my HA device and Tuya ELB endpoint in us-west-2

pi@blackpi:~$ host openapi.tuyaus.com
openapi.tuyaus.com is an alias for us-kong-44399fa934a1be74.elb.us-west-2.amazonaws.com.
us-kong-44399fa934a1be74.elb.us-west-2.amazonaws.com has address 44.231.179.25
us-kong-44399fa934a1be74.elb.us-west-2.amazonaws.com has address 54.188.51.105
us-kong-44399fa934a1be74.elb.us-west-2.amazonaws.com has address 54.71.119.195

pi@blackpi:~$ sudo tcpdump -i eth0 'host 54.71.119.195 || host 54.188.51.105 || host 44.231.179.25' -w tuya_disco.pcap

and so there is a TCP RST/ACK sent by my device at the exact same time this happens in the logs: [2021-12-18 07:12:58,118] [tuya-openmq] error while get mqtt config

image

Next step is to turn add a bit more verbosity to the log and try to locate this line in the mqtt library used by the tuya integration and why the RST/ACK was initiated from my device

I do not think it is related to the upgrade as I am still on version 2021.11.5 and I am still facing the Tuya issue: 2021-12-16 13:42:22 ERROR (Thread-3) [tuya_iot] error while get mqtt config

By the way, reloading the Tuya integration does not always fix the issue temporarily (sometimes it does), but restarting HA always solves it but after a while the issue is back.

It might be an API error, possibly on the Tuya side as it shows on the API Statistics page: image

I have the same but I guess it might be related to Tuya itself as I hadn’t upgraded HA yet. It began about 40 hours ago. If I restart HA it works for a while then the issue is back.

hmm, so it may not depend from upgrading and just a coincidence? Interest! ))

restart HA

faster simply reload Tuya intergration

I have the same but I guess it might be related to Tuya itself as I hadn’t upgraded HA yet. It began about 40 hours ago. If I restart HA it works for a while then the issue is back.