Page 17 of 26

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 11:59
by BarryT
Here is the video:
https://youtu.be/tNDmISinbsQ
As you can see the state of the knob goes from open to close(d) again (after 60 seconds), but there is NO command send after the knob goes to close..:)
Pardon me that i moved the camera on the end, but you could see the issue..

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 15:34
by Xenomes
I understand what is going on, I have updated the https://github.com/Xenomes/Domoticz-TUY ... /plugin.py can you do it 60 sec wait and also post the log.

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 20:35
by BarryT
It is working now, status open will stay open and close will stay close...! Good job!
The only thing is that there is an error...:

Code: Select all

 Error: Tuya: (Tuya) handleThread: can only concatenate str (not "method") to str line 271

Code: Select all

2021-07-11 20:22:58.308  Status: Tuya: (Tuya) Entering work loop.
2021-07-11 20:22:58.308  Status: Tuya: (Tuya) Started.
2021-07-11 20:22:59.449  Status: Tuya: (Tuya) Initialized version 1.0.11, author 'Wagner Oliveira contributed Xenomes'
2021-07-11 20:22:59.451  Tuya: (Tuya) Waiting 60 seconds to connect TuyaApi login timeout

2021-07-11 20:24:13.026  Tuya: (Tuya) TUYA plugin started
2021-07-11 20:24:13.027  Tuya: (Tuya) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE 
2021-07-11 20:24:13.027  Tuya: (Tuya) 'HardwareID':'61'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'HomeFolder':'/home/pi/domoticz/plugins/Domoticz-TUYA-Plugin/'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'StartupFolder':'/home/pi/domoticz/'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'UserDataFolder':'/home/pi/domoticz/'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Database':'/home/pi/domoticz/domoticz.db'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Language':'nl'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Version':'1.0.11'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Author':'Wagner Oliveira contributed Xenomes'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Name':'Tuya'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Port':'0'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Key':'tuya'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Mode1':'31'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Mode2':'tuya'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'Mode6':'-1'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'DomoticzVersion':'2021.1 (build 13360)'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'DomoticzHash':'eee333c30'
2021-07-11 20:24:13.027  Tuya: (Tuya) 'DomoticzBuildTime':'2021-07-04 11:58:11'
2021-07-11 20:24:13.027  Tuya: (Tuya) Device count: 1
2021-07-11 20:24:13.027  Tuya: (Tuya) Device:           1 - ID: 2622, Name: 'Rolgordijn Keuken', nValue: 1, sValue: 'On'
2021-07-11 20:24:13.027  Tuya: (Tuya) Device ID:       '2622'
2021-07-11 20:24:13.028  Tuya: (Tuya) Device Name:     'Rolgordijn Keuken'
2021-07-11 20:24:13.028  Tuya: (Tuya) Device nValue:    1
2021-07-11 20:24:13.028  Tuya: (Tuya) Device sValue:   'On'
2021-07-11 20:24:13.028  Tuya: (Tuya) Device LastLevel: 0
2021-07-11 20:24:13.028  (Rolgordijn Keuken) Updating device from 1:'On' to have values 0:'Off'.
2021-07-11 20:24:13.044  Tuya: (Tuya) Update 0:'Off' (Rolgordijn Keuken) TimedOut=True
2021-07-11 20:24:13.045  Tuya: (Tuya) in handlethread
2021-07-11 20:24:13.048  (Tuya) Processing 'onStopCallback' message
2021-07-11 20:24:13.048  Tuya: (Tuya) Calling message handler 'onStop' on 'module' type object.
2021-07-11 20:24:13.048  Tuya: (Tuya) onStop called

Code: Select all

2021-07-11 20:27:16.173  Tuya: (Tuya) DEV name=Rolgordijn Keuken state=3 id=00660024a4e57***** online=True

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 20:55
by Xenomes
Yes i see, it was in a log for the script, changed it. can u test again πŸ˜…

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 20:59
by BarryT
Xenomes wrote: ↑Sunday 11 July 2021 20:55 Yes i see, it was in a log for the script, changed it. can u test again πŸ˜…
Sure, lol.. Hold'n a sec ;)

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 21:07
by BarryT
Still there... :(
2021-07-11 21:06:32.525 Error: Tuya: (Tuya) handleThread: can only concatenate str (not "int") to str line 271

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 21:11
by Xenomes
The error was changed, added a string convert, can you test again 😎

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 21:16
by BarryT
Xenomes wrote: ↑Sunday 11 July 2021 21:11 The error was changed, added a string convert, can you test again 😎
Eh, now the hole system is weird....

Code: Select all

2021-07-11 21:16:25.933 Error: Zigbee hardware (56) thread seems to have ended unexpectedly
2021-07-11 21:16:25.933 Error: Tuya hardware (61) thread seems to have ended unexpectedly

Re: Python Plugin: TUYA

Posted: Sunday 11 July 2021 21:21
by Xenomes
That is comment when a stop and restart is to quickly after eachother, use a stop and wait few sec then start.

Re: Python Plugin: TUYA

Posted: Monday 12 July 2021 18:10
by BarryT
Xenomes wrote: ↑Sunday 11 July 2021 15:34 I understand what is going on, I have updated the https://github.com/Xenomes/Domoticz-TUY ... /plugin.py can you do it 60 sec wait and also post the log.
I downgraded to this version and disabled the debug that disables the error also. ;)
Everything okay for now.

Re: Python Plugin: TUYA

Posted: Monday 12 July 2021 21:39
by Xenomes
BarryT wrote: ↑Monday 12 July 2021 18:10
Xenomes wrote: ↑Sunday 11 July 2021 15:34 I understand what is going on, I have updated the https://github.com/Xenomes/Domoticz-TUY ... /plugin.py can you do it 60 sec wait and also post the log.
I downgraded to this version and disabled the debug that disables the error also. ;)
Everything okay for now.
Merged the fix to the live version.

Re: Python Plugin: TUYA

Posted: Thursday 15 July 2021 17:07
by BarryT
Xenomes wrote: ↑Monday 12 July 2021 21:39
BarryT wrote: ↑Monday 12 July 2021 18:10
Xenomes wrote: ↑Sunday 11 July 2021 15:34 I understand what is going on, I have updated the https://github.com/Xenomes/Domoticz-TUY ... /plugin.py can you do it 60 sec wait and also post the log.
I downgraded to this version and disabled the debug that disables the error also. ;)
Everything okay for now.
Merged the fix to the live version.
Great job, it works :)
Thanks!

Re: Python Plugin: TUYA

Posted: Tuesday 27 July 2021 21:58
by pvdk
I installed the TUYA (Xenomes) plugin successfully and also the creation of the TUYA hardware in Domoticz was not a problem. Nevertheless, my device was not recognized.

I'm using Domoticz 2021.1 on Raspberry.
The Tuya device is a Wifi Temperature and Humidity Detector (TRD02-01A) which is accessed via the Smart Life app.

Are there any hints on how to progress?

Log:
2021-07-27 21:50:30.036 Status: Sensor: (Sensor) Entering work loop.
2021-07-27 21:50:30.036 Status: Sensor: (Sensor) Started.
2021-07-27 21:50:30.813 Status: Sensor: (Sensor) Initialized version 1.0.12, author 'Wagner Oliveira contributed Xenomes'
2021-07-27 21:51:30.865 Sensor: (Sensor) TUYA plugin started
2021-07-27 21:51:30.865 Sensor: (Sensor) Debug logging mask set to: PYTHON CONNECTION
2021-07-27 21:51:30.865 Sensor: (Sensor) 'HardwareID':'15'
2021-07-27 21:51:30.865 Sensor: (Sensor) 'HomeFolder':'/home/pi/domoticz/plugins/Domoticz-TUYA-Plugin/'
2021-07-27 21:51:30.865 Sensor: (Sensor) 'StartupFolder':'/home/pi/domoticz/'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'UserDataFolder':'/home/pi/domoticz/'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'Database':'/home/pi/domoticz/domoticz.db'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'Language':'en'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'Version':'1.0.12'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'Author':'Wagner Oliveira contributed Xenomes'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'Name':'Sensor'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'Port':'0'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'Username’:’[email protected]'
2021-07-27 21:51:30.866 Sensor: (Sensor) 'Password’:’password’
2021-07-27 21:51:30.867 Sensor: (Sensor) 'Key':'tuya'
2021-07-27 21:51:30.867 Sensor: (Sensor) 'Mode1':'31'
2021-07-27 21:51:30.867 Sensor: (Sensor) 'Mode2':'smart_life'
2021-07-27 21:51:30.867 Sensor: (Sensor) 'Mode6':'18'
2021-07-27 21:51:30.867 Sensor: (Sensor) 'DomoticzVersion':'2021.1'
2021-07-27 21:51:30.867 Sensor: (Sensor) 'DomoticzHash':'8547c5b7e'
2021-07-27 21:51:30.867 Sensor: (Sensor) 'DomoticzBuildTime':'2021-04-17 17:29:11'
2021-07-27 21:51:30.867 Sensor: (Sensor) Device count: 0
2021-07-27 21:51:30.869 Sensor: (Sensor) in handlethread
2021-07-27 21:51:30.975 Sensor: (Sensor) onHeartbeat called time=1627415490.975322
2021-07-27 21:51:30.976 Sensor: (Sensor) in handlethread
2021-07-27 21:51:30.976 Sensor: (Sensor) Device count: 0
2021-07-27 21:51:40.051 Sensor: (Sensor) onHeartbeat called time=1627415500.0508928
2021-07-27 21:51:50.071 Sensor: (Sensor) onHeartbeat called time=1627415510.0713763

Re: Python Plugin: TUYA

Posted: Wednesday 28 July 2021 9:45
by Xenomes
pvdk wrote: ↑Tuesday 27 July 2021 21:58 I installed the TUYA (Xenomes) plugin successfully and also the creation of the TUYA hardware in Domoticz was not a problem. Nevertheless, my device was not recognized.

I'm using Domoticz 2021.1 on Raspberry.
The Tuya device is a Wifi Temperature and Humidity Detector (TRD02-01A) which is accessed via the Smart Life app.

Are there any hints on how to progress?
Can you configure and run the debug_discovery.py from the tools directory? please post the output here.

Re: Python Plugin: TUYA

Posted: Monday 23 August 2021 22:56
by loeknl
The Tuya plugin makes my system unstable and crashes Domoticz about two-three times a day. Any clue what can cause this?

Re: Python Plugin: TUYA

Posted: Tuesday 24 August 2021 9:16
by waltervl
loeknl wrote: ↑Monday 23 August 2021 22:56 The Tuya plugin makes my system unstable and crashes Domoticz about two-three times a day. Any clue what can cause this?
Stable or Beta release of Domoticz?

Re: Python Plugin: TUYA

Posted: Wednesday 25 August 2021 13:16
by loeknl
waltervl wrote: ↑Tuesday 24 August 2021 9:16 Stable or Beta release of Domoticz?
I use the stable 2021.1 From april 17h
And the up to date Tuya plugin (1.0.12)

Re: Python Plugin: TUYA

Posted: Wednesday 25 August 2021 15:50
by waltervl
It could be related to another python plugin. Disable them one by one and see if the crash will disappear.

Re: Python Plugin: TUYA

Posted: Wednesday 25 August 2021 20:53
by Xenomes
loeknl wrote: ↑Monday 23 August 2021 22:56 The Tuya plugin makes my system unstable and crashes Domoticz about two-three times a day. Any clue what can cause this?
That is strange I never had any issue when the plug-in is running.

This is a good tip.
waltervl wrote: ↑Wednesday 25 August 2021 15:50 It could be related to another python plugin. Disable them one by one and see if the crash will disappear.

Re: Python Plugin: TUYA

Posted: Wednesday 01 September 2021 19:28
by adelafug
Hello


I install plugin tuyaha and configure params. But when plugin call skill api i no receibe my devices. I used Tuya Smart with iphone.. And i have 1 device registred ( sensor door ).

I test api with Postman y receive the same response..

https://px1.tuyaeu.com/homeassistant/sk ... dVersion=1
BodY: {'header': {'name': 'Discovery', 'namespace': 'discovery', 'payloadVersion': 1}, 'payload': {'accessToken': 'EUheu16305128439555U07k8PoLsNpHsU'}}

Response.

{"payload":{"devices":[],"scenes":[]},"header":{"code":"SUCCESS","payloadVersion":1}}



Any idea?

Thanks.