[REQUEST] Plugin for Tuya

Python and python framework

Moderator: leecollings

karlzre
Posts: 26
Joined: Sunday 06 August 2017 18:48
Target OS: -
Domoticz version:
Contact:

Re: [REQUEST] Plugin for Tuya

Post by karlzre »

Hi,

Any idea if we can use the Tuya Smart door sensor ?

Thx
xavierlp
Posts: 70
Joined: Tuesday 01 November 2016 16:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: France
Contact:

Re: [REQUEST] Plugin for Tuya

Post by xavierlp »

deennoo wrote: Wednesday 25 September 2019 9:40
xavierlp wrote:Hello @deennoo

I am using OxaOxe
https://www.amazon.fr/gp/product/B07G2J ... le_o02_s00

I could red your post on github. For my side I don't know how to check the version of tuya.

thanks
You Can get it on Update Check

According to some issue on Tuya-CLI GitHub
FW using >1.1.x use tuya 3.3Image

Envoyé de mon MI 9 en utilisant Tapatalk
Hello deennoo Thanks a lot it's works now
robwal
Posts: 1
Joined: Thursday 26 September 2019 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [REQUEST] Plugin for Tuya

Post by robwal »

Hi! This week I have received a Tuya smart socket with power measurement. I have added the plugin, symbolic links, got the localkey and devid and have added the device to Domoticz. Unfortunately I cannot turn the socket switch on/of and I don't receive any data.

Also the CLI command turnON.py do not give data, just "A problem occur please retry..." I got the localkey and devid through the Burp application.

So...now I'm running in circles to do the same thing over and over, but the result is always the same. Can someone help me to fix this?

Any help is appreciated!

Cheers!!

Domoticz devices log:

243 plug121 000D0001 1 plug121 - Tuya SmartPlug (Switch) Light/Switch Switch Off - - 2019-09-26 12:09:49
244 plug121 000D0002 2 plug121 - Tuya SmartPlug (A) General Current 0 A - - 2019-09-26 12:09:49
245 plug121 000D0003 3 plug121 - Tuya SmartPlug (kWh) General kWh 0.000 kWh - - 2019-09-26 12:09:49
246 plug121 000D0004 4 plug121 - Tuya SmartPlug (V) General Voltage 0 V - - 2019-09-26 12:09:49
247 plug121 000D0005 5 plug121 - Tuya SmartPlug (W) Usage Electric 0 Watt - - 2019-09-26 12:09:49

I have also tried the more basic plugin where only the switch is added to domoticz, it has the same problem .
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: [REQUEST] Plugin for Tuya

Post by deennoo »

tixi7 wrote:I put a new version of the plugin for the plug which should work better.
Let me know for issues.
Please can you help us to integrate pytuya 3.3

I made some test but I don't know where adding self.version=3.3 un the plugin
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Erlz
Posts: 1
Joined: Friday 27 September 2019 0:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [REQUEST] Plugin for Tuya

Post by Erlz »

deennoo wrote: Thursday 26 September 2019 17:37
tixi7 wrote:I put a new version of the plugin for the plug which should work better.
Let me know for issues.
Please can you help us to integrate pytuya 3.3

I made some test but I don't know where adding self.version=3.3 un the plugin
I'm also waiting in anticipation for the version 3.3 :)
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Re: [REQUEST] Plugin for Tuya

Post by FearNaBoinne »

@tixi7: It would be great if it would be possible to select the protocol version in the plugin settings, but you're already using all 6 fields there...
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: [REQUEST] Plugin for Tuya

Post by deennoo »

FearNaBoinne wrote:@tixi7: It would be great if it would be possible to select the protocol version in the plugin settings, but you're already using all 6 fields there...
It's can be easy to remove "group" As we can create a groupe of device in domoticz.

On my side i manage to turn ON my 3.3 plug using the plugin and hardcord "set.version".

But as i can't manage to decode the answer the plugin send again and again turn ON command.

3 solutions can be set :
1st wait about tixi and answer
2 nd learn more about Python and find thé way to modify this plugin
3rd créate à New plugin i found thé source of the home assistant one, this can be reuse for domoticz

About 3rd one, i already made one for à Xiaomi Philips Bulb who use script like TurnON and TurnOFF but as i have only 1 device with a single plug i only can test it for my use.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Re: [REQUEST] Plugin for Tuya

Post by FearNaBoinne »

I'd gladly help test these...
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
xavierlp
Posts: 70
Joined: Tuesday 01 November 2016 16:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: France
Contact:

Re: [REQUEST] Plugin for Tuya

Post by xavierlp »

Hello

Today I can read these warings in the log.
I can still ON/OFF plugs and read KWH.

Code: Select all

2019-09-27 23:28:30.699 Status: Warning: Notification NOT handled (Hardware: 24 - Tuya, ID: , Unit: 3, Type: 00 - Interface Control, SubType: 0 - Unknown), please report on GitHub!
2019-09-27 23:28:30.704 Status: Warning: Notification NOT handled (Hardware: 24 - Tuya, ID: , Unit: 5, Type: 00 - Interface Control, SubType: 0 - Unknown), please report on GitHub!
2019-09-27 23:28:30.711 Status: Warning: Notification NOT handled (Hardware: 24 - Tuya, ID: , Unit: 3, Type: 00 - Interface Control, SubType: 0 - Unknown), please report on GitHub!
2019-09-27 23:28:30.715 Status: Warning: Notification NOT handled (Hardware: 24 - Tuya, ID: , Unit: 5, Type: 00 - Interface Control, SubType: 0 - Unknown), please report on GitHub!
2019-09-27 23:28:30.717 Status: Warning: Notification NOT handled (Hardware: 24 - Tuya, ID: , Unit: 6, Type: 00 - Interface Control, SubType: 0 - Unknown), please report on GitHub!
2019-09-27 23:28:50.808 Status: Warning: Notification NOT handled (Hardware: 24 - Tuya, ID: , Unit: 3, Type: 00 - Interface Control, SubType: 0 - Unknown), please report on GitHub!

Do you know what is it ?
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Re: [REQUEST] Plugin for Tuya

Post by FearNaBoinne »

It means the plugin received a type of feedback it could not decode. As per the error, I'd report it on the Github, just for good measure!
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
xavierlp
Posts: 70
Joined: Tuesday 01 November 2016 16:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: France
Contact:

Re: [REQUEST] Plugin for Tuya

Post by xavierlp »

FearNaBoinne wrote: Friday 27 September 2019 23:56 It means the plugin received a type of feedback it could not decode. As per the error, I'd report it on the Github, just for good measure!
Thanks FearNaBoinne

I do it right now.
florfilla19
Posts: 8
Joined: Friday 18 October 2019 9:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: France
Contact:

Re: [REQUEST] Plugin for Tuya

Post by florfilla19 »

Hello,

I recently buy a Smart RGB LED strip & Smart Ceiling Lamp @ action store.
Working great , I've installed https://github.com/tixi/Domoticz-Tuya-SmartBulb-Plugin on my domoticz rasp pi
Also allready get the device ID of both devices and add them to Domoticz but they are not answering to on/off command

Can someone help me, I think i'm clother to the end.
Also modified __HB_BASE_FREQ = 2 in Domoticz-Tuya-SmartBulb-Plugin/plugin.py with no more luck

Any help would be great

Edit: Also note that the ip adress of my lights under tuya is not my private IP but my public one
Under Domoticz I configured my lights using private IP asuming this is logical and correct..

Also speak in French which is my mother tongue

Code: Select all

 2019-10-18 09:13:19.240 (Smart Ceiling Lamp) c2 97 ab cf 83 cc 36 15 f4 e1 0e 23 c2 63 44 fa 00 00 aa 55 —�σ�6.��.#�cD�..�U
2019-10-18 09:13:19.240 (Smart Ceiling Lamp) Pushing 'onMessageCallback' on to queue
2019-10-18 09:13:19.240 (Smart Ceiling Lamp) Processing 'onMessageCallback' message
2019-10-18 09:13:19.240 (Smart Ceiling Lamp) Calling message handler 'onMessage'.
2019-10-18 09:13:19.240 (Smart Ceiling Lamp) onMessage called: 192.168.1.79:6668 b'\x00\x00U\xaa\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00,\x00\x00\x00\x01X\x14L)\xcf\x04\x84\xc4\x83\xcb\xdf\xd4eMz\x8c\xb5`_\xe4\xc2\x97\xab\xcf\x83\xcc6\x15\xf4\xe1\x0e#\xc2cD\xfa\x00\x00\xaaU'
2019-10-18 09:13:19.241 (Smart Ceiling Lamp) Pushing 'WriteDirective' on to queue
2019-10-18 09:13:19.241 (Smart Ceiling Lamp) Processing 'WriteDirective' message
2019-10-18 09:13:19.241 (Smart Ceiling Lamp) Sending 90 bytes of data
2019-10-18 09:13:19.241 (Smart Ceiling Lamp) 00 00 55 aa 00 00 00 00 00 00 00 0a 00 00 00 4a 7b 22 67 77 ..U�...........J{"gw
2019-10-18 09:13:19.241 (Smart Ceiling Lamp) 49 64 22 3a 22 62 66 38 61 61 39 33 63 63 66 36 62 66 66 35 Id":"bf8aa93ccf6bff5
2019-10-18 09:13:19.242 (Smart Ceiling Lamp) 37 31 36 74 65 35 6f 22 2c 22 64 65 76 49 64 22 3a 22 62 66 716te5o","devId":"bf
2019-10-18 09:13:19.242 (Smart Ceiling Lamp) 38 61 61 39 33 63 63 66 36 62 66 66 35 37 31 36 74 65 35 6f 8aa93ccf6bff5716te5o
2019-10-18 09:13:19.242 (Smart Ceiling Lamp) 22 7d 41 06 99 18 00 00 aa 55 .. .. .. .. .. .. .. .. .. .. "}A.�...�U
2019-10-18 09:13:19.264 (Smart Ceiling Lamp) Pushing 'ReadEvent' on to queue
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) Processing 'ReadEvent' message
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) Received 60 bytes of data
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) 00 00 55 aa 00 00 00 00 00 00 00 0a 00 00 00 2c 00 00 00 01 ..U�...........,....
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) 58 14 4c 29 cf 04 84 c4 83 cb df d4 65 4d 7a 8c b5 60 5f e4 X.L)�.���eMz��`_�
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) c2 97 ab cf 83 cc 36 15 f4 e1 0e 23 c2 63 44 fa 00 00 aa 55 —�σ�6.��.#�cD�..�U
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) Pushing 'onMessageCallback' on to queue
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) Processing 'onMessageCallback' message
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) Calling message handler 'onMessage'.
2019-10-18 09:13:19.292 (Smart Ceiling Lamp) onMessage called: 192.168.1.79:6668 b'\x00\x00U\xaa\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00,\x00\x00\x00\x01X\x14L)\xcf\x04\x84\xc4\x83\xcb\xdf\xd4eMz\x8c\xb5`_\xe4\xc2\x97\xab\xcf\x83\xcc6\x15\xf4\xe1\x0e#\xc2cD\xfa\x00\x00\xaaU'
2019-10-18 09:13:19.293 (Smart Ceiling Lamp) Pushing 'WriteDirective' on to queue
2019-10-18 09:13:19.293 (Smart Ceiling Lamp) Processing 'WriteDirective' message
2019-10-18 09:13:19.293 (Smart Ceiling Lamp) Sending 90 bytes of data
2019-10-18 09:13:19.293 (Smart Ceiling Lamp) 00 00 55 aa 00 00 00 00 00 00 00 0a 00 00 00 4a 7b 22 67 77 ..U�...........J{"gw
2019-10-18 09:13:19.293 (Smart Ceiling Lamp) 49 64 22 3a 22 62 66 38 61 61 39 33 63 63 66 36 62 66 66 35 Id":"bf8aa93ccf6bff5
2019-10-18 09:13:19.293 (Smart Ceiling Lamp) 37 31 36 74 65 35 6f 22 2c 22 64 65 76 49 64 22 3a 22 62 66 716te5o","devId":"bf
2019-10-18 09:13:19.293 (Smart Ceiling Lamp) 38 61 61 39 33 63 63 66 36 62 66 66 35 37 31 36 74 65 35 6f 8aa93ccf6bff5716te5o
2019-10-18 09:13:19.293 (Smart Ceiling Lamp) 22 7d 41 06 99 18 00 00 aa 55 .. .. .. .. .. .. .. .. .. .. "}A.�...�U
2019-10-18 09:13:19.298 (Smart Ceiling Lamp) Pushing 'ReadEvent' on to queue
2019-10-18 09:13:19.343 (Smart Ceiling Lamp) Processing 'ReadEvent' message
2019-10-18 09:13:19.343 (Smart Ceiling Lamp) Received 60 bytes of data
2019-10-18 09:13:19.343 (Smart Ceiling Lamp) 00 00 55 aa 00 00 00 00 00 00 00 0a 00 00 00 2c 00 00 00 01 ..U�...........,....
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) 58 14 4c 29 cf 04 84 c4 83 cb df d4 65 4d 7a 8c b5 60 5f e4 X.L)�.���eMz��`_�
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) c2 97 ab cf 83 cc 36 15 f4 e1 0e 23 c2 63 44 fa 00 00 aa 55 —�σ�6.��.#�cD�..�U
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) Pushing 'onMessageCallback' on to queue
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) Processing 'onMessageCallback' message
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) Calling message handler 'onMessage'.
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) onMessage called: 192.168.1.79:6668 b'\x00\x00U\xaa\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00,\x00\x00\x00\x01X\x14L)\xcf\x04\x84\xc4\x83\xcb\xdf\xd4eMz\x8c\xb5`_\xe4\xc2\x97\xab\xcf\x83\xcc6\x15\xf4\xe1\x0e#\xc2cD\xfa\x00\x00\xaaU'
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) Pushing 'WriteDirective' on to queue
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) Processing 'WriteDirective' message
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) Sending 90 bytes of data
2019-10-18 09:13:19.344 (Smart Ceiling Lamp) 00 00 55 aa 00 00 00 00 00 00 00 0a 00 00 00 4a 7b 22 67 77 ..U�...........J{"gw
2019-10-18 09:13:19.345 (Smart Ceiling Lamp) 49 64 22 3a 22 62 66 38 61 61 39 33 63 63 66 36 62 66 66 35 Id":"bf8aa93ccf6bff5
2019-10-18 09:13:19.345 (Smart Ceiling Lamp) 37 31 36 74 65 35 6f 22 2c 22 64 65 76 49 64 22 3a 22 62 66 716te5o","devId":"bf
2019-10-18 09:13:19.345 (Smart Ceiling Lamp) 38 61 61 39 33 63 63 66 36 62 66 66 35 37 31 36 74 65 35 6f 8aa93ccf6bff5716te5o
2019-10-18 09:13:19.345 (Smart Ceiling Lamp) 22 7d 41 06 99 18 00 00 aa 55 .. .. .. .. .. .. .. .. .. .. "}A.�...�U
Image
Image
mosjonathan
Posts: 40
Joined: Friday 24 February 2017 21:20
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: [REQUEST] Plugin for Tuya

Post by mosjonathan »

@deennoo

can you share what you've done to make the plugin work with protocol 3.3?

Thanks jonathan
tgunator
Posts: 3
Joined: Monday 18 November 2019 16:04
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: [REQUEST] Plugin for Tuya

Post by tgunator »

Hi,

Thanks for the plugin. I've these smartbulbs https://www.amazon.es/gp/product/B07S4D ... =UTF8&th=1. I've installed the plugin correctly on my Synology but nothing happens when I use the dimmer, and there are no errors in the log.
I suppose to have protocol 3.3, because the firmware of the bulbs is 1.4.0. Any advance on the project?
Thanks in advance
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: [REQUEST] Plugin for Tuya

Post by robgeerts »

I finally got everything working in Domoticz, i had to set the plugin to 3.3
I have 13 GU10-spots (from Action (LSC)) installed in Domoticz. However, sometimes some of them randomly blink 1 time. I have set them to a white color but it randomly goes to a color for less then a second and then back to white. Sometimes a few times in a row, sometimes 1 time in 10 minutes... Anyone know how this can happen?

FYI: I have 13x GU10, 4 time a filament bulb.
From: https://www.action.com/nl-nl/brand/lsc-smart-connect/

Also, the plugin thinks the filament are RGBW, can i change this in domoticz?
Or does this need a separate plugin?
focalista
Posts: 1
Joined: Wednesday 20 November 2019 19:52
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: [REQUEST] Plugin for Tuya

Post by focalista »

xavierlp wrote: Friday 27 September 2019 23:59
FearNaBoinne wrote: Friday 27 September 2019 23:56 It means the plugin received a type of feedback it could not decode. As per the error, I'd report it on the Github, just for good measure!
Thanks FearNaBoinne

I do it right now.
Hello Xavier,
I'm writing here because I have the same plugs as you... They are running quite well but I'm experiencing something special...
When I have look at the logs of each of the plugs in the SWITCHES TAB :
- I've got one showing normal operations... for example :
2019-11-19 09:30:04 Off
2019-11-19 09:20:06 On
2019-11-19 08:55:47 Off
2019-11-19 08:45:54 On
2019-11-19 08:43:56 Off
2019-11-19 08:34:01 On

- And the other one is showing nonsense >> a nonsense that is generating 62106 entries : each 20 seconds, the plug show Off then On at the same time....
2019-11-20 20:03:32 On
2019-11-20 20:03:32 Off
2019-11-20 20:03:12 On
2019-11-20 20:03:12 Off
2019-11-20 20:02:52 On
2019-11-20 20:02:52 Off
2019-11-20 20:02:32 On
2019-11-20 20:02:32 Off

Do you have the same thing happening ?

Thanks for your answer
tgunator
Posts: 3
Joined: Monday 18 November 2019 16:04
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: [REQUEST] Plugin for Tuya

Post by tgunator »

robgeerts wrote: Wednesday 20 November 2019 13:36 I finally got everything working in Domoticz, i had to set the plugin to 3.3
I have 13 GU10-spots (from Action (LSC)) installed in Domoticz. However, sometimes some of them randomly blink 1 time. I have set them to a white color but it randomly goes to a color for less then a second and then back to white. Sometimes a few times in a row, sometimes 1 time in 10 minutes... Anyone know how this can happen?

FYI: I have 13x GU10, 4 time a filament bulb.
From: https://www.action.com/nl-nl/brand/lsc-smart-connect/

Also, the plugin thinks the filament are RGBW, can i change this in domoticz?
Or does this need a separate plugin?
"i had to set the plugin to 3.3". How do you do that?
Thanks in advance
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: [REQUEST] Plugin for Tuya

Post by robgeerts »

I changed it in the plugin itself...
Editted the code, changed 3.1 to 3.3, saved and restarted the raspberry.
BdBteS
Posts: 1
Joined: Tuesday 24 December 2019 13:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Rotterdam
Contact:

Re: [REQUEST] Plugin for Tuya

Post by BdBteS »

I want to change the plugin just like everybody says, but i dont see the get_dps.py file.
How can i fix this?
I reinstalled everything and still nothing
Gabrie
Posts: 1
Joined: Saturday 04 January 2020 8:42
Target OS: Linux
Domoticz version:
Contact:

Re: [REQUEST] Plugin for Tuya

Post by Gabrie »

deennoo wrote: Friday 27 September 2019 19:42
FearNaBoinne wrote:@tixi7: It would be great if it would be possible to select the protocol version in the plugin settings, but you're already using all 6 fields there...
It's can be easy to remove "group" As we can create a groupe of device in domoticz.

On my side i manage to turn ON my 3.3 plug using the plugin and hardcord "set.version".
What exact file did you change in which to set the "set.version" option?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest