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

Certain Devices goes Unavailable indefinetly with wierd reconnection issues #1804

Open
remlei opened this issue Apr 8, 2024 · 22 comments
Open
Labels
bug Something isn't working

Comments

@remlei
Copy link

remlei commented Apr 8, 2024

Describe the bug
When a device sensors and switches goes Unavailable, tuya local seems to re-connect to the device with weird reconnection issue. First the device seems to get reconnected but a few seconds later, it goes to Unavailable again, this thing happens several times per minute. Tried debugging it if its a networking related issue but no, the AP sees the device still connected and able to ping the device just fine.

The only way to fix this issue is "reload" the device by going to Settings > Device & Services > Tuya Local > Your Device, after that click the 3 dot thingy beside the problematic device and click reload. Take note, even power cycling the device doesnt fix the issue more like it actually gets worse since it no longer able to reconnect to the device, unlike before it was able to connect to the device albeit it only last for a few seconds.

Currently the device is disconnected to the internet, making the device unblocked to the internet make no difference. No other smartphone app that can directly control the device, the only way to control this device is through home assistant, I only run the tuya app if I want to add a new device to my tuya account but after that the smart app gets deleted.

To Reproduce
Unknown, The issue happens randomly.

Expected behavior
If the device gets disconnected, local tuya should be able to reconnect to device without any issue.

Additional context

Device Diagnostic

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.3.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.2",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Asia/Manila",
    "os_name": "Linux",
    "os_version": "6.6.20-haos",
    "supervisor": "2024.03.1",
    "host_os": "Home Assistant OS 12.1",
    "docker_version": "24.0.7",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "tuya_local": {
      "version": "2024.3.2",
      "requirements": [
        "tinytuya==1.13.2"
      ]
    },
    "pfsense": {
      "version": "0.1.0",
      "requirements": [
        "mac-vendor-lookup>=0.1.11"
      ]
    },
    "localtuya": {
      "version": "5.2.1",
      "requirements": []
    },
    "proxmoxve": {
      "version": "3.4.1",
      "requirements": [
        "proxmoxer==2.0.1"
      ]
    },
    "tplink_easy_smart": {
      "version": "0.3.0",
      "requirements": [
        "json5==0.9.10"
      ]
    },
    "openmediavault": {
      "version": "0.0.0",
      "requirements": []
    },
    "ssh_command": {
      "version": "1.0.0",
      "requirements": [
        "paramiko"
      ]
    },
    "hacs": {
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    }
  },
  "integration_manifest": {
    "domain": "tuya_local",
    "name": "Tuya Local",
    "codeowners": [
      "@make-all"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/make-all/tuya-local",
    "integration_type": "device",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/make-all/tuya-local/issues",
    "requirements": [
      "tinytuya==1.13.2"
    ],
    "version": "2024.3.2",
    "is_built_in": false
  },
  "data": {
    "name": "Aircon Smartplug",
    "type": "blitzwolf_bwshp6_smartplug",
    "device_id": "**REDACTED**",
    "device_cid": "",
    "local_key": "**REDACTED**",
    "host": "**REDACTED**",
    "protocol_version": 3.4,
    "tinytuya_version": "1.13.2",
    "api_version_set": 3.4,
    "api_version_used": 3.4,
    "api_working": true,
    "status": {},
    "cached_state": {
      "updated_at": 1712534268.9972293,
      "1": true,
      "9": 0,
      "18": 2969,
      "19": 6890,
      "20": 2366,
      "21": 2,
      "26": 0,
      "38": "memory",
      "39": "relay",
      "40": false,
      "41": "",
      "42": "",
      "43": ""
    },
    "pending_state": {},
    "connected": true,
    "force_dps": [
      18,
      19,
      20
    ],
    "home_assistant": {
      "name": "Aircon Smartplug",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "number.aircon_smartplug_timer",
            "state": "0.0",
            "attributes": {
              "min": 0.0,
              "max": 1440.0,
              "step": 1.0,
              "mode": "auto",
              "unit_of_measurement": "min",
              "friendly_name": "Aircon Smartplug Timer"
            },
            "last_changed": "2024-04-07T21:31:48.926583+00:00",
            "last_updated": "2024-04-07T21:31:48.926583+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "lock.aircon_smartplug_child_lock",
            "state": "unlocked",
            "attributes": {
              "friendly_name": "Aircon Smartplug Child lock",
              "supported_features": 0
            },
            "last_changed": "2024-04-07T21:32:20.088727+00:00",
            "last_updated": "2024-04-07T21:32:20.088727+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.aircon_smartplug_initial_state",
            "state": "Last state",
            "attributes": {
              "options": [
                "On",
                "Off",
                "Last state"
              ],
              "icon": "mdi:toggle-switch",
              "friendly_name": "Aircon Smartplug Initial state"
            },
            "last_changed": "2024-04-07T21:32:20.090149+00:00",
            "last_updated": "2024-04-07T21:32:20.090149+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.aircon_smartplug_light_mode",
            "state": "State",
            "attributes": {
              "options": [
                "State",
                "Position",
                "Off"
              ],
              "icon": "mdi:lightbulb",
              "friendly_name": "Aircon Smartplug Light mode"
            },
            "last_changed": "2024-04-07T21:32:20.090632+00:00",
            "last_updated": "2024-04-07T21:32:20.090632+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": "Wh",
          "state": {
            "entity_id": "sensor.aircon_smartplug_energy",
            "state": "unknown",
            "attributes": {
              "unit_of_measurement": "Wh",
              "friendly_name": "Aircon Smartplug Energy"
            },
            "last_changed": "2024-04-07T21:31:48.929163+00:00",
            "last_updated": "2024-04-07T21:31:48.929163+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "current",
          "icon": null,
          "unit_of_measurement": "mA",
          "state": {
            "entity_id": "sensor.aircon_smartplug_current",
            "state": "2969",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "mA",
              "device_class": "current",
              "friendly_name": "Aircon Smartplug Current"
            },
            "last_changed": "2024-04-07T23:57:17.938697+00:00",
            "last_updated": "2024-04-07T23:57:17.938697+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "power",
          "icon": null,
          "unit_of_measurement": "W",
          "state": {
            "entity_id": "sensor.aircon_smartplug_power",
            "state": "689.0",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "W",
              "device_class": "power",
              "friendly_name": "Aircon Smartplug Power"
            },
            "last_changed": "2024-04-07T23:57:17.939754+00:00",
            "last_updated": "2024-04-07T23:57:17.939754+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "voltage",
          "icon": null,
          "unit_of_measurement": "V",
          "state": {
            "entity_id": "sensor.aircon_smartplug_voltage",
            "state": "236.6",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "V",
              "device_class": "voltage",
              "friendly_name": "Aircon Smartplug Voltage"
            },
            "last_changed": "2024-04-07T23:57:17.940670+00:00",
            "last_updated": "2024-04-07T23:57:17.940670+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "outlet",
          "icon": "mdi:air-conditioner",
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.aircon_smartplug_none",
            "state": "on",
            "attributes": {
              "factory_test": 2,
              "cycle_time": "",
              "random_time": "",
              "inching": "",
              "device_class": "outlet",
              "icon": "mdi:air-conditioner",
              "friendly_name": "Aircon Smartplug None"
            },
            "last_changed": "2024-04-07T21:36:59.650857+00:00",
            "last_updated": "2024-04-07T21:36:59.650857+00:00"
          }
        }
      ]
    }
  }
}

Home Assistant Log related to the issue

This error originated from a custom integration.


Logger: custom_components.tuya_local.device
Source: custom_components/tuya_local/device.py:554
integration: Tuya Local (documentation, issues)
First occurred: 12:29:35 AM (70 occurrences)
Last logged: 5:31:37 AM

Failed to update device dps for Aircon Smartplug
Failed to fetch device status for Aircon Smartplug

Workaround:

Create a new automation based on device state, if the device goes unavailable, do a call service integration reload on specific problematic device.

@remlei remlei added the bug Something isn't working label Apr 8, 2024
@make-all
Copy link
Owner

make-all commented Apr 8, 2024

Possibly related to this upstream bug: jasonacox/tinytuya#472

@make-all make-all moved this to 📋 Backlog in Tuya Local Apr 8, 2024
@robinhood-code
Copy link

this happens to me every time when I turn off the power of the device (lights) and then turn it back on, and I will have to reload the entry for the device otherwise TL would not be able to reconnect to the device.

@make-all
Copy link
Owner

Have you set the IP address and protocol version?

@robinhood-code
Copy link

robinhood-code commented Apr 11, 2024

yup, both are set manually and not auto. I will observe more to see if it’s specific to certain protocol version or device

@sweetpants
Copy link

For what it's worth. In my situation it happens when the device is known/configured and worked in tuya-local but becomes unreachable. When disabeling this device in tuya-local, everything seems to return to 'nomal'' and my GUI is responsive again.

@tabascoz
Copy link

hi, having the same issues with three of my heatpumps. will implement a reload fix automation, happy to test / debug a fix, thanks

@array81
Copy link

array81 commented May 14, 2024

I think I have a similar problem with Tongou TO-Q-SY1-JWT. As long as it has an active load it doesn't seem to have a problem but when I remove the load (sometimes) the device becomes unavailable.
@remlei could you post your automation code to reload the integration? Thanks

@remlei
Copy link
Author

remlei commented Jun 1, 2024

I think I have a similar problem with Tongou TO-Q-SY1-JWT. As long as it has an active load it doesn't seem to have a problem but when I remove the load (sometimes) the device becomes unavailable. @remlei could you post your automation code to reload the integration? Thanks

just use the Call Service "Home Assistant Core Integration: Reload config entry" and choose for Device as a target and look for a tuya device that your having problem with.

as for trigger, you can use any part of that tuya device that goes unavailable, in this case I used the "child lock" entity of the device as a trigger, if the state goes unavailable or unknown, execute a reload config call service action.

@felipecrs
Copy link
Contributor

Just to mention, when the device goes unavailable in Tuya Local:

  1. The official Tuya (cloud) integration can control the device just fine
  2. Tuya Smart app can control the device just fine
  3. I can ping the device just fine using tinytuya wizard

@felipecrs
Copy link
Contributor

felipecrs commented Jun 3, 2024

I am currently working around this issue by using an entity template and adding redundancy (use Tuya Local if it's available, or use Tuya Cloud otherwise):

cover:
  - platform: template
    covers:
      portao:
        unique_id: 210958c8-e7e8-4a44-8e52-0c393b71b990
        friendly_name: Portão
        device_class: garage
        value_template: "{{ (not is_state('cover.portao_tuya_local', 'unavailable') and not is_state('cover.portao_tuya_local', 'closed')) or (not is_state('cover.portao_tuya_cloud', 'unavailable') and not is_state('cover.portao_tuya_cloud', 'closed')) }}"
        availability_template: "{{ not is_state('cover.portao_tuya_local', 'unavailable') or not is_state('cover.portao_tuya_cloud', 'unavailable') }}"
        open_cover:
          if:
            condition: template
            value_template: "{{ not is_state('cover.portao_tuya_local', 'unavailable') }}"
          then:
            action: cover.toggle
            data:
              entity_id: cover.portao_tuya_local
          else:
            action: cover.toggle
            data:
              entity_id: cover.portao_tuya_cloud
        close_cover:
          if:
            condition: template
            value_template: "{{ this.state != 'closed' }}"
          then:
            if:
              condition: template
              value_template: "{{ not is_state('cover.portao_tuya_local', 'unavailable') }}"
            then:
              action: cover.toggle
              data:
                entity_id: cover.portao_tuya_local
            else:
              action: cover.toggle
              data:
                entity_id: cover.portao_tuya_cloud

@sophof
Copy link

sophof commented Sep 3, 2024

This bug appears to be more extreme for me as time goes by (or I'm just having a string of bad luck). On top of that, I just ran into an issue that's stopping me from reloading the integration? The error I get when doing the service call is receive loop has terminated. It does come back by itself after a while too, so the whole thing is mystifying.

@make-all
Copy link
Owner

make-all commented Sep 3, 2024

The receive loop terminates when you reload the integration, it is normal, and shows that the reload is working.

make-all added a commit that referenced this issue Oct 31, 2024
This is done for the side-effect that underlying library will call close()
on the socket when setting persistent connection to false, in the hope that
it might solve some reconfiguration problems when devices are not responding.

Issue #1804, #1013, Discussion #2354 among others.
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release and removed bug Something isn't working awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release labels Oct 31, 2024
@make-all make-all closed this as completed Nov 3, 2024
@felipecrs
Copy link
Contributor

felipecrs commented Nov 3, 2024

@make-all, I'm very excited about 3fafb5f. I have reverted my workaround and I am now testing it. Let's see how the following days goes.

make-all added a commit that referenced this issue Nov 7, 2024
This should hopefully help to avoid hung sockets in cases where the device
disappears off the network, and speed up reconnection.
Issue #1804, #1013
@felipecrs
Copy link
Contributor

@make-all, unfortunately, after working perfectly well for over a week, I noticed this issue again.

  1. Restarting HA brought two devices back
  2. For the last one, clicking in CONFIGURE without changing any parameter and submitting it, brought it back.

This makes me think if the integration itself isn't retrying the connection properly.

Do you think I should open a different issue or should this one be reopened?

@make-all make-all reopened this Nov 16, 2024
@make-all make-all moved this from ✅ Done to 📋 Backlog in Tuya Local Nov 16, 2024
@make-all make-all added the bug Something isn't working label Nov 16, 2024
@make-all make-all moved this from 📋 Backlog to 🔖 Ready in Tuya Local Nov 16, 2024
@felipecrs
Copy link
Contributor

I just realized I should have tried to capture some logs. I will try next time.

@felipecrs
Copy link
Contributor

Ok, I have a better story to tell now:

  1. The device went unavailable when I powered it off (a smart garage door opener)
  2. When powering it on again, it never came back in Tuya Local
  3. Stayed that way for hours
  4. I tried to Reload the Tuya Local integration, nothing changed
  5. Tried Re-CONFIGURE the device in Tuya Local, it gave me connection error. I captured the logs.
  6. I opened the Tuya app; the device was online. I opened the garage door once from the Tuya app: the device came back in Home Assistant.

Weird. I captured debug logs during the Reload and Re-CONFIGURE, but I'm not sure it will help.

tuya_local_bbb18cee736636978b25f07001002a50_Portão_da_garagem_de.json

home-assistant_tuya_local_2024-11-18T01-21-00.547Z.log

@dominguesgm
Copy link

Just ran into either this or a similar issue. I have a large amount of lights configured through tuya-local. A power cycle of the lights + router caused some of the light IP addresses to change, I assume, and no longer connect to tuya-local.

Is there a way for the device reload to re-do the IP address scanning step and keep the remaining settings, without going through the whole remove + re-add device flow? Assuming the device ID is stored, this should be able to be done automatically. Does it already happen and it just didn't work in case for some reason?

@felipecrs
Copy link
Contributor

@dominguesgm, in my case I add static IP leases in the router for each device to help with this issue.

@felipecrs
Copy link
Contributor

felipecrs commented Dec 1, 2024

@make-all I was able to find a consistent case that may be actionable.

chrome_C14aJVI1dJ.mp4

Notes:

  1. tinytuya is able to communicate with the device just fine
  2. The device is unavailable in Tuya Local. I attempt to Reload it, it continues unavailable.
  3. Attempt to Re-CONFIGURE, it continues unavailable.
  4. Restarting Home Assistant fixes the issue until it happens again.

The debug logs indicate an issue similar to #2578:

2024-12-01 14:52:12.294 WARNING (SyncWorker_14) [custom_components.tuya_local.device] Test protocol error 914: Check device key or version
2024-12-01 14:54:09.716 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Luz do escritório 2 for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 855, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 680, in async_unload_entry
    return await hass.data[DATA_COMPONENT].async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-12-01 14:54:09.718 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Luz do escritório 2 for number
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 855, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 134, in async_unload_entry
    return await hass.data[DATA_COMPONENT].async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-12-01 14:54:09.719 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Luz do escritório 2 for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 855, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 109, in async_unload_entry
    return await hass.data[DATA_COMPONENT].async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-12-01 14:54:18.980 DEBUG (MainThread) [custom_components.tuya_local] Unloading entry for device: eb1c6c0ee0ddc7a2b8hmii
2024-12-01 14:54:18.990 DEBUG (SyncWorker_1) [custom_components.tuya_local.helpers.device_config] Loaded device config rgbcw_lightbulb.yaml
2024-12-01 14:54:18.991 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Luz do escritório 2 for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 855, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 680, in async_unload_entry
    return await hass.data[DATA_COMPONENT].async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-12-01 14:54:18.992 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Luz do escritório 2 for number
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 855, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 134, in async_unload_entry
    return await hass.data[DATA_COMPONENT].async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-12-01 14:54:18.994 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Luz do escritório 2 for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 855, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 109, in async_unload_entry
    return await hass.data[DATA_COMPONENT].async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-12-01 14:54:18.999 INFO (MainThread) [custom_components.tuya_local.device] Deleting device: eb1c6c0ee0ddc7a2b8hmii
2024-12-01 14:54:18.999 DEBUG (MainThread) [custom_components.tuya_local.device] Stopping monitor loop for Luz do escritório 2

@make-all make-all moved this from 🔖 Ready to 📋 Backlog in Tuya Local Dec 2, 2024
@FrankTub
Copy link

I'm running into the same issue. From Tuya Smart everything works fine after a power outage. But not through HA.

My fix for now was to reload the configuration of the device and now it shows up working again.

@felipecrs
Copy link
Contributor

felipecrs commented Dec 12, 2024

This issue is really difficult. People seem to have very different root causes and solutions.

Today I was only able to work around it by rebooting my HA instance (restarting the container only multiple times did not help).

Anyway, I'd suggest focusing on one actionable item at a time.

@make-all, have you by any chance tried to reproduce what I described here? I wonder if you were able to.

@remlei
Copy link
Author

remlei commented Dec 13, 2024

This issue seems like only affects device that uses protocol 3.4 or higher, only my newer tuya wifi devices is affected to this but majority of my wifi tuya device running the 3.3 protocol works just fine.

Though as of this comment, almost all of my 3.3 tuya devices are now migrated to esphome using tuya-cloudcutter the rest of my 3.3 devices is still connected using this integration, 3.4 and higher devices is now connected using the cloud based tuya integration.

@make-all make-all moved this from 📋 Backlog to 🔖 Ready in Tuya Local Dec 13, 2024
@make-all make-all moved this from 🔖 Ready to Connection handling in Tuya Local Dec 29, 2024
make-all added a commit that referenced this issue Jan 10, 2025
The condition for appearing available required data to have been returned
from the device since the last reconnection, but we now support devices that
don't return any data such as IR controls, and some devices do not seem
to return anything on reconnection until something changes. In those cases,
the state should appear as Unknown rather than unavailable.

May help with #1804
@make-all make-all marked this as a duplicate of #2762 Jan 11, 2025
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
Status: Connection handling
Development

No branches or pull requests

10 participants