Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Python and python framework

Moderator: leecollings

ronalddevos
Posts: 24
Joined: Thursday 30 March 2017 16:13
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by ronalddevos »

ronalddevos wrote: Saturday 27 September 2025 19:02
Xenomes wrote: Saturday 27 September 2025 16:31
ronalddevos wrote: Saturday 27 September 2025 16:16 but is still seems to work
Can you set de debug to python, and report the data in the error lines.
ronalddevos wrote: Saturday 27 September 2025 16:16 Response time seems slower though (not an issue)
Should be faster, no 15 min wait until status change.
Is that the debug in the plugin config page?
This is what I could capture. After that things freeze. Hope this helps.
Attachments
TuyaErrorLog.txt
(4.25 KiB) Downloaded 7 times
User avatar
Xenomes
Posts: 448
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

ronalddevos wrote: Saturday 27 September 2025 20:22 This is what I could capture. After that things freeze. Hope this helps.
Could it be possible that the subscription has been expired?
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.3 LTS (64Bit) - Domoticz 2025.2 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
ronalddevos
Posts: 24
Joined: Thursday 30 March 2017 16:13
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by ronalddevos »

Xenomes wrote: Sunday 28 September 2025 19:07
ronalddevos wrote: Saturday 27 September 2025 20:22 This is what I could capture. After that things freeze. Hope this helps.
Could it be possible that the subscription has been expired?
Considered that and checked and even renewed.
I have monitored the last 24 hours and it has been running without problem except three times the
"Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217"
1 time yesteday afternoon, 2 times this night, timing is not consistent but seems random
Still have not figured out the whens and whys...
Could it be something at the Tuya end?
User avatar
Xenomes
Posts: 448
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

ronalddevos wrote: Monday 29 September 2025 8:17 I have monitored the last 24 hours and it has been running without problem except three times the
"Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217"
1 time yesteday afternoon, 2 times this night, timing is not consistent but seems random
I added an extra error line to pinpoint the exact source of the problem.
To update, switch to the Master branch, pull and then switch back to pulsar, and finally reload the plugin.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.3 LTS (64Bit) - Domoticz 2025.2 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
ronalddevos
Posts: 24
Joined: Thursday 30 March 2017 16:13
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by ronalddevos »

Xenomes wrote: Monday 29 September 2025 21:31
ronalddevos wrote: Monday 29 September 2025 8:17 I have monitored the last 24 hours and it has been running without problem except three times the
"Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217"
1 time yesteday afternoon, 2 times this night, timing is not consistent but seems random
I added an extra error line to pinpoint the exact source of the problem.
To update, switch to the Master branch, pull and then switch back to pulsar, and finally reload the plugin.
Done & Thanks!
I will monitor
For now the initial error is gone, just irregularly getting the "Credentials are incorrect or tuya subscription has expired! line 1217"
ronalddevos
Posts: 24
Joined: Thursday 30 March 2017 16:13
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by ronalddevos »

ronalddevos wrote: Tuesday 30 September 2025 8:40
Xenomes wrote: Monday 29 September 2025 21:31
ronalddevos wrote: Monday 29 September 2025 8:17 I have monitored the last 24 hours and it has been running without problem except three times the
"Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217"
1 time yesteday afternoon, 2 times this night, timing is not consistent but seems random
I added an extra error line to pinpoint the exact source of the problem.
To update, switch to the Master branch, pull and then switch back to pulsar, and finally reload the plugin.
Done & Thanks!
I will monitor
For now the initial error is gone, just irregularly getting the "Credentials are incorrect or tuya subscription has expired! line 1217"
OK -got this with Pythob debug on:
2025-09-30 11:43:45.552 Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217
2025-09-30 11:43:45.657 TinyTuya: onHeartbeat called
2025-09-30 11:43:45.657 TinyTuya: onHeartbeat called last run: 24.174337148666382
2025-09-30 11:43:45.658 TinyTuya: Running Pulsar
2025-09-30 11:43:45.658 TinyTuya: Device name=ProxMox BU Server id=8106400140f520059c3c category=switch
ronalddevos
Posts: 24
Joined: Thursday 30 March 2017 16:13
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by ronalddevos »

ronalddevos wrote: Tuesday 30 September 2025 11:45
ronalddevos wrote: Tuesday 30 September 2025 8:40
Xenomes wrote: Monday 29 September 2025 21:31
I added an extra error line to pinpoint the exact source of the problem.
To update, switch to the Master branch, pull and then switch back to pulsar, and finally reload the plugin.
Done & Thanks!
I will monitor
For now the initial error is gone, just irregularly getting the "Credentials are incorrect or tuya subscription has expired! line 1217"
OK -got this with Pythob debug on:
2025-09-30 11:43:45.552 Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217
2025-09-30 11:43:45.657 TinyTuya: onHeartbeat called
2025-09-30 11:43:45.657 TinyTuya: onHeartbeat called last run: 24.174337148666382
2025-09-30 11:43:45.658 TinyTuya: Running Pulsar
2025-09-30 11:43:45.658 TinyTuya: Device name=ProxMox BU Server id=8106400140f520059c3c category=switch
Managed to trap the whole sequence.
Attachments
TuyaErrors-30-09-25.txt
(4.42 KiB) Downloaded 4 times
ronalddevos
Posts: 24
Joined: Thursday 30 March 2017 16:13
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by ronalddevos »

ronalddevos wrote: Tuesday 30 September 2025 13:26
ronalddevos wrote: Tuesday 30 September 2025 11:45
ronalddevos wrote: Tuesday 30 September 2025 8:40

Done & Thanks!
I will monitor
For now the initial error is gone, just irregularly getting the "Credentials are incorrect or tuya subscription has expired! line 1217"
OK -got this with Pythob debug on:
2025-09-30 11:43:45.552 Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217
2025-09-30 11:43:45.657 TinyTuya: onHeartbeat called
2025-09-30 11:43:45.657 TinyTuya: onHeartbeat called last run: 24.174337148666382
2025-09-30 11:43:45.658 TinyTuya: Running Pulsar
2025-09-30 11:43:45.658 TinyTuya: Device name=ProxMox BU Server id=8106400140f520059c3c category=switch
Managed to trap the whole sequence.
Also getting:
2025-09-30 19:09:14.589 TinyTuya: onCommand called for Device bf58f96d002fcb03beswmt Unit 1: Parameter 'On', Level: 0', Color:
2025-09-30 19:09:14.590 TinyTuya: Device ID: bf58f96d002fcb03beswmt
2025-09-30 19:09:14.590 TinyTuya: nValue: 0
2025-09-30 19:09:14.590 TinyTuya: sValue: False Type <class 'str'>
2025-09-30 19:09:14.591 TinyTuya: LastLevel: 0
2025-09-30 19:09:14.670 TinyTuya: onHeartbeat called
2025-09-30 19:09:14.670 TinyTuya: onHeartbeat called last run: 63.13947010040283
2025-09-30 19:09:14.671 TinyTuya: Running Pulsar
Does this give a clue?
User avatar
Xenomes
Posts: 448
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

ronalddevos wrote: Tuesday 30 September 2025 13:26 Managed to trap the whole sequence.
I see something in the log, You have tinytuya module 1.7.3, 1.7.4 is the latest.

ronalddevos wrote: Tuesday 30 September 2025 19:11 Also getting:
2025-09-30 19:09:14.589 TinyTuya: onCommand called for Device bf58f96d002fcb03beswmt Unit 1: Parameter 'On', Level: 0', Color:
2025-09-30 19:09:14.590 TinyTuya: Device ID: bf58f96d002fcb03beswmt
2025-09-30 19:09:14.590 TinyTuya: nValue: 0
2025-09-30 19:09:14.590 TinyTuya: sValue: False Type <class 'str'>
2025-09-30 19:09:14.591 TinyTuya: LastLevel: 0
2025-09-30 19:09:14.670 TinyTuya: onHeartbeat called
2025-09-30 19:09:14.670 TinyTuya: onHeartbeat called last run: 63.13947010040283
2025-09-30 19:09:14.671 TinyTuya: Running Pulsar
Does this give a clue?
This looks like a control issue. is bf58f96d002fcb03beswmt a light?
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.3 LTS (64Bit) - Domoticz 2025.2 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
ronalddevos
Posts: 24
Joined: Thursday 30 March 2017 16:13
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by ronalddevos »

Xenomes wrote: Tuesday 30 September 2025 20:03
ronalddevos wrote: Tuesday 30 September 2025 13:26 Managed to trap the whole sequence.
I see something in the log, You have tinytuya module 1.7.3, 1.7.4 is the latest.

ronalddevos wrote: Tuesday 30 September 2025 19:11 Also getting:
2025-09-30 19:09:14.589 TinyTuya: onCommand called for Device bf58f96d002fcb03beswmt Unit 1: Parameter 'On', Level: 0', Color:
2025-09-30 19:09:14.590 TinyTuya: Device ID: bf58f96d002fcb03beswmt
2025-09-30 19:09:14.590 TinyTuya: nValue: 0
2025-09-30 19:09:14.590 TinyTuya: sValue: False Type <class 'str'>
2025-09-30 19:09:14.591 TinyTuya: LastLevel: 0
2025-09-30 19:09:14.670 TinyTuya: onHeartbeat called
2025-09-30 19:09:14.670 TinyTuya: onHeartbeat called last run: 63.13947010040283
2025-09-30 19:09:14.671 TinyTuya: Running Pulsar
Does this give a clue?
This looks like a control issue. is bf58f96d002fcb03beswmt a light?
bf58f96d002fcb03beswmt is a smart plug (controlling a light)
I'll re-upgrade to 1.7.4
Other then the "False Type" no errors in the 14 hours...
User avatar
Xenomes
Posts: 448
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

ronalddevos wrote: Wednesday 01 October 2025 8:15 bf58f96d002fcb03beswmt is a smart plug (controlling a light)
Thanks, I will check the code why there is a error.
ronalddevos wrote: Wednesday 01 October 2025 8:15 I'll re-upgrade to 1.7.4
Other then the "False Type" no errors in the 14 hours...
Nice! 1.7.4 had cloud updates.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.3 LTS (64Bit) - Domoticz 2025.2 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
TroisSix
Posts: 93
Joined: Monday 11 January 2016 9:29
Target OS: Linux
Domoticz version: 2025.2
Location: France
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by TroisSix »

Hi Xenomes,
I am using your plugin for a while now, it was working perfectly with a lot of different plugs (multiplugs, simple plugs, ...)
But then I bought a new multi-plugs "4 plugs + usb", it is being recognized by your plugin after a de-activation and re-activation of the plugin TinyTuya, so good.

The weird thing is that when I switch on/off whatever plug of my new multi-plugs in Domoticz, it does nothing in real :(
But when I switch on/off the plugs in the application SmartLife, the plugin refreshes the values correctly in Domoticz after the polling of course, not immediatly.
So it only works one way for this new multi-plugs.
I activated the debug option of the plugin but it doesn't say anything more.
The others multi-plugs work perfectly the two ways (from domoticz or from SmartLife)

I have the version 2.3.2 of the plugin, on Domoticz 2025.2, on a VM Debian 12.
Do you have any suggestions?

Thank you for your support ;)
VM Debian - Domoticz stable v2025.2, RFXtrx433, Aeotec Z-Stick Gen5, Zigbee, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- philips hue, Pilot app.
User avatar
Xenomes
Posts: 448
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

TroisSix wrote: Tuesday 11 November 2025 19:04 Hi Xenomes,
I am using your plugin for a while now, it was working perfectly with a lot of different plugs (multiplugs, simple plugs, ...)
But then I bought a new multi-plugs "4 plugs + usb", it is being recognized by your plugin after a de-activation and re-activation of the plugin TinyTuya, so good.

The weird thing is that when I switch on/off whatever plug of my new multi-plugs in Domoticz, it does nothing in real :(
But when I switch on/off the plugs in the application SmartLife, the plugin refreshes the values correctly in Domoticz after the polling of course, not immediatly.
So it only works one way for this new multi-plugs.
I activated the debug option of the plugin but it doesn't say anything more.
The others multi-plugs work perfectly the two ways (from domoticz or from SmartLife)

I have the version 2.3.2 of the plugin, on Domoticz 2025.2, on a VM Debian 12.
Do you have any suggestions?

Thank you for your support ;)
Make a issue on github, than we can investigate whats wrong.
https://github.com/Xenomes/Domoticz-Tin ... gin/issues
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.3 LTS (64Bit) - Domoticz 2025.2 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
l81occitarn
Posts: 1
Joined: Wednesday 19 November 2025 8:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by l81occitarn »

Hi !

Thank you for the job, i use your plugin to read/log the data from my weather station, and it works well for my indoor sensor (principal sensor).
It's a multi-channel weather station, and the others sensors (outdoor sensor, pool sensor) aren't displayed in domoticz.

Is it possible to manage multiple channels in order to display the others sensor data ?

I use the plugin in version 2.3.2.

Thanks for your reply
User avatar
Xenomes
Posts: 448
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

l81occitarn wrote: Wednesday 19 November 2025 8:25 Hi !

Thank you for the job, i use your plugin to read/log the data from my weather station, and it works well for my indoor sensor (principal sensor).
It's a multi-channel weather station, and the others sensors (outdoor sensor, pool sensor) aren't displayed in domoticz.

Is it possible to manage multiple channels in order to display the others sensor data ?

I use the plugin in version 2.3.2.

Thanks for your reply
Make a issue on github, than we can add the support. Please run the discovery_debug.py and add the dump.json to the issue.
https://github.com/Xenomes/Domoticz-Tin ... gin/issues
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.3 LTS (64Bit) - Domoticz 2025.2 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
l81occitarn
Posts: 1
Joined: Wednesday 19 November 2025 8:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by l81occitarn »

Xenomes wrote: Wednesday 19 November 2025 22:14
l81occitarn wrote: Wednesday 19 November 2025 8:25 Hi !

Thank you for the job, i use your plugin to read/log the data from my weather station, and it works well for my indoor sensor (principal sensor).
It's a multi-channel weather station, and the others sensors (outdoor sensor, pool sensor) aren't displayed in domoticz.

Is it possible to manage multiple channels in order to display the others sensor data ?

I use the plugin in version 2.3.2.

Thanks for your reply
Make a issue on github, than we can add the support. Please run the discovery_debug.py and add the dump.json to the issue.
https://github.com/Xenomes/Domoticz-Tin ... gin/issues
There is the result of the debug_discovery.py :
Image

What's the problem ?
My configuration seems OK in the plugin config :
Image

And the sensor appears in the temp tab :
Image
Last edited by l81occitarn on Saturday 22 November 2025 12:13, edited 1 time in total.
User avatar
Xenomes
Posts: 448
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

l81occitarn wrote: Saturday 22 November 2025 12:12 What's the problem ?
The script runs standalone. Edit the file and fill in the values and run again.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.3 LTS (64Bit) - Domoticz 2025.2 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
jmd33
Posts: 3
Joined: Sunday 14 December 2025 15:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Bordeaux
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by jmd33 »

Hi !

I just start a Raspberry Pi3B Trixie with domoticz 2025.2 and try to install tinytuya.
First, I follow instructions for tuya devices (jasonacox) and it works (outside of domoticz, with python, I can switch my plug on/off)
Then I try to install Domoticz-TinyTUYA-Plugin with sudo pip3 install requests==2.23.0 charset-normalizer==3.0.1 tinytuya -U --break-system-packages but I have an error :
Attempting uninstall: charset-normalizer
Found existing installation: charset-normalizer 3.4.2
error: uninstall-no-record-file
Cannot uninstall charset-normalizer 3.4.2

and when I start domticzs with hardware tinytuya (named Konyks) I have an error message in the log :
Error: Konyks: handleThread: name 'requests' is not defined line 1028

It seems there is some missing module (requests) : is there an incompatibility between Trixie and tinytuya or domoticz 2025.2 ?

thanks
Last edited by jmd33 on Sunday 14 December 2025 16:14, edited 1 time in total.
Raspberry Pi3B - PiOS Trixie - Domoticz 2025-2
User avatar
Xenomes
Posts: 448
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

jmd33 wrote: Sunday 14 December 2025 16:11 It seems there is some missing module (requests) : is there an incompatibility between Trixie and tinytuya or domoticz 2025.2 ?
Hi, Its possible that Trixie python 3.13 can't downgrade the module. I didn't test it yet.

Try:

Code: Select all

sudo pip3 install requests charset-normalizer tinytuya -U --break-system-packages
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.3 LTS (64Bit) - Domoticz 2025.2 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
jmd33
Posts: 3
Joined: Sunday 14 December 2025 15:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Bordeaux
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by jmd33 »

Thanks,

but same error.

so what would be a good configuration for tinytuya :
domoticz 2025.2 and PiOS bookworm ?
Raspberry Pi3B - PiOS Trixie - Domoticz 2025-2
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest