Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Python and python framework

Moderator: leecollings

84dasilva
Posts: 12
Joined: Monday 12 February 2024 17:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by 84dasilva »

Xenomes wrote: Thursday 11 September 2025 21:19
waltervl wrote: Thursday 11 September 2025 21:16 @Xenomes: for the dehumify setting perhaps use the new setpoint device (based on thermostat) where you can configure min- ,max value, step size etc
Thanks, I didn't try that, I'll check it out.
Edit: Changed the device to the new thermostat with a water image and a humidity symbol.
Thanks! Its now working, great!

In case you get bored :mrgreen: , perhaps these could also be added.

countdown_set;
filter_reset;
filter_life;
runtime_total_reset;
type_of_equipment; suspect to be the total runtime counter.
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 »

84dasilva wrote: Friday 12 September 2025 21:12 Thanks! Its now working, great!

In case you get bored :mrgreen: , perhaps these could also be added.

countdown_set;
filter_reset;
filter_life;
runtime_total_reset;
type_of_equipment; suspect to be the total runtime counter.
Good to hear!

Never bored with home automation in place. :lol:
countdown_set; not needed; you can control it with the Domoticz Timer.
filter_reset;
filter_life;
runtime_total_reset;
type_of_equipment;
These four are added.
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
84dasilva
Posts: 12
Joined: Monday 12 February 2024 17:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by 84dasilva »

Xenomes wrote: Saturday 13 September 2025 11:24 Never bored with home automation in place. :lol:
countdown_set; not needed; you can control it with the Domoticz Timer.
filter_reset;
filter_life;
runtime_total_reset;
type_of_equipment;
These four are added.
Great! Enjoy the coffees! :mrgreen:
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 »

Love this plugin! Has been running flawlesly for a while. Just updated to 2.2.8e with TinyTuyaVersion:1.17.4 and now have a problem.
It runs OK for a while and after about 10 minutes I get the following error:

Error: TinyTuya: onCommand ERROR: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/iot-03/devices/bf58f96d002fcb03beswmt/commands (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x071A9418>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

and

Error: TinyTuya hardware (16) thread seems to have ended unexpectedly

and the plugin is unresponsive. I am at a loss... Any suggestions?
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: Sunday 21 September 2025 10:37 Love this plugin! Has been running flawlesly for a while. Just updated to 2.2.8e with TinyTuyaVersion:1.17.4 and now have a problem.
It runs OK for a while and after about 10 minutes I get the following error:

Error: TinyTuya: onCommand ERROR: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/iot-03/devices/bf58f96d002fcb03beswmt/commands (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x071A9418>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

and

Error: TinyTuya hardware (16) thread seems to have ended unexpectedly

and the plugin is unresponsive. I am at a loss... Any suggestions?
Looks like there is a issue with TinyTuya version:1.17.4 you can try to downgrade the version.

Code: Select all

sudo pip install tinytuya==1.17.3
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 21 September 2025 19:59
ronalddevos wrote: Sunday 21 September 2025 10:37 Love this plugin! Has been running flawlesly for a while. Just updated to 2.2.8e with TinyTuyaVersion:1.17.4 and now have a problem.
It runs OK for a while and after about 10 minutes I get the following error:

Error: TinyTuya: onCommand ERROR: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/iot-03/devices/bf58f96d002fcb03beswmt/commands (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x071A9418>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

and

Error: TinyTuya hardware (16) thread seems to have ended unexpectedly

and the plugin is unresponsive. I am at a loss... Any suggestions?
Looks like there is a issue with TinyTuya version:1.17.4 you can try to downgrade the version.

Code: Select all

sudo pip install tinytuya==1.17.3
Thanks! - done, i will monitor the result and report back.
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: Monday 22 September 2025 8:48
Xenomes wrote: Sunday 21 September 2025 19:59
ronalddevos wrote: Sunday 21 September 2025 10:37 Love this plugin! Has been running flawlesly for a while. Just updated to 2.2.8e with TinyTuyaVersion:1.17.4 and now have a problem.
It runs OK for a while and after about 10 minutes I get the following error:

Error: TinyTuya: onCommand ERROR: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/iot-03/devices/bf58f96d002fcb03beswmt/commands (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x071A9418>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

and

Error: TinyTuya hardware (16) thread seems to have ended unexpectedly

and the plugin is unresponsive. I am at a loss... Any suggestions?
Looks like there is a issue with TinyTuya version:1.17.4 you can try to downgrade the version.

Code: Select all

sudo pip install tinytuya==1.17.3
Thanks! - done, i will monitor the result and report back.
It has been working flawlesly for hours (i have been flicking switches) then on flicking a switch I get:

Error: TinyTuya: onCommand ERROR: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/iot-03/devices/bf58f96d002fcb03beswmt/commands (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x040996E8>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

Error: TinyTuya hardware (16) thread seems to have ended unexpectedly

I restarted the plugin, eberything freezes for some 30 seconds and I get:

2025-09-22 16:36:52.310 Error: TinyTuya: Devices dictionary null or not valid in 'FindDevice'.
2025-09-22 16:36:52.311 Error: TinyTuya: Devices dictionary null or not valid in 'FindDevice'.
2025-09-22 16:36:52.311 Error: TinyTuya: Call to function 'onCommand' failed, exception details:
2025-09-22 16:36:52.317 Error: TinyTuya: Traceback (most recent call last):
2025-09-22 16:36:52.318 Error: TinyTuya: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-TinyTUYA-Plugin\plugin.py", line 967, in onCommand
2025-09-22 16:36:52.318 Error: TinyTuya: _plugin.onCommand(DeviceID, Unit, Command, Level, Color)
2025-09-22 16:36:52.319 Error: TinyTuya: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-TinyTUYA-Plugin\plugin.py", line 130, in onCommand
2025-09-22 16:36:52.320 Error: TinyTuya: dev = Devices[DeviceID].Units[Unit]
2025-09-22 16:36:52.320 Error: TinyTuya: NameError: name 'Devices' is not defined

After that things work fine again.
Any information I can collect for you?
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 22 September 2025 17:09 It has been working flawlesly for hours (i have been flicking switches) then on flicking a switch I get:

Error: TinyTuya: onCommand ERROR: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/iot-03/devices/bf58f96d002fcb03beswmt/commands (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x040996E8>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

After that things work fine again.
Any information I can collect for you?
What is you 'API Polling interval' and how much devices do you have?
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 23 September 2025 21:52
ronalddevos wrote: Monday 22 September 2025 17:09 It has been working flawlesly for hours (i have been flicking switches) then on flicking a switch I get:

Error: TinyTuya: onCommand ERROR: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/iot-03/devices/bf58f96d002fcb03beswmt/commands (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x040996E8>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

After that things work fine again.
Any information I can collect for you?
What is you 'API Polling interval' and how much devices do you have?
API Polling interval is set to 15 minutes.
I have 31 physical Tuya devices in the network , obviously logicals (Sensor gives T, H and T&H, plug gets W, V, mA, etc) about 90
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 24 September 2025 7:54 API Polling interval is set to 15 minutes.
I have 31 physical Tuya devices in the network , obviously logicals (Sensor gives T, H and T&H, plug gets W, V, mA, etc) about 90
Okay that are a lot devices! on 15min don't think you are hitting the limit. Do you have a test system?
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: Wednesday 24 September 2025 21:25
ronalddevos wrote: Wednesday 24 September 2025 7:54 API Polling interval is set to 15 minutes.
I have 31 physical Tuya devices in the network , obviously logicals (Sensor gives T, H and T&H, plug gets W, V, mA, etc) about 90
Okay that are a lot devices! on 15min don't think you are hitting the limit. Do you have a test system?
No test system. There are a number of devices though that I use for testing - I can remove those, about 5 I think. Would that help?
I do have a few Pi's floating about and can set up a test system if that helps.
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: Thursday 25 September 2025 9:24
Xenomes wrote: Wednesday 24 September 2025 21:25
ronalddevos wrote: Wednesday 24 September 2025 7:54 API Polling interval is set to 15 minutes.
I have 31 physical Tuya devices in the network , obviously logicals (Sensor gives T, H and T&H, plug gets W, V, mA, etc) about 90
Okay that are a lot devices! on 15min don't think you are hitting the limit. Do you have a test system?
No test system. There are a number of devices though that I use for testing - I can remove those, about 5 I think. Would that help?
I do have a few Pi's floating about and can set up a test system if that helps.
Removed 7 (test) devices = wait and see...
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: Thursday 25 September 2025 9:24 No test system. There are a number of devices though that I use for testing - I can remove those, about 5 I think. Would that help?
I do have a few Pi's floating about and can set up a test system if that helps.
Okay, I have another version of the plugin that uses Pulsar a different type of communication.
ronalddevos wrote: Thursday 25 September 2025 9:46 Removed 7 (test) devices = wait and see...
I am curious about the result.
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: Thursday 25 September 2025 21:32
ronalddevos wrote: Thursday 25 September 2025 9:24 No test system. There are a number of devices though that I use for testing - I can remove those, about 5 I think. Would that help?
I do have a few Pi's floating about and can set up a test system if that helps.
Okay, I have another version of the plugin that uses Pulsar a different type of communication.
ronalddevos wrote: Thursday 25 September 2025 9:46 Removed 7 (test) devices = wait and see...
I am curious about the result.
It is still happening every now and then (twice in the last 24 hours) . It seems to have to do when I flick a switch under certain conditions and I don't know what these conditions are - can't reproduce it at will.
Where do I find the other plugin? Tried 'git pull' but 'already up to date'

Oh, and thanks for your help, btw!
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: Friday 26 September 2025 8:44 It is still happening every now and then (twice in the last 24 hours) . It seems to have to do when I flick a switch under certain conditions and I don't know what these conditions are - can't reproduce it at will.
I hope you can reproduce it, i have only one device. 😅
ronalddevos wrote: Where do I find the other plugin? Tried 'git pull' but 'already up to date'
For the readme... change to pulsar.
Schermafdruk van 2025-09-26 19-22-31.png
Schermafdruk van 2025-09-26 19-22-31.png (22.69 KiB) Viewed 102 times
In the plugin folder

Code: Select all

git checkout pulsar
Restart Domoticz

To revert

Code: Select all

git checkout Master
ronalddevos wrote: Oh, and thanks for your help, btw!
No, problem there is the community for.
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: Friday 26 September 2025 19:30
ronalddevos wrote: Friday 26 September 2025 8:44 It is still happening every now and then (twice in the last 24 hours) . It seems to have to do when I flick a switch under certain conditions and I don't know what these conditions are - can't reproduce it at will.
I hope you can reproduce it, i have only one device. 😅
ronalddevos wrote: Where do I find the other plugin? Tried 'git pull' but 'already up to date'
For the readme... change to pulsar.
Schermafdruk van 2025-09-26 19-22-31.png
In the plugin folder

Code: Select all

git checkout pulsar
Restart Domoticz

To revert

Code: Select all

git checkout Master
ronalddevos wrote: Oh, and thanks for your help, btw!
No, problem there is the community for.
Done! I'll monitor...
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 8:25 Done! I'll monitor...
Nice, hopefully all device are controlled correctly, Internal the code is simplified. Don´t forget to change the setting in the plugin to pulsar.
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: Saturday 27 September 2025 9:15
ronalddevos wrote: Saturday 27 September 2025 8:25 Done! I'll monitor...
Nice, hopefully all device are controlled correctly, Internal the code is simplified. Don´t forget to change the setting in the plugin to pulsar.
It is working fine, I just the occasional:
2025-09-27 15:33:53.215 Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217
2025-09-27 15:35:21.511 Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217
2025-09-27 15:36:22.974 Error: TinyTuya hardware (16) thread seems to have ended unexpectedly
2025-09-27 15:36:24.639 Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217
2025-09-27 15:37:27.770 Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217
2025-09-27 15:38:29.223 Error: TinyTuya hardware (16) thread seems to have ended unexpectedly
2025-09-27 15:38:30.899 Error: TinyTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 1217
but is still seems to work
Response time seems slower though (not an issue)
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 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.
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: 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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest