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

Cannot connect to door sensor #540

Open
LucasGorgal opened this issue Oct 3, 2024 · 1 comment
Open

Cannot connect to door sensor #540

LucasGorgal opened this issue Oct 3, 2024 · 1 comment
Labels
tuya_device Support for specific Tuya Devices

Comments

@LucasGorgal
Copy link

Hello. I just bought a WiFi door sensor. It works very well with the app on Android, but I can't seen to connect to it.

I am able to find the device on my network:

`PS C:\Users\lucas> python -m tinytuya scan

TinyTuya (Tuya device scanner) [1.15.1]

Scanning on UDP ports 6666 and 6667 and 7000 for devices for 18 seconds...

New Broadcast from App at 192.168.15.13 - {'from': 'app', 'ip': '192.168.15.13'}
Unknown v3.4 Device Product ID = pgtau22buow5ap0f [Valid Broadcast]:
Address = 192.168.15.6 Device ID = eb5b7d70a459c28983nngh (len:22) Local Key = Version = 3.4 Type = default, MAC =
No Stats for 192.168.15.6: DEVICE KEY required to poll for status
Scan completed in 18.0092 seconds

Scan Complete! Found 1 devices.
Broadcasted: 1
Versions: 3.4: 1
Unknown Devices: 1

Saving device snapshot data to snapshot.json`

And then I am also able to extract its local key either from Tuya API and with the wizard.

Then, if I try to run the script:

`# Example Usage of TinyTuya
import tinytuya

d = tinytuya.OutletDevice('eb5b7d70a459c28983nngh', '192.168.15.6', "LOCAL KEY REDACTED", version=3.4)
d.status()`

It always show this error:
{'Error': 'Network Error: Unable to Connect', 'Err': '901', 'Payload': None}

I have tried everything. Removing and adding again to the app, trying another library, trying another wifi network, etc. None seems to work.

@jasonacox jasonacox added the tuya_device Support for specific Tuya Devices label Oct 4, 2024
@jasonacox
Copy link
Owner

Hi @LucasGorgal - A few thoughts:

  • Tuya will reset the local key every time you remove it from the app. You will need to re-run Wizard to get the new one.
  • After you run the wizard, does the scan function work? It should use the key stored in devices.json.
  • Verify connectivity from your windows machine: ping 192.168.15.6'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tuya_device Support for specific Tuya Devices
Projects
None yet
Development

No branches or pull requests

2 participants