Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local tuya devices become un available when internet is disconnected #1116

Open
INVADIA666 opened this issue Nov 8, 2022 · 12 comments
Open
Labels
bug Something isn't working

Comments

@INVADIA666
Copy link

INVADIA666 commented Nov 8, 2022

The problem : I spent quite some time adding all the devices on the local tuya integration, everything works perfectly and fast as long as the internet is working , the other day the internet stopped working for 10minutes and I was hoping all my lights will turn on as I'm using the local integration, well al the devices in the local integration were unavailable, once the internet came back , the devices became available, so I tried to remove the internet from my router and test it that way and I confirmed that the devices added within the local tuya integration need the internet connection to work . They're not local at all .

Am I doing something wrong in the set up ?

Am I going

Environment

  • Localtuya version:
  • Last working localtuya version (if known and relevant):
  • Home Assistant Core version:
  • [] Are you using the Home Assistant Tuya Cloud component ?
  • [] Are you using the Tuya App in parallel ?

Steps to reproduce

Configuration configuration.yaml or config_flow

DP dump

Provide Home Assistant taceback/logs

Additional information

@INVADIA666 INVADIA666 added the bug Something isn't working label Nov 8, 2022
@renegad84
Copy link

That is happen to me too!

@asopoku
Copy link

asopoku commented Nov 16, 2022

This keeps happening to me too. But initially it wasn't like that.

@MarkNZD
Copy link

MarkNZD commented Nov 16, 2022

Hi, same issue here. Hope that it can help someone. In my case removing Cloud API account configuration from Local Tuya restored this functionality and now everything is available in Local Tuya even if internet is down. Re-adding Cloud API account configuration makes this bug kick in again.

@asopoku
Copy link

asopoku commented Nov 18, 2022

How do I remove the CLOUD API account?

@MarkNZD
Copy link

MarkNZD commented Nov 18, 2022

Settings>Devices&Service.

Click on Configure
1

select Reconfigure Cloud API Account and click on submit
2

check "Do Not Configure Cloud API Account" and submit.
3

Hope this bug will be fixed so i can reconfigure Cloud API Account (i like it especially during the adding process of new devices).

@asopoku
Copy link

asopoku commented Nov 18, 2022

Thanks
I'll try and give you feedback

@asopoku
Copy link

asopoku commented Nov 19, 2022

It worked with Internet now. Thanks so much. It was really helpful.

@SgtJalau
Copy link

I have the same issue. They continue to work for a bit then they are unavailable, while the Smart Life app still works. This happens as soon as I block internet access for my smart plugs. On a previous version this worked for 100%.

@frlequ
Copy link

frlequ commented Jan 28, 2023

I have the same problem. As soon as I block internet access the Light becomes unavailable. But another device (thermostat) linked in Tuya Local works fine even if I block internet access.

@SgtJalau
Copy link

SgtJalau commented Feb 12, 2023

Okay guys. I got it fixed on my end by doing the following:
It was working on one of my two plugs so I compared the configurations.
I found that the one working had "model": "Smart Socket", set while the other didn't. I added it manually to the config (via ssh, navigate to the core data config (hidden folder/files) "/root/config/.storage/core.config_entries"). Then I restarted home assisstant.
However that did not fix the issue sadly.
Then I downgraded to v4.0.2.
To downgrade download the following zip from GitHub (just the tag 4.0.2 from the main repo): https://github.com/rospogrigio/localtuya/archive/refs/tags/v4.0.2.zip
Then unzip and overwrite the contents in the custom_addons/local_tuya directory inside your home assisstant installation.

Downgrading fixed the issue or at least made a new error show up.
This time it was that one of the plugs had "scan_interval": "30", written in the config which makes it read the 30 as a string instead of a double. This caused a casting error which was reflected in the logs. I then removed the " and this fixed it. Now everything is running smoothly.
I haven't yet tested if upgrading to the newest version and removing the " in the config causes the issue to be fixed as well. In the newer version no casting error was reflected in the config but it could be that this was just eaten up by some new exception handling or something. Either way here is my working config:

"data": {
    "device_config": {
      "friendly_name": "Power Monitor",
      "host": "192.168.1.---",
      "device_id": "-----",
      "local_key": "----",
      "protocol_version": "3.3",
      "enable_debug": false,
      "scan_interval": 30,
      "model": "Smart Socket",
      "dps_strings": [
        "1 (value: True)",
        "9 (value: 0)",
        "18 (value: 609)",
        "19 (value: 809)",
        "20 (value: 2325)",
        "21 (value: 1)",
        "22 (value: 740)",
        "23 (value: 31468)",
        "24 (value: 21666)",
        "25 (value: 965)"
      ],
      "entities": [
        {
          "id": 1,
          "friendly_name": "Power Monitor",
          "restore_on_reconnect": true,
          "is_passive_entity": false,
          "current": 18,
          "current_consumption": 19,
          "voltage": 20,
          "platform": "switch"
        }
      ],
      "product_key": "----"
    }
  }

@Cadseubi
Copy link

Cadseubi commented May 9, 2023

I have the same problem. I can control the devices locally, but only when they are connected to Tuya cloud servers.
Otherwise there are malfunctions and some of the lights don't work

@pituluk
Copy link

pituluk commented Sep 6, 2024

Years later this is still an issue. Some Tuya devices work fine through their wifi direct protocol though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants