Re: Python Plugin: TUYA
Posted: Tuesday 29 November 2022 17:17
Hi.
Found this thread when trying to get Nedis SmartLife light bulb to work with domoticz.
But.. Not working, and long story short:
Pretty sure username / password are correct, as well region / countrycode and biz_type also.
What have I done wrong?-)
Tested plugin inside Domoticz also, but won't work, gives same error ?
Found this thread when trying to get Nedis SmartLife light bulb to work with domoticz.
But.. Not working, and long story short:
Code: Select all
python3 ./debug_discovery.py
Getting credentials
Got credentials
{ 'errorMsg': 'Get accesstoken failed. Username or password error!',
'responseStatus': 'error'}
Traceback (most recent call last):
File "./debug_discovery.py", line 35, in <module>
payload = {"accessToken": auth_response["access_token"]}
KeyError: 'access_token'
What have I done wrong?-)
Tested plugin inside Domoticz also, but won't work, gives same error ?
Code: Select all
2022-11-29 18:10:23.698 nedis: TUYA plugin started
2022-11-29 18:10:23.698 nedis: Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE
2022-11-29 18:10:23.698 nedis: 'HardwareID':'11'
2022-11-29 18:10:23.698 nedis: 'HomeFolder':'/opt/domoticz/plugins/Domoticz-TUYA-Plugin/'
2022-11-29 18:10:23.698 nedis: 'StartupFolder':'/opt/domoticz/'
2022-11-29 18:10:23.698 nedis: 'UserDataFolder':'/opt/domoticz/'
2022-11-29 18:10:23.698 nedis: 'Database':'/opt/domoticz/domoticz.db'
2022-11-29 18:10:23.698 nedis: 'Language':'en'
2022-11-29 18:10:23.698 nedis: 'Version':'1.0.14'
2022-11-29 18:10:23.698 nedis: 'Author':'Wagner Oliveira contributed Xenomes'
2022-11-29 18:10:23.698 nedis: 'Name':'nedis'
2022-11-29 18:10:23.698 nedis: 'Port':'0'
2022-11-29 18:10:23.698 nedis: 'Username':'[email protected]'
2022-11-29 18:10:23.698 nedis: 'Password':'XXXXXXXX'
2022-11-29 18:10:23.699 nedis: 'Key':'tuya'
2022-11-29 18:10:23.699 nedis: 'Mode1':'358'
2022-11-29 18:10:23.699 nedis: 'Mode2':'smart_life'
2022-11-29 18:10:23.699 nedis: 'Mode6':'-1'
2022-11-29 18:10:23.699 nedis: 'DomoticzVersion':'2022.2 (build 14784)'
2022-11-29 18:10:23.699 nedis: 'DomoticzHash':'e04d1d3e2'
2022-11-29 18:10:23.699 nedis: 'DomoticzBuildTime':'2022-11-29 08:53:03'
2022-11-29 18:10:23.699 nedis: Device count: 0
2022-11-29 18:10:23.699 nedis: in handlethread
2022-11-29 18:10:23.701 nedis: Acquiring GIL for 'onStartCallback'
2022-11-29 18:10:23.751 nedis: Pushing 'onHeartbeatCallback' on to queue
2022-11-29 18:10:23.801 nedis: Processing 'onHeartbeatCallback' message
2022-11-29 18:10:23.801 nedis: Acquiring GIL for 'onHeartbeatCallback'
2022-11-29 18:10:23.801 nedis: Calling message handler 'onHeartbeat' on 'module' type object.
2022-11-29 18:10:23.801 nedis: onHeartbeat called time=1669738223.8017232
2022-11-29 18:10:23.802 nedis: in handlethread
2022-11-29 18:10:23.802 nedis: Device count: 0
2022-11-29 18:10:23.802 nedis: Acquiring GIL for 'onHeartbeatCallback'
2022-11-29 18:10:24.628 Error: nedis: handleThread: Get accesstoken failed. Username or password error! line 209