Page 18 of 26

Re: Python Plugin: TUYA

Posted: Wednesday 01 September 2021 20:58
by Xenomes
adelafug wrote: Wednesday 01 September 2021 19:28 {"payload":{"devices":[],"scenes":[]},"header":{"code":"SUCCESS","payloadVersion":1}}
The devices string of the api is empty so there is noting for the plug-in to detect. Tuya is developing a new api tuya-iot-python-sdk maybe there is a programmer that will create a Tuya plug-in around it. I only have one Tuya device left to phase out then I have only Zigbee and Tasmota converted devices.

Re: Python Plugin: TUYA

Posted: Thursday 02 September 2021 8:58
by adelafug
Its posible flash with tasmota this device?

| PGST PB69 Tuya inteligente WiFi en casa Sensor de puerta App Ventana de notificación de protección de seguridad alerta de alarma de seguridad
https://a.aliexpress.com/_vPlJxU

Re: Python Plugin: TUYA

Posted: Monday 13 September 2021 12:31
by rolandtwilt
I don't know if I'm good on this topic?
but I have the following question:
I bought a Tuya Zigbee gateway and connected it to Domoticz via the plugin (Tuya Cloud).
(https://github.com/guino/tuyaha) followed all instructions and it seems to work....
however when starting Domoticz I get the following message:

2021-09-12 10:08:01.535 Tuya: (Tuya) Device count: 0

And so no devices were found, anyone have an idea?

Re: Python Plugin: TUYA

Posted: Monday 13 September 2021 19:32
by Xenomes
rolandtwilt wrote: Monday 13 September 2021 12:31 I don't know if I'm good on this topic?
but I have the following question:
I bought a Tuya Zigbee gateway and connected it to Domoticz via the plugin (Tuya Cloud).
(https://github.com/guino/tuyaha) followed all instructions and it seems to work....
however when starting Domoticz I get the following message:

2021-09-12 10:08:01.535 Tuya: (Tuya) Device count: 0

And so no devices were found, anyone have an idea?
The plug-in is working with the first version of the Tuya API, this version does not work with the Zigbee gateway.

Re: Python Plugin: TUYA

Posted: Tuesday 14 September 2021 12:44
by rolandtwilt
Thanks for your comment!
Are there multiple versions?
And where can I find the right one?

Re: Python Plugin: TUYA

Posted: Saturday 02 October 2021 9:11
by kalinkamaen
Hello i am trying to get Tuya plugin to work, but I am stuck now :(

I am using windows 10 PC,
About Domoticz
Version: 2021.1 (build 13669) (beta)
Build Hash: f30dc726c
Compile Date: 2021-10-01 18:47:35
dzVents Version: 3.1.8
Python Version: 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)]

Domoticz find my Python but when I try to open Tuya plugin i get this error message:
2021-10-02 09:08:02.221 Error: Smartlife: (tuya) failed to load 'plugin.py', Python Path used was 'C:\Program Files (x86)\Domoticz\plugins\tuyaha-master\;C:\Program Files (x86)\Python35-32\python35.zip;C:\Program Files (x86)\Python35-32\Lib\;C:\Program Files (x86)\Python35-32\DLLs\;C:\Program Files (x86)\Domoticz;C:\Program Files (x86)\Python35-32;C:\Program Files (x86)\Python35-32\lib\site-packages'.
2021-10-02 09:08:02.221 Error: Smartlife: (Smartlife) Module Import failed, exception: 'ImportError'
2021-10-02 09:08:02.221 Error: Smartlife: (Smartlife) Module Import failed: ' Name: requests'
2021-10-02 09:08:02.221 Error: Smartlife: (Smartlife) Error Line details not available.
2021-10-02 09:08:02.221 Error: Smartlife: (Smartlife) Exception traceback:
2021-10-02 09:08:02.221 Error: Smartlife: (Smartlife) ----> Line 57 in 'C:\Program Files (x86)\Domoticz\plugins\tuyaha-master\plugin.py', function <module>
2021-10-02 09:08:02.221 Error: Smartlife: (Smartlife) ----> Line 2 in 'C:\Program Files (x86)\Domoticz\plugins\tuyaha-master\tuyaha\__init__.py', function <module>
2021-10-02 09:08:02.221 Error: Smartlife: (Smartlife) ----> Line 5 in 'C:\Program Files (x86)\Domoticz\plugins\tuyaha-master\tuyaha\tuyaapi.py', function <module>
Image

Also a guestion, do I need gateway to make this work?

Re: Python Plugin: TUYA

Posted: Saturday 02 October 2021 10:05
by waltervl
If you used this Tuya plugin https://github.com/Xenomes/Domoticz-TUYA-Plugin (there are others) you need to install the python module "requests" too.

Re: Python Plugin: TUYA

Posted: Saturday 02 October 2021 10:52
by kalinkamaen
waltervl wrote: Saturday 02 October 2021 10:05 If you used this Tuya plugin https://github.com/Xenomes/Domoticz-TUYA-Plugin (there are others) you need to install the python module "requests" too.
I did nopt use this plugin. But now I have tried this plugin that you linked me, and installed requests with command promt pr installation guide.

And now i get this error:
2021-10-02 10:49:41.537 Error: Smart life 2: (tuya) failed to load 'plugin.py', Python Path used was 'C:\Program Files (x86)\Domoticz\plugins\Tuya\;C:\Program Files (x86)\Python35-32\python35.zip;C:\Program Files (x86)\Python35-32\Lib\;C:\Program Files (x86)\Python35-32\DLLs\;C:\Program Files (x86)\Domoticz;C:\Program Files (x86)\Python35-32;C:\Program Files (x86)\Python35-32\lib\site-packages'.
2021-10-02 10:49:41.557 Error: Smart life 2: (Smart life 2) Module Import failed, exception: 'ImportError'
2021-10-02 10:49:41.568 Error: Smart life 2: (Smart life 2) Module Import failed: ' Name: tuyaha'
2021-10-02 10:49:41.638 Error: Smart life 2: (Smart life 2) Error Line details not available.
2021-10-02 10:49:41.689 Error: Smart life 2: (Smart life 2) Exception traceback:
2021-10-02 10:49:41.729 Error: Smart life 2: (Smart life 2) ----> Line 65 in 'C:\Program Files (x86)\Domoticz\plugins\Tuya\plugin.py', function <module>
Could it be that my Tuya devices are not compatible with this plugin?
https://www.aliexpress.com/item/1005002 ... 4c4dCa0nZs

Re: Python Plugin: TUYA

Posted: Saturday 02 October 2021 15:51
by Xenomes
kalinkamaen wrote: Saturday 02 October 2021 10:52

Code: Select all

2021-10-02 10:49:41.568 Error: Smart life 2: (Smart life 2) Module Import failed: ' Name: tuyaha'
The Tuyaha module is missing, you need to install it see https://github.com/Xenomes/Domoticz-TUY ... stallation
kalinkamaen wrote: Saturday 02 October 2021 10:52 Could it be that my Tuya devices are not compatible with this plugin?
That one is unknown, some devices work with the old api some don't.

Re: Python Plugin: TUYA

Posted: Saturday 02 October 2021 16:20
by kalinkamaen
Xenomes wrote: Saturday 02 October 2021 15:51
kalinkamaen wrote: Saturday 02 October 2021 10:52

Code: Select all

2021-10-02 10:49:41.568 Error: Smart life 2: (Smart life 2) Module Import failed: ' Name: tuyaha'
The Tuyaha module is missing, you need to install it see https://github.com/Xenomes/Domoticz-TUY ... stallation
kalinkamaen wrote: Saturday 02 October 2021 10:52 Could it be that my Tuya devices are not compatible with this plugin?
That one is unknown, some devices work with the old api some don't.
There is install guide for Linux. But I am using windows. WHat and how do I copy paste the files in to plugin directory?

Image

Re: Python Plugin: TUYA

Posted: Saturday 02 October 2021 19:42
by Xenomes
kalinkamaen wrote: Saturday 02 October 2021 16:20 There is install guide for Linux. But I am using windows. WHat and how do I copy paste the files in to plugin directory?
You don't need to put something in the plug-in directory 😆 install pip for python in your windows. https://phoenixnap.com/kb/install-pip-windows then install the modules with the pip install command.

Re: Python Plugin: TUYA

Posted: Sunday 03 October 2021 10:02
by kalinkamaen
Xenomes wrote: Saturday 02 October 2021 19:42
kalinkamaen wrote: Saturday 02 October 2021 16:20 There is install guide for Linux. But I am using windows. WHat and how do I copy paste the files in to plugin directory?
You don't need to put something in the plug-in directory 😆 install pip for python in your windows. https://phoenixnap.com/kb/install-pip-windows then install the modules with the pip install command.
Thank you guys, I have managed to make it work.I am a noob so I did not know about pip. I had to download TUYA plugin, put it in directory and pip install it from directory. I was not able to install it from github.

Re: Python Plugin: TUYA

Posted: Sunday 03 October 2021 18:36
by kalinkamaen
Any plugins for door sensors and or temperatur sensor?

Re: Python Plugin: TUYA

Posted: Sunday 03 October 2021 22:26
by manjh
I am using TUYA Plugin v.1.0.6, this has worked flawless for several months. But suddenly I have weird problems: lamps no longer react, and the log show strange messages:

Code: Select all

2021-10-03 22:24:53.155 (Tuya_devices) onHeartbeat called time=1633292693.1554873
2021-10-03 22:24:53.157 (Tuya_devices) in handlethread
2021-10-03 22:24:53.312 Error: (Tuya_devices) handleThread: Expecting value: line 1 column 1 (char 0) line 198
When I try to enable and disable the plugin, it freezes Domoticz. Have to go into the Pi thru Putty, stop/start Domoticz to resolve. Also strange: Domoticz restart does not work, it has to be stop/start!

Any clues?

edit: the weird part is that Domoticz was doing OK when switching the devices on earlier this evening. The problem developed during the evening!
The Tuya Smart app that I used to pair the lamps does work, although it takes several seconds before I can see the status of the lamps.
Could there be a problem in the Tuya server somehow?

Re: Python Plugin: TUYA

Posted: Sunday 03 October 2021 22:46
by EdwinK
I just read that there was some problems with the Tuya servers.

Re: Python Plugin: TUYA

Posted: Sunday 03 October 2021 22:47
by manjh
EdwinK wrote: Sunday 03 October 2021 22:46 I just read that there was some problems with the Tuya servers.
Ah, that's a relief. I thought I was going crazy.. :shock:

Where did you read that? Is there a way to get a status update> Would be great to know when the problem is fixed!

Re: Python Plugin: TUYA

Posted: Monday 04 October 2021 11:24
by manjh
Looks like the Tuya people fixed the problem. This morning the app worked again, although I had to change the password. After changing it in Domoticz as well, everything was OK. :)

Re: Python Plugin: TUYA

Posted: Monday 04 October 2021 20:58
by gorstj
Given server outage yesterday it highlight fragility of using the cloud

It looks like there is a new HA Tuya v2 API that may be a replacement for the python module that this plugin utilises?

https://peyanski.com/home-assistant-tuy ... -official/

It looks like it is more reliable, more features and will soon have built in local control

Will this plugin migrate to using this backend?

Re: Python Plugin: TUYA

Posted: Monday 04 October 2021 22:06
by Xenomes
gorstj wrote: Monday 04 October 2021 20:58 Will this plugin migrate to using this backend?
I won't be creating a new plug-in with the new Tuya_V2 API and DomoticzEX, I phased out Tuya devices in my environment.

Re: Python Plugin: TUYA

Posted: Monday 04 October 2021 22:42
by manjh
gorstj wrote: Monday 04 October 2021 20:58 Given server outage yesterday it highlight fragility of using the cloud
I fully agree, and I wouldgreatly appreciate a plugin that controls the Tuya devices locally, so without involving a cloud server. I know about flashing deices with Tasmota, but also read about the ongoing battle between Tuya-convert and Tuya (trying to prohibit flashing their devices).
So until there is a simple way to achieve this, I will stick to the current Tuya plugin.

I noticed a post from the author of the plugin (Xenomes) that the Tuya devices have been phased out of his house... so I guess we will have to live current version....