Re: Python Plugin: TUYA
Posted: Thursday 18 March 2021 20:13
Ah, found it in the setup. Tuyaha, version 0.0.6. Downloaded yesterday.
AH, so I am using the wrong plugin... Should I remove Tuyaha first?Xenomes wrote: ↑Thursday 18 March 2021 21:33 OK, then you are using the other plug-in. Can you try https://github.com/Xenomes/Domoticz-TUYA-Plugin there are more lights selections.
OK, that was easy.
Can you run the debug_discovery.py from the tools directory?
I get:
Code: Select all
Traceback (most recent call last):
File "debug_discovery.py", ;ine 2, in <module>
import requests
ImportError: No module named requests
Did you install requests?manjh wrote: ↑Thursday 18 March 2021 21:59 I get:Code: Select all
Traceback (most recent call last): File "debug_discovery.py", ;ine 2, in <module> import requests ImportError: No module named requests
Yes, I followed the instructions to the letter!Xenomes wrote: ↑Thursday 18 March 2021 22:00Did you install requests?manjh wrote: ↑Thursday 18 March 2021 21:59 I get:Code: Select all
Traceback (most recent call last): File "debug_discovery.py", ;ine 2, in <module> import requests ImportError: No module named requests
Ah, that's different.
Code: Select all
Getting credentials
Got credentials
{ 'errorMsg': 'Get accesstoken failed. Invalid parms.',
'responseStatus': 'error'}
Traceback (most recent call last):
File "./debug_discovery.py", line 35, in <module>
payload = {"accessToken": auth_response["access_token"]}
KeyError: 'access_token'
That is better, edit the file and fill in the information between CHANGE THISmanjh wrote: ↑Thursday 18 March 2021 22:09 Ah, that's different.Code: Select all
Getting credentials Got credentials { 'errorMsg': 'Get accesstoken failed. Invalid parms.', 'responseStatus': 'error'} Traceback (most recent call last): File "./debug_discovery.py", line 35, in <module> payload = {"accessToken": auth_response["access_token"]} KeyError: 'access_token'
Code: Select all
2021-03-18 22:11:49.254 (Tuya devices) DEV name=LSC 2 state=True id=6276453110521cc9ecd9 online=True
2021-03-18 22:11:49.254 (Tuya devices) DEV name=LSC 1 state=True id=53425342f4cfa209631c online=True
Sorry, I must have missed this in the plugin instructions.Xenomes wrote: ↑Thursday 18 March 2021 22:12That is better, edit the file and fill in the information between CHANGE THISmanjh wrote: ↑Thursday 18 March 2021 22:09 Ah, that's different.Code: Select all
Getting credentials Got credentials { 'errorMsg': 'Get accesstoken failed. Invalid parms.', 'responseStatus': 'error'} Traceback (most recent call last): File "./debug_discovery.py", line 35, in <module> payload = {"accessToken": auth_response["access_token"]} KeyError: 'access_token'
OK, got it.
Code: Select all
Getting credentials
Got credentials
{ 'access_token': 'EUheu1616000992439YNMrdQKReKU4r4S',
'expires_in': 864000,
'refresh_token': 'EUheu1616000992439YNMrdAFLvKdAtuy',
'token_type': 'bearer'}
Getting devices
Got devices
{ 'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': { 'devices': [ { 'data': { 'brightness': '130',
'color_mode': 'white',
'color_temp': 1000,
'online': True,
'state': 'true'},
'dev_type': 'light',
'ha_type': 'light',
'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/15919273389f9d925c99f.png',
'id': '6276453110521cc9ecd9',
'name': 'LSC 2'},
{ 'data': { 'brightness': '10',
'color_mode': 'white',
'color_temp': 1000,
'online': True,
'state': 'true'},
'dev_type': 'light',
'ha_type': 'light',
'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/15919273389f9d925c99f.png',
'id': '53425342f4cfa209631c',
'name': 'LSC 1'}],
'scenes': []}}