rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.84k stars 545 forks source link

V4 issues and a missing feature #881

Open sambarlick opened 2 years ago

sambarlick commented 2 years ago

Firstly, thanks for v4, the new UI is great and the cloud link is a great idea to pull all the required data from the tuya IoT site and grab the associated device information.

So the missing feature is that once a device is created you cannot add more entities/DPs to it. The only way to do this is to delete the device and create it again with the new entity/DPs. This used to be possible pre v4 to add new entities/DPs to existing devices.

Some bugs I've noticed...

I had to deleted the integration and re-install it and all my devices for them to become useable. Now the Devices keep going offline, and a reboot of HA is required, sometimes two reboots, to bring them back online,

Adding new devices can make the other devices go offline, again rebooting temporarily fixes this.

The LocalTuya button under yaml configuration rebooting "fails the service call" assembly this is because the yaml configuration has been removed.

I've attached the diagnostics, hopefully this helps. I can add more things if needed.

My router is not an Asus. I have TP Link Deco. I have rebooted it.

config_entry-localtuya-2d9cbe4dbe153b3c6ba126d5d6fe5b2a.json.txt

mkwatchface commented 2 years ago

Hi samarlick,

i have exactly the same problem with devices going offline. In addition to that, i faced a problem pairing an iQ Tech smart plug. I could see the state but i could not control it. Settings were exactly the same as before.

Also, i have a dimmer switch that even before, i could only set up via yaml with the following code:

# Local Tuya Yaml  
localtuya:
  - host: -localipaddress-
    device_id: -mydeviceid-
    local_key: -mylocalkey-
    friendly_name: TV Wall Spot Lights
    protocol_version: "3.3"
    entities:
        - platform: light
          friendly_name: TV Wall Spot Lights
          id: 1                      # TV Wall Spot Spot Lights Power ON/OFF
          brightness: 2              # Needed for the dimming bar to appear
          brightness_lower: 5
          brightness_upper: 1000

Now that Yaml is gone, when trying to add it under the light domain, i was not able to make it work. There are mandatory fields such as "Color", "Color Temperature" which of course are not supported by the dimmer and even if select "False" for those, the entity remains unavailable. This is the dimmer

mafradon commented 2 years ago

local tuya V 4.0.0 HA ver. 2022.7.0.dev20220616 Router: Compal Broadband Networks, Inc CH7465LG Last working local tuya: 3.5.0 Using app in tandem: Yes Using tuya developer account api key: Yes

I have updated local tuya to the latest version but now nothing works. i deleted the integration and linked my tuya project, this is succesful. afterwards when i try to add devices i get and "unexpected error"

here is the log entries in the log: Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:247 Integration: LocalTuya integration (documentation, issues) First occurred: 16 juni 2022 22:18:45 (472 occurrences) Last logged: 10:25:13

[bf7...6wm] Failed to get status: [607...b65] Failed to get status: [076...95b] Failed to get status: [053...3c2] Failed to get status: Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/locks.py", line 417, in acquire await fut asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/tasks.py", line 490, in wait_for return fut.result() asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/localtuya/pytuya/init.py", line 539, in detect_available_dps data = await self.status() File "/config/custom_components/localtuya/pytuya/init.py", line 481, in status status = await self.exchange(STATUS) File "/config/custom_components/localtuya/pytuya/init.py", line 460, in exchange msg = await self.dispatcher.wait_for(seqno) File "/config/custom_components/localtuya/pytuya/init.py", line 247, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError

Logger: custom_components.localtuya.config_flow Source: custom_components/localtuya/pytuya/init.py:247 Integration: LocalTuya integration (documentation, issues) First occurred: 09:33:29 (9 occurrences) Last logged: 10:25:13

Unexpected exception Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/locks.py", line 417, in acquire await fut asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/tasks.py", line 490, in wait_for return fut.result() asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/localtuya/config_flow.py", line 533, in async_step_configure_device self.dps_strings = await validate_input(self.hass, user_input) File "/config/custom_components/localtuya/config_flow.py", line 242, in validate_input detected_dps = await interface.detect_available_dps() File "/config/custom_components/localtuya/pytuya/init.py", line 539, in detect_available_dps data = await self.status() File "/config/custom_components/localtuya/pytuya/init.py", line 481, in status status = await self.exchange(STATUS) File "/config/custom_components/localtuya/pytuya/init.py", line 460, in exchange msg = await self.dispatcher.wait_for(seqno) File "/config/custom_components/localtuya/pytuya/init.py", line 247, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError

stueng commented 2 years ago

+1 Can add devices, but they soon go offline I've also noticed that once some devices go offline, I cant add new devices either, when you get to the part where it presents theIP address, API secrets etc you cant get beyond this stage, its like some underlying network level communication thing stops working.