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

Errors when adding PV28-CW #2288

Closed
YodaDaCoda opened this issue Sep 10, 2024 · 6 comments
Closed

Errors when adding PV28-CW #2288

YodaDaCoda opened this issue Sep 10, 2024 · 6 comments

Comments

@YodaDaCoda
Copy link
Contributor

Describe the bug
I recently acquired a PV28-CW 8 in 1 air quality monitor and started setting it up using Smart Life cloud-assisted device setup., but I get an error Unable to connect to your device with those details. It could be an intermittent issue, or they may be incorrect. during config flow.

Screenshot_20240910_141731

If I close the config flow at this point and try to set it up again, I get a different error Unknown error occurred.

image

As you can see from the attached images, both errors occur upon submission of the same step.

To Reproduce

  1. From Tuya Local integration page, Add Device
  2. Choose "Smart Life cloud-assisted device setup." & proceed with scanning the QRCode
  3. Choose the device from the provided list, go next, go next
  4. After TuyaLocal has scanned the network and correctly identified the device, submit the config flow page
  5. Note the error

Expected behavior
I expect the step to submit successfully and the device to be added to Home Assistant.

Additional context
I have a Kogan LX10 vacuum cleaner with mop and a Akai heat pump clothes dryer already setup and working well.

I suspect the "Unknown error occurred" error is due to some state not being cleared when cancelling the first attempt. There's a KeyError: 'device' in the log pointing to this line...
https://github.com/make-all/tuya-local/blob/d253c664995a62c86b0ba0c49b764f0fad981d06/custom_components/tuya_local/config_flow.py#L622C12-L622C32

See attached log file :)

home-assistant_tuya_local_2024-09-10T04-11-59.864Z.log

@YodaDaCoda YodaDaCoda added the bug Something isn't working label Sep 10, 2024
@make-all
Copy link
Owner

make-all commented Sep 10, 2024

The second error does appear to be a bug in the new sharing of parent devices, as the connections are now cached alongside the device, but when the test connection is made, you end up with a cache entry for the connection without a corresponding device.

The first error may be because your device only accepts a single connection. When using the cloud based config flow, you open the app on your mobile device to get the user code and scan the QR code for authentication. So the app is starting and making a local connection to your device. You may need to either disable WiFi and do the cloud authentication step over mobile network, or force close the app after authenticating and before submitting the next config step with device id and local key. I think the 901 error is indicating that the device refused a connection at the network level, so I think it will be something like that. (you will need to restart HA to clear the second error above first though)

@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release labels Sep 11, 2024
@Mugga6315
Copy link

I got another device but also got the same error as the second one with mine

@mirkocampisi
Copy link

I got the same error when adding a Tuya Thermometer, maybe because it connects to wifi only to repost data once in a hour so it is not reacheable? I added a Lefant Vacuum without problems because it is always online.

@YodaDaCoda
Copy link
Contributor Author

I quickly ran through adding the device while my phone was not connected to the wifi (I switched wifi off before opening the app, and I haven't opened it since reporting this issue last week).

I still get the first error though.

I've been trying to get some additional information out of the device using @tuyapi/cli and nmap but don't seem to be getting anywhere. I'll revisit this later.

@make-all
Copy link
Owner

I would suggest reinstalling 2024.8.0 and copying this config file again if you want to experiment further, as with 2024.9.0, you will only get one chance per HA restart to add the device before it starts returning the second error.

@YodaDaCoda
Copy link
Contributor Author

I've poked around with this device quite a bit over the last week and I've come to the conclusion that mine must be one of those that has different firmware that doesn't allow for local control. I used tcpdump on my router to see that it maintains a persistent connection to the tuya cloud, but all port scans show everything closed no matter what I do (reboot the device, disconnect the phone from wifi, etc). It'd be awesome to replace the firmware, but I know from experience that's tricky at best.

@make-all make-all removed bug Something isn't working awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants