Tuya/Local Tuya Integrations both stopped working simultaneously

Hi,

I have recently started to utilie Home Assistant to bring together my different smart home devices and run more complex automations - so far so good! I have HA running on a Raspberry Pi with integrations to Alexa (not using Home Assistant Cloud), Smart Things (for my washing machine), my Asus Router (for home presence detection), ZHA for a couple of Aqara light switches, Sony TV and playstation, and Tuya.

I have both the Tuya and the Local Tuya integrations set up as I would ultimately prefer to move wholesale to Local Tuya (where I cannot replace devices using WiFi with Zigbee equivalents), however I have expereinced some challenges with this where my Coredy Vacuum cleaner seems to be particularly difficult to get working in Local Tuya. Also, in some instances entities will be come unavailable in Local Tuya but remain available in full Tuya so until I can get it working reliable I would like both to continue to operate on the same devices to ensure the best possible chance of automations executing correctly. This is particularly important for the fused spur operating my immersion heater - I need to ensure it is turned on and off correctly at the correct times.

I have purchased a domain name to use rather than using duckdns as this was causing me an issue with the SmartThings integration which would not recognise the duckdns domain as being valid, and have a valid LetsEncrypt certificate installed for my domain.

This has all been working fine for the last few weeks, however last night I lost control of all my Tuya devices through both the Local and Cloud integrations. Tuya devices work correctly through the Smart Life application and through the direct Alexa integration to Tuya, but both integrations in Home Assistant show Failed to setup, will retry.

I have checked that the subscriptions have not expired in the Tuya IOT developer portal, that all seems to be fine, and also re-authorised to no avail.

The key to this all seems to be in the following log entry:

‘’’’
2023-10-05 14:24:34.959 WARNING (MainThread) [homeassistant.config_entries] Config entry ‘neil.willingham@e*********s.co.uk’ for tuya integration not ready yet: HTTPSConnectionPool(host=‘openapi.tuyaeu.com’, port=443): Max retries exceeded with url: /v1.0/iot-01/associated-users/actions/authorized-login (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)’))); Retrying in background
‘’’’

A very similar entry seems to appear for the Local Tuya entry also. It looks as tough there is some sort of issue with the certificate installed on my Home Assistant instance, but I cannot for the life of me discover where?

Can anybody offer me any guidance on resolving this issue, or advise if I’m barking up completely the wrong tree?

Thanks

Neil

Have you tried (1) reload the Tuya integration (2) re-install the Tuya integration or (3) power cycle your HA box (I have a Yellow Box and power cycling resolves my “worst” issues) ?

I have reloaded both integrations several times, rebooted my Home Assistant multiple times, and disabled and re-enabled both integrations although I have not actually deleted and recreated either of them as I assume that this will wipe out all of my painstakingly configured automations?

I have left the Local Tuya integration disabled and only the Tuya integration enabled in case they were conflicting with each other at the moment, but still the same.

not sure that this will be the case

Will the entities not be deleted with the integration? And therefore removed from the automation scripts? If not, will this not cause issues when the automation is triggered for other entities which are still valid?

Also, when the integration is recreated, will the entity be named the same?

I am not sure, but this may be your last resort. You have indeed the risk that you may have to adjust your Automations.

OK - I just deleted the Tuya integration and readded - when I enter all of the credentials to set up, I get ‘Unknown Error Occurred’ when I click submit.

Still getting the SSL error in the log :frowning:

Got this resolved - it turns out it was a DNS issue (it’s ALWAYS DNS!!).

For some reason the API address could not be resolved by the DNS server being used by home assistant. Swapped the DNS server on HA to be 8.8.8.8 and the whole thing flared into life!

1 Like

I think I have the same problem. I would like to try your solution, but I am not sure how to change the DNS server on HA. Could you please advice? Thanks in advance!

Settings\Network

Assign a static IP and you can specify the DNS server

Thanks. I assume this setting is in the router rather than in the HA settings since I cannot find any DNS settings in HA. My HA has a static local IP since before but the DNS settings are independent of what devices are allocated static IPs, ie DNS can only be set globally on my router. Setting the DNS to 8.8.8.8 and 8.8.4.4 does not resolve the issue, I am afraid. And further advice? Thanks!

DNS settings should never come from DHCP if the IP address is static (unless you mean statically assigned by DHCP which is something different).

If you’ve statically assigned the IP address properly rather than static DHCP assignment, you will also have a statically assigned DNS server within HA.

The DNS server setting will be in the ip address settings of the newtork interface in home assistant.

Thanks for your help so far. I am clearly not skilled enough to try this approach out properly. I went for Local Tuya instead and now it works. Yay.