Page 1 of 4

Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Monday 25 May 2020 13:18
by jforum
Recently, I found a plugin that don’t require you to flash the Tuya firmware. It works similar to the Homeassistant Tuya Plugin.
Created a video to show you how to integrate it and make it work with Tuya Smart Life App. As of today, this plugin need a little code to make it work with the Smart Life App else it will just work with Tuya App.

https://youtu.be/pBJZcwIDOUY

NOTE: This plugin is created and developed by “Tizzen33”. His github repo is: https://github.com/tizzen33/domoticz-tuyacloud-plugin

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Tuesday 26 May 2020 9:46
by remb0
great news! thanks for sharing. :!:

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Thursday 28 May 2020 0:57
by DarkG
What means that error?

Code: Select all

plugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-05-28 00:52:49.480 Error: (tuya) Module Import failed, exception: 'ModuleNotFoundError'
2020-05-28 00:52:49.480 Error: (tuya) Module Import failed: ' Name: requests'
2020-05-28 00:52:49.480 Error: (tuya) Error Line details not available.
2020-05-28 00:52:49.508 Error: (PiMonitor) 'onStart' failed 'KeyError'.
2020-05-28 00:52:49.508 Error: (PiMonitor) ----> Line 219 in '/home/pi/domoticz/plugins/PiMonitor/plugin.py', function onStart
2020-05-28 00:52:49.508 Error: (PiMonitor) ----> Line 77 in '/home/pi/domoticz/plugins/PiMonitor/plugin.py', function onStart
2020-05-28 00:53:37.373 Status: (tuya) Stop directive received.
2020-05-28 00:53:37.374 Status: (tuya) Stopping threads.
2020-05-28 00:53:37.374 Status: (tuya) Stopped.
2020-05-28 00:54:05.047 Status: (tuya) Started.
2020-05-28 00:54:05.163 Error: (tuyacloud) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/tuyacloud-plugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-05-28 00:54:05.163 Error: (tuya) Module Import failed, exception: 'ModuleNotFoundError'
2020-05-28 00:54:05.163 Error: (tuya) Module Import failed: ' Name: requests'
2020-05-28 00:54:05.164 Error: (tuya) Error Line details not available.
2020-05-28 00:55:07.072 Error: tuya hardware (19) thread seems to have ended unexpectedly

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Thursday 28 May 2020 12:40
by jforum
Hi, it seem like your python does not install the dependencies module "requests"

Try pip install requests
DarkG wrote: Thursday 28 May 2020 0:57 What means that error?

Code: Select all

plugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-05-28 00:52:49.480 Error: (tuya) Module Import failed, exception: 'ModuleNotFoundError'
2020-05-28 00:52:49.480 Error: (tuya) Module Import failed: ' Name: requests'
2020-05-28 00:52:49.480 Error: (tuya) Error Line details not available.
2020-05-28 00:52:49.508 Error: (PiMonitor) 'onStart' failed 'KeyError'.
2020-05-28 00:52:49.508 Error: (PiMonitor) ----> Line 219 in '/home/pi/domoticz/plugins/PiMonitor/plugin.py', function onStart
2020-05-28 00:52:49.508 Error: (PiMonitor) ----> Line 77 in '/home/pi/domoticz/plugins/PiMonitor/plugin.py', function onStart
2020-05-28 00:53:37.373 Status: (tuya) Stop directive received.
2020-05-28 00:53:37.374 Status: (tuya) Stopping threads.
2020-05-28 00:53:37.374 Status: (tuya) Stopped.
2020-05-28 00:54:05.047 Status: (tuya) Started.
2020-05-28 00:54:05.163 Error: (tuyacloud) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/tuyacloud-plugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-05-28 00:54:05.163 Error: (tuya) Module Import failed, exception: 'ModuleNotFoundError'
2020-05-28 00:54:05.163 Error: (tuya) Module Import failed: ' Name: requests'
2020-05-28 00:54:05.164 Error: (tuya) Error Line details not available.
2020-05-28 00:55:07.072 Error: tuya hardware (19) thread seems to have ended unexpectedly

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Sunday 31 May 2020 21:47
by nico4sen
It works. Nice. Thx for sharing.

Verstuurd vanaf mijn TA-1021 met Tapatalk


Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Tuesday 21 July 2020 17:59
by MrRikkie
Hi, one question does this plugin also work for a motion detector ? I do not know how the app will register this, in principle it’s a switch.

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Sunday 26 July 2020 10:19
by kabaret10
Hello, I've got the same problem as nico4sen but I'm using domoticz in docker container.
Inside container there's python 2.7

Code: Select all

Python 2.7.16 (default, Jan 14 2020, 07:22:01)
How to make this work? Do I need to update python inside container and then add dependencies?
Or can I just pull python ver.3 image on other container and somehow connect it eachother?
What ports this plugin use?
I'm kinda new to docker and I'm trying to figure it out. ;)


@EDIT Solved.
Need to rebuild current domoticz image with dockerfile.
TIPS
1. Create somewhere file named Dockerfile and go to that location in shell.
2. Edit it with:

Code: Select all

FROM linuxserver/domoticz:latest      # current configured domoticz image with some stuff.
RUN python3 -m pip install requests
and that's it, now:

Code: Select all

sudo docker build . 

Output: New name of image.
Now create your container with this image.

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Saturday 03 October 2020 14:33
by ismo67
This plugin works very well after checking the video as instructions are not perfect for non Linux person at Github right now.
But at the video is everything explained.
https://www.youtube.com/watch?v=pBJZcwIDOUY

Has there been plans also to get the electricity consumption values of the plugs this plugin can switch on and off?

Also I can see this plugin recognized my Tuya thermostats but those does not show any temperature values.

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Friday 13 November 2020 14:20
by YrBo
Hi,

Thanks to this post i managed to add two Tuya devices.
One for floor heating Thermostat and a Neo Coolcam Smart Plug Wifi Socket (NAS-WR01W)
I've Domoticz running on a Synology 218+
Both devices i can switch On and Off with Domoticz.
For the WiFi socket i would like to measure used electricity.
The thermostat temperature i would like to manage the temperature and schedules.

Is this possible?

Thanks in advance

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Friday 13 November 2020 14:30
by DarkG
YrBo wrote: Friday 13 November 2020 14:20 For the WiFi socket i would like to measure used electricity.
The thermostat temperature i would like to manage the temperature and schedules.
https://github.com/guino/tuyaha#how-to- ... our-device

this is important to check if you get the values you need

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Friday 13 November 2020 15:24
by YrBo
Thanks,

After running is get the following;

File "debug_discovery.py", line 30
print("Got credentials")
^
IndentationError: unexpected indent

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Saturday 14 November 2020 1:57
by DarkG
this is a syntax error

I think there is a layout error like a space or so

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Saturday 05 December 2020 11:39
by schijndela
Hi,

Last week I installed the Plugin in my Domoticz to control my smart Sockets, entered all the neccessary information on the hardware tab like username, password and country code.
But the only thing is I don't see any devices appearing in Domoticz.
I modified the debug_discovery.py script in the Tools directory with my settings and ran it. I don't see any error messages but to be honest I don't know how to read the message I receive.

Am I overseeing something?

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Saturday 05 December 2020 20:08
by Xenomes
There is nothing in the payload the devices section in empty. Do you used the corrected account?
2020-12-05 20_03_10-Clipboard.png
2020-12-05 20_03_10-Clipboard.png (160.61 KiB) Viewed 11482 times

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Saturday 05 December 2020 20:40
by schijndela
I use the same account (E-mailaddress) and password which I use for access in the smartlife app

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Tuesday 08 December 2020 21:51
by Xenomes
The builder of the tuyaha library as added this to the readme. The tuyaha library is the base Tuya plugin.
My device is not listed in Tuya API response or contains incomplete state, what should I do?

Write an email to [email protected] and mention the tuyapy library and https://px1.tuya{}.com API endpoint. Usually they ignore incoming emails, but perhaps, if they get a lot of emails, they will start fixing the API.

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Thursday 10 December 2020 20:19
by schijndela
Thank you, I will send him / her an E-mail if feedback comes I will give an update.

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Friday 11 December 2020 16:45
by schijndela
Hi Xenomes, you mention that I need to write an E-mail to tuya and mention the tuyapy library and the https link!? Is that enough information?!
Or do I need to add additional information from these Smart Sockets? if that's the case what kind of information of the Sockect they need?

Many thanks in advance for your reply.

Xenomes wrote: Tuesday 08 December 2020 21:51 The builder of the tuyaha library as added this to the readme. The tuyaha library is the base Tuya plugin.
My device is not listed in Tuya API response or contains incomplete state, what should I do?

Write an email to [email protected] and mention the tuyapy library and https://px1.tuya{}.com API endpoint. Usually they ignore incoming emails, but perhaps, if they get a lot of emails, they will start fixing the API.

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Saturday 12 December 2020 20:38
by famous
MrRikkie wrote: Tuesday 21 July 2020 17:59 Hi, one question does this plugin also work for a motion detector ? I do not know how the app will register this, in principle it’s a switch.
I tried today, but no succes with the LSC motion sensor from Action :(
If i run the debug_discovery it also noticed 0 devices ...

Re: Tuya Cloud Plugin [No custom firmware require]: Finally for Domoticz

Posted: Saturday 12 December 2020 22:13
by Xenomes
schijndela wrote: Friday 11 December 2020 16:45 Hi Xenomes, you mention that I need to write an E-mail to tuya and mention the tuyapy library and the https link!? Is that enough information?!
Or do I need to add additional information from these Smart Sockets? if that's the case what kind of information of the Sockect they need?

Many thanks in advance for your reply.
I wouldn't know either, I would mention brand and type of the device and the comment of PaulAnnekov.