-
Notifications
You must be signed in to change notification settings - Fork 22
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
Error running on Mac #18
Comments
Hi @sjmotew - This error is indicative of a problem with your Check section 3 of the following and double check IMPORTANT part - (see screenshot here) https://github.com/jasonacox/tinytuya#setup-wizard
|
Jason, All is set up correctly, and I just left the API and secret blank above to conceal. Is this occurring perhaps because I am trying to attach a non-standard Tuya device (Recteq Smoker) that does not appear on the Smart Life App? The Recteq app is based on Tuya but it is not a Tuya identifiable device. It is found by tuyapower but cannot read the key which is what I need. Any thoughts would be helpful, thanks for your work. |
Yes - The Device ID must be in Smart Life app or listed in iot.tuya.com portal as paired or the wizard won't work. Tuya requires a valid paring with the app to provide the local key. The local key is created when you pair (a new one every time you pair). Do you have other Tuya devices you can use? It just needs one valid one to give you all of them. Is the Smoker dev battery powered? If so, important Note: Battery-powered Tuya sensors are usually designed to stay in sleep mode until a state change (eg. temp chg, open or close alert). This means you will not be able to poll these devices except in the brief moment they awake, connect to the WiFi and send their state update payload the the Tuya Cloud. Keep in mind that if you manage to poll the device enough to keep it awake, you may drain the battery. |
Yes I have other Tuya devices, I will link them (which I haven't done yet) and then try again. The smoker is not battery. Thanks. |
It is finding the 2 devices on Tuyapower, one is the app-registered "String Lights", the other is at IP: 10.0.20.26, which is the Recteq smoker. tintuya recognizes the presence 2 devices but will not show the snapshot details including key, only returns the registered device. Here is the output: from tuyapower ` Scanning on UDP ports 6666 and 6667 for devices (15 retries)... FOUND Device [Valid payload]: 10.0.20.246 Scan Complete! Found 2 devices. ` from tinytuya wizard
Device Listing [
Poll local devices? (Y/n): Y Scanning local network for Tuya devices... Polling local devices...
Done.
|
The Tuya cloud will only return keys for devices that have been paired. That may be why are you still not getting the key. Can you pair the Smoker with the SmartLife app? Try to scan now that you have the key for "String Lights". Ensure you do not have the app (e.g. SmartLife) open many of the Tuya devices only allow one connection at a time and refuse others. Some things to try: python -m tinytuya scan # this will scan network and reference the devices.json file to apply key Are you able to import tinytuya
print("TinyTuya (Tuya Interface) [%s]\n"%tinytuya.__version__)
tinytuya.set_debug(True)
d = tinytuya.OutletDevice(DEVICEID, DEVICEIP, DEVICEKEY)
print(d)
d.set_version(3.1)
print(" > Fetch Status < ")
data = d.status()
print(data) |
I was able to directly pair with the SmartLife app using a generic wifi device. Solved all the issues, I can now run from SmartLife or as intended have extracted the key for use with Home Assistant. Great problem solving, I will share and link back on the Home Assistant site. |
Excellent! Thanks for the update @sjmotew ! |
Great app, thank you. Running on MAC trying to find the LOCALKEY for a Recteq grill. Tuyapower identifies the device with device ID, IP etc.. Followed all API Tuya developer instructions and when running tinytuya receive:
`{
"apiKey": "<>",
"apiSecret": "<>",
"apiRegion": "us",
"apiDeviceID": "06200290b4e62d195c2f"
}
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tinytuya/main.py", line 49, in
wizard.wizard(color)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tinytuya/wizard.py", line 206, in wizard
uid = response_dict['result']['uid']
KeyError: 'result'`
The text was updated successfully, but these errors were encountered: