Tuya integration stop working

Hi all, my tuya integration stop working. I’have about 30 divice on my smartlife app.
The first setup worked perfectly (based on Tuya platform). After about a month, al device are disapeared.

I’ve tried

  • remove and re-add the integration
  • restarting my HASSIO server

Nothing seems to work, no devices shown.
I can’t exactly tell when the integration stop working, but on 31/12/22 it was ok.

Look at your log for related errors.

I’ don’t know ho to che log files…

System → Settings → Logs

The tuya integration is very buggy.
I suggest you look at the local tuya integration.
It’s a lot harder to set up, but once its set up then it works very well.

Can you explain it better? isn’t Tuya integration already?

Have a look at this:

But no… the Tuya integration is not local as far as I know, and even if it was it doesn’t change the fact that it’s a barely working integration

I’ve tried the integration with tuya local.
The guide works perfectly until I’ve to add a devise to Tuya local.
it workwed only when i’ve upgradet to v5 tuya local, an when i’ve used the v 3.4 protocl. (non aviable in previus version).
Thank you

Hi All,

I have been using Local Tuya exclusively and after the new update every single one of my lights went offline. Oddly enough it’s just the light switches. Some smart plugs i have still work. All the lights are operational in the Smartlife app, for some reason they are not working in HA anymore. Any ideas?

I’m not using local tuya, but just had the same thing. Did update to 2023.5.2 and my tuya (cloud) devices all disappeared.

Hey All

i added the logs to see if this would help. i don’t understand what’s going on with local tuya.

This error originated from a custom integration.

Logger: custom_components.localtuya.common
Source: custom_components/localtuya/pytuya/init.py:559
Integration: LocalTuya (documentation, issues)
First occurred: May 6, 2023 at 7:56:40 AM (102806 occurrences)
Last logged: 9:07:51 PM

[ebd…y3q] Connect to 192.168.4.100 failed
Traceback (most recent call last):
File “/config/custom_components/localtuya/common.py”, line 149, in _make_connection
status = await self._interface.status()
File “/config/custom_components/localtuya/pytuya/init.py”, line 472, in status
status = await self.exchange(STATUS)
File “/config/custom_components/localtuya/pytuya/init.py”, line 457, in exchange
payload = self._decode_payload(msg.payload)
File “/config/custom_components/localtuya/pytuya/init.py”, line 559, in _decode_payload
return json.loads(payload)
File “/usr/local/lib/python3.10/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.10/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.10/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I have a similar issue, all lights become unavailable, here is detailed logs

2023-05-10 07:41:43.042 DEBUG (MainThread) [custom_components.localtuya.pytuya] [011...153] Waiting for sequence number 1
2023-05-10 07:41:43.052 DEBUG (MainThread) [custom_components.localtuya.pytuya] [011...153] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=SOME_NUMBER)
2023-05-10 07:41:43.052 DEBUG (MainThread) [custom_components.localtuya.pytuya] [011...153] Got heartbeat response
2023-05-10 07:41:43.052 DEBUG (MainThread) [custom_components.localtuya.pytuya] [011...153] Decrypted payload: {}
2023-05-10 07:41:43.068 DEBUG (MainThread) [custom_components.localtuya.pytuya] [011...153] Dispatching message TuyaMessage(seqno=1, cmd=10, retcode=1, payload=b'\x8c_BLAH_BLAH_MORE_HEX_AND_SOME_TEXT', crc=SOME_NUMBER)
2023-05-10 07:41:43.068 DEBUG (MainThread) [custom_components.localtuya.pytuya] [011...153] Dispatching sequence number 1
2023-05-10 07:41:43.070 DEBUG (MainThread) [custom_components.localtuya.pytuya] [011...153] Decrypted payload: 
2023-05-10 07:41:43.070 ERROR (MainThread) [custom_components.localtuya.common] [011...153] Connect to REDACTED failed
Traceback (most recent call last):
  File "/config/custom_components/localtuya/common.py", line 149, in _make_connection
    status = await self._interface.status()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 472, in status
    status = await self.exchange(STATUS)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 457, in exchange
    payload = self._decode_payload(msg.payload)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 559, in _decode_payload
    return json.loads(payload)
  File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I don’t see many people reporting this problem, maybe we have to update the local tuya to the latest, for me is like 2 years old.

UPDATE: restore 2023.4.5 backup fixed the issue

I’m seeing the same issue. 2023.5.x kills LocalTuya. For now I’m restoring to 2023.4.6.

Mam ten sam problem

I just tried newest 2023.5.4 and it still kills LocalTuya. Restoring back to 2023.4.6 now…

I was able to fix this by updating line 301 in custom_components/localtuya/init.py to
ent_reg = er.async_get(hass)

1 Like

Today most of my equipment stopped working in Home assistant. Reason seems to be that Tuya does not see anything anymore. Even tried to remove and reinstall Tuya-integration. Installation works fine but still nothing shows up in Home Assistant. Am I only one or is something now really broken?

1 Like

My Tuya equipment also stopped today.
Noticed the temperature/humidity sensors did not update.
Reloaded Tuya and all devices disappeared.
They are still visible in my Google home and Tuya app.
Restarting home assistant did not help.

Same here @Hezekiel. I’ve been away for a few days so cannot say when it happened - will look back in logs. I’ll leave as is for now, as your reinstall didn’t help - maybe a bugfix will revert things to normal.

+1, everything is alright within the cloud it seems but I tried to reset it up and I get login invalid despite everything being correct…