xZetsubou/hass-localtuya

[Bug]: No DPS able to be detected 'NoneType' object has no attribute 'detect_available_dps'

Closed this issue · 5 comments

LocalTuya Version

2024.6.0

Home Assistant Version

2024.7.1

Environment

  • Does the device work using the Home Assistant Tuya Cloud component?
  • Is this device connected to another local integration, including Home Assistant and any other tools?
  • The devices are within the same HA subnet, and they get discovered automatically when I add them

What happened?

My simple switch stopped working on Tuya integration because the free API key expired, I wanted to stop using the cloud, so I moved to rospogrigio/localtuya, that stopped working I tried to switch to your fork, and it is still not working, I tried to remove the device and configure it again with no luck, the error it gives me is: No DPS able to be detected 'NoneType' object has no attribute 'detect_available_dps'

The device still works with the Smart life app.

Steps to reproduce.

Just tried to add new device, selected the right IP, filled all the mandatory data, click send, and an error appeared on top of the page that says in red: An unknown error occurred. .. And the device was not added.

Relevant log output

2024-07-08 16:50:33.259 DEBUG (MainThread) [custom_components.localtuya.config_flow] No DPS able to be detected 'NoneType' object has no attribute 'detect_available_dps'
2024-07-08 16:50:33.259 DEBUG (MainThread) [custom_components.localtuya.config_flow] Detected DPS: {}
2024-07-08 16:50:33.259 DEBUG (MainThread) [custom_components.localtuya.config_flow] Unexpected exception:

Diagnostics information.

I can't get diagnostics since I can not configure the device.

I have several Switch devices that I own, but only one of them had the same error, and when I ran a network diagnostic in the Tuya app, only that device had a diagnostic error. I power cycled the problematic device, and the problem was resolved. I hope my experience helps.

Thanks, resetting the device did not work, it was this device: F1202-EU/F1s202-EU
I ended up replacing it with an older device that I had at home.

Even if it is not a problem with the complement, the error could be more informative, and an "Unexpected exception:" should always come with the exception message afterward, not with an empty string.

That's unfortunate. It's difficult because there are so many different cases...

Did you set-up the cloud with localtuya? if yes post the entry diagnostics

This error isn't a bug on localtuya or something this means it fails to connect to the device. you can verify if the device/port is good. by testing the connection in Home Assistant environment < better or using windows powershell

PS:

Test-NetConnection -ComputerName 192.168.1.102 -Port 6668

Linux:

nc -vz 192.168.1.102 6668

No, I did not set up the cloud because I do not want to send data to tuya servers. And Also I do not want to have to renew the API all the time.

I solved the issue using a different device. I think this issue should be about making the error log more informative. And not having an empty Unexpected exception: