Python Plugin: TUYA

Python and python framework

Moderator: leecollings

manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: TUYA

Post by manjh »

OK, after a little patience, the lamp came in as WW! Success!
Now all I have to do is re-install the other lamps. Which is more work than you'd expect, since they disappear from all scenes when deleted....
Is there a way to reset without deleting them?
Hans
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: TUYA

Post by EdwinK »

I just noticed this appearing again, about every second.

2021-04-02 10:24:56.251 Error: Tuya: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 198
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: TUYA

Post by Vomera »

Xenomes wrote: Thursday 01 April 2021 21:02
Vomera wrote: Wednesday 31 March 2021 22:42 Where else should it be ? :)
The second tuyaha is not needed with my version of the plug-in. I was mislead with the naming of the directory. You are using the version of guino in that version is has limited control of RGB. Can you try my version of the plug[in. https://github.com/Xenomes/Domoticz-TUYA-Plugin.
Okay tried again with your script :D
Version 1.0.6 is installed.

Image

Image

Image

He sees the rgb strip as a switch and there is no RGB control
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

Vomera wrote: Friday 02 April 2021 12:10
Xenomes wrote: Thursday 01 April 2021 21:02
Vomera wrote: Wednesday 31 March 2021 22:42 Where else should it be ? :)
The second tuyaha is not needed with my version of the plug-in. I was mislead with the naming of the directory. You are using the version of guino in that version is has limited control of RGB. Can you try my version of the plug[in. https://github.com/Xenomes/Domoticz-TUYA-Plugin.
Okay tried again with your script :D
Version 1.0.6 is installed.

Image

Image

Image

He sees the rgb strip as a switch and there is no RGB control
I pushed a new update, remove faulty device => update plug-in => update button in Hardware at Tuya plug-in.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

EdwinK wrote: Friday 02 April 2021 10:26 I just noticed this appearing again, about every second.

2021-04-02 10:24:56.251 Error: Tuya: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 198
I don't ever seen it, try stop the plug-in, wait for minimal 61 seconds and start plug-in.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

manjh wrote: Friday 02 April 2021 10:16 OK, after a little patience, the lamp came in as WW! Success!
Now all I have to do is re-install the other lamps. Which is more work than you'd expect, since they disappear from all scenes when deleted....
Is there a way to reset without deleting them?
You can change the type/sub type directly in the database 😅 1000% you own risk.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

manjh wrote: Friday 02 April 2021 10:10
Xenomes wrote: Thursday 01 April 2021 22:06
manjh wrote: Thursday 01 April 2021 21:37 V.1.0.4
That is not the latest version ... Delete devices and update the plug-in, restart Domoticz and see the new detection.

Edit: Just push a new version
(⚠ RGBW(W) lights must be on a colour for correct detection ⚠)
OK, now getting version 6.
Deleted one lamp, disabled/enabled Tuya, now get this error in the log:

Code: Select all

Error: (Tuya devices) handleThread: Expecting value: line 1 column 1 (char 0) line 198
Also:

Code: Select all

Error: (Tuya devices) handleThread: login rate limited line 195
Try stop the plug-in, wait for minimal 61 seconds and start plug-in again.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: TUYA

Post by Vomera »

Xenomes wrote: Friday 02 April 2021 12:28
Vomera wrote: Friday 02 April 2021 12:10
Xenomes wrote: Thursday 01 April 2021 21:02
The second tuyaha is not needed with my version of the plug-in. I was mislead with the naming of the directory. You are using the version of guino in that version is has limited control of RGB. Can you try my version of the plug[in. https://github.com/Xenomes/Domoticz-TUYA-Plugin.
Okay tried again with your script :D
Version 1.0.6 is installed.

Image

Image

Image

He sees the rgb strip as a switch and there is no RGB control
I pushed a new update, remove faulty device => update plug-in => update button in Hardware at Tuya plug-in.
Getting also the same error after updating your script, now in domoticz he sees the ledstrip as RGB

Image

Code: Select all

021-04-02 13:20:46.573 Error: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 198

Image
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

Vomera wrote: Friday 02 April 2021 13:22

Code: Select all

021-04-02 13:20:46.573 Error: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 198
Execute this and return the cli results

Code: Select all

sudo pip3 install tuyaha
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: TUYA

Post by Vomera »

Xenomes wrote: Friday 02 April 2021 15:02
Vomera wrote: Friday 02 April 2021 13:22

Code: Select all

021-04-02 13:20:46.573 Error: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 198
Execute this and return the cli results

Code: Select all

sudo pip3 install tuyaha
With Sudo command he said its already installed. So i tried to use the command pip3 install tuyaha. Tuya installed, maybe in the user account instead with admin account. In hardware tab update and after that it worked!!!!!. Finally!! Thank you so much!
Image
Last edited by Vomera on Friday 02 April 2021 21:26, edited 2 times in total.
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: TUYA

Post by Vomera »

EdwinK wrote: Friday 02 April 2021 10:26 I just noticed this appearing again, about every second.

2021-04-02 10:24:56.251 Error: Tuya: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 198
You can see if the answer above this post will help
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

Vomera wrote: Friday 02 April 2021 21:20
Xenomes wrote: Friday 02 April 2021 15:02
Vomera wrote: Friday 02 April 2021 13:22

Code: Select all

021-04-02 13:20:46.573 Error: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 198
Execute this and return the cli results

Code: Select all

sudo pip3 install tuyaha
Met sudo commando gaf hij al aan geinstalleerd te zijn. Daarna commando pip3 install tuyaha uitgevoerd en werd de tuya geinstalleerd waarschijnlijk user account. In hardware tab update uitgevoerd en daarna DEED HIJ HET!!!!. Eindelijk opgelost!! Dank je wel! Samen komen we er wel haha.
Image
OK greet news! every system has his quirks.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: TUYA

Post by manjh »

Xenomes wrote: Friday 02 April 2021 12:31
manjh wrote: Friday 02 April 2021 10:16 OK, after a little patience, the lamp came in as WW! Success!
Now all I have to do is re-install the other lamps. Which is more work than you'd expect, since they disappear from all scenes when deleted....
Is there a way to reset without deleting them?
You can change the type/sub type directly in the database 😅 1000% you own risk.
Ah. Risky, but exciting... is there a recommended tool to do this?
Hans
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

manjh wrote: Saturday 03 April 2021 10:02 Ah. Risky, but exciting... is there a recommended tool to do this?
Best is by hand, this is a bit off-topic, you have to install sqllite3.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: TUYA

Post by manjh »

Xenomes wrote: Saturday 03 April 2021 10:13
manjh wrote: Saturday 03 April 2021 10:02 Ah. Risky, but exciting... is there a recommended tool to do this?
Best is by hand, this is a bit off-topic, you have to install sqllite3.
OK, understand. I guess simply deleting and adding the lamps may be easier....
Hans
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

manjh wrote: Saturday 03 April 2021 10:58
Xenomes wrote: Saturday 03 April 2021 10:13
manjh wrote: Saturday 03 April 2021 10:02 Ah. Risky, but exciting... is there a recommended tool to do this?
Best is by hand, this is a bit off-topic, you have to install sqllite3.
OK, understand. I guess simply deleting and adding the lamps may be easier....
U need to know how sql query works. select and update commands
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: TUYA

Post by manjh »

Xenomes wrote: Saturday 03 April 2021 11:02
manjh wrote: Saturday 03 April 2021 10:58
Xenomes wrote: Saturday 03 April 2021 10:13
Best is by hand, this is a bit off-topic, you have to install sqllite3.
OK, understand. I guess simply deleting and adding the lamps may be easier....
U need to know how sql query works. select and update commands
I do, but the mere job of having to install SQL just for this small thing seems a bit over the top.
I've now deleted and re-installed the lamps, this was very simple.
Reviewing all scene settings was a bit more work, but also got it done.
All lamps are now recognized as WW. Thanks for the support!
Hans
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: TUYA

Post by manjh »

One additional thought, perhaps a suggestion for the user interface.
Setting the right color from the color wheel is nice, but it is difficult to get multiple lamps on the same color level.
For the dimmer it can be done by simply moving the slider until the percentage is close enough.
But for color there is no numerical reference>
Would it be possible to add an input field, so that the user can choose to either select from the color wheel, or enter a value in the input field?
Hans
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: TUYA

Post by manjh »

Now that the lamps are working, I am thinking about the next step: getting rid of the Tuya cloud dependency.
I ran into Tasmota, that seems promising.
Also found a procedure for flashing:
https://www.heise.de/ct/artikel/Tuya-Co ... 84830.html
Before I start playing around, possibly losing a perfectly good lamp, has anyone done this before? Any experience? Recommendations?
Hans
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: TUYA

Post by Xenomes »

manjh wrote: Saturday 03 April 2021 11:20 Would it be possible to add an input field, so that the user can choose to either select from the color wheel, or enter a value in the input field?
The colour wheel is default function of Domotixz, request for a input field you need be at the developer of Domoticz.
manjh wrote: Saturday 03 April 2021 14:12 Before I start playing around, possibly losing a perfectly good lamp, has anyone done this before? Any experience? Recommendations?
Tuya-Convert only works with bulbs with a esp chip and older firmware version. Lots of new devices firmware upload hack don't work any more. You can't convert back to the original firmware without open and destroy the bulb. If the bulb accepts the Tasmota firmware then a new world of opportunities opens.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests