I just tested the old plugin, and the Tuya API is still working. There is no need to migrate between the plugins; you can run them together and replace the devices in your scripts, and so on.manjh wrote: ↑Saturday 26 October 2024 11:51 I have been using TUYA plugin version 1.0.13 for quite some time now, it used to work OK but recently I find it non-responding. No apparent error code, just "not working".
I have tried to disable and then enable the plugin, but that sometimes fails and locksup Domoticz.
The solution that works OK is to log in to the Pi, and restart the Domoticz service.
Any clues?
I have thought about migrating to another plugin (tinyTuya??), but am a bit worried about the migration path. Would I lose all devices, and then manually have to re-install?
Python Plugin: TUYA
Moderator: leecollings
- Xenomes
- Posts: 416
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2025.1 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
OK, thanks.
In the mean time, I've "reneweded" my password in the Tuya cloud, not sure if that will cure the problems.
Also tried to get TinyTuya running. Installing is not a problem, but when I log in to the Tuya cloud and open my project, I cannot see any devices. My Tuya app shows the whole list, and in Domoticz I can see them as well. Am I looking in the wrong place to find a device ID?
In the mean time, I've "reneweded" my password in the Tuya cloud, not sure if that will cure the problems.
Also tried to get TinyTuya running. Installing is not a problem, but when I log in to the Tuya cloud and open my project, I cannot see any devices. My Tuya app shows the whole list, and in Domoticz I can see them as well. Am I looking in the wrong place to find a device ID?
Hans
- Xenomes
- Posts: 416
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
Go to iot.tuya.com => Cloud => open Project => Devices
Device ID are listed there, you need only one.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2025.1 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Just wondering. When I look at the "old" Tuya plugin, I only need the userid/PW for app access, and all devices are detected.
With the TinyTuya app I need a device ID. Why the difference?
With the TinyTuya app I need a device ID. Why the difference?
Hans
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Got it. For some strange reason I must have created the project using Central European Data Center, in stead of Western. Once I changed that, I can now see my devices.

Hans
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
So I went back and installed TinyTuya as per instructions.
Installation shows on Pi:
The Domoticz log shows me:
Is that related to the OS level? I am running Buster.
Installation shows on Pi:
Code: Select all
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
Code: Select all
2024-10-30 19:41:36.487 TinyTuya: Worker thread started.
2024-10-30 19:41:36.487 Status: TinyTuya: Entering work loop.
2024-10-30 19:41:36.487 Status: TinyTuya: Started.
2024-10-30 19:41:36.829 Error: TinyTuya: (tinytuya) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-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'.
2024-10-30 19:41:36.839 Error: TinyTuya: Traceback (most recent call last):
2024-10-30 19:41:36.839 Error: TinyTuya: File "/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 67, in <module>
2024-10-30 19:41:36.839 Error: TinyTuya: import tinytuya
2024-10-30 19:41:36.839 Error: TinyTuya: ModuleNotFoundError: No module named 'tinytuya'
Hans
- Xenomes
- Posts: 416
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
I never see this error installing the Tinytuya, what do you get if you install tinytuya only.manjh wrote: ↑Wednesday 30 October 2024 19:45 So I went back and installed TinyTuya as per instructions.
Installation shows on Pi:Code: Select all
error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Cargo, the Rust package manager, is not installed or is not on PATH. This package requires Rust and Cargo to compile extensions. Install it through the system's package manager or via https://rustup.rs/ Checking for Rust toolchain.... [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output.
Code: Select all
sudo pip3 install tinytuya
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2025.1 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
When I install TinyTuya only, it only gives me some remarks like "request already satisfied"...
Restarted Domoticz again, and enabled the plugin, gives me:
Restarted Domoticz again, and enabled the plugin, gives me:
Code: Select all
2024-10-31 08:03:38.187 TinyTuya: Worker thread started.
2024-10-31 08:03:38.187 Status: TinyTuya: Entering work loop.
2024-10-31 08:03:38.187 Status: TinyTuya: Started.
2024-10-31 08:03:38.311 Error: TinyTuya: (tinytuya) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-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'.
2024-10-31 08:03:38.322 Error: TinyTuya: Traceback (most recent call last):
2024-10-31 08:03:38.322 Error: TinyTuya: File "/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 67, in <module>
2024-10-31 08:03:38.322 Error: TinyTuya: import tinytuya
2024-10-31 08:03:38.322 Error: TinyTuya: ModuleNotFoundError: No module named 'tinytuya'
Hans
- Xenomes
- Posts: 416
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
The error say that 'tinytuya' not is installed. Are you running standalone or with the service or even in docker?
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2025.1 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
I'm not using a docker.
Not sure what you mean by standalone or service. I'm running Domoticz on a Pi4, installed it as per the instructions in the Wiki.
Installed TinyTuya, again as per the instructions.
Not sure what you mean by standalone or service. I'm running Domoticz on a Pi4, installed it as per the instructions in the Wiki.
Installed TinyTuya, again as per the instructions.
Hans
- Xenomes
- Posts: 416
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
If you start Domoticz with 'sudo systemctl start domoticz.service' you run it as a Service.
Starting Domoticz './domoticz -www 8085 -sslwww 0' standalone/manual used for testing, you also need to install tinytuya in the user environment (without the sudo) services is running under the superuser.
Starting Domoticz './domoticz -www 8085 -sslwww 0' standalone/manual used for testing, you also need to install tinytuya in the user environment (without the sudo) services is running under the superuser.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2025.1 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
- heggink
- Posts: 979
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Off topic but I thought I would sollicit anyway: I saw the author (xeno..) work on a plugin using the local api. There is a node red implementation for the local api which I am now using. Together with a little logic (with help from @gizmocuz) that creates the HA-autodiscovery devices, it works really well. I use it to control both a heater and an IR panel. Using the local api, I am no longer dependent on a cloud service.
Happy to share if anyone is interested.
Happy to share if anyone is interested.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Yes, interested!heggink wrote: ↑Friday 01 November 2024 10:21 Off topic but I thought I would sollicit anyway: I saw the author (xeno..) work on a plugin using the local api. There is a node red implementation for the local api which I am now using. Together with a little logic (with help from @gizmocuz) that creates the HA-autodiscovery devices, it works really well. I use it to control both a heater and an IR panel. Using the local api, I am no longer dependent on a cloud service.
Happy to share if anyone is interested.
Hans
- waltervl
- Posts: 5844
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Python Plugin: TUYA
The beta plugin for local tuya is here https://github.com/Xenomes/Domoticz-Tin ... cal-Plugin
Perhaps easier to improve that then go into another route with MQTT AD and Node-Red.
Perhaps easier to improve that then go into another route with MQTT AD and Node-Red.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- heggink
- Posts: 979
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: Python Plugin: TUYA
I'll write a topic about this under the mqtt-ad section
manjh wrote: ↑Friday 01 November 2024 18:24Yes, interested!heggink wrote: ↑Friday 01 November 2024 10:21 Off topic but I thought I would sollicit anyway: I saw the author (xeno..) work on a plugin using the local api. There is a node red implementation for the local api which I am now using. Together with a little logic (with help from @gizmocuz) that creates the HA-autodiscovery devices, it works really well. I use it to control both a heater and an IR panel. Using the local api, I am no longer dependent on a cloud service.
Happy to share if anyone is interested.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
viewtopic.php?f=82&t=42805
Here you go.
Here you go.
OK, that would be great. Can you post a link here to the new topic?
Hans
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
I now own about 15 smart-switches and I can switch them on/off from Domoticz.
But most of these switches also have power-monitoring on board, and I have been unable to access the stored information from Domoticz.
When I access them via the Tuya app, there is quite a lot of useful info.
Is there a way to pull that info into Domoticz?
But most of these switches also have power-monitoring on board, and I have been unable to access the stored information from Domoticz.
When I access them via the Tuya app, there is quite a lot of useful info.
Is there a way to pull that info into Domoticz?
Hans
- Xenomes
- Posts: 416
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
That data isn’t shared by the tinytuya module, and I don’t think it’s shared from Tuya to tinytuya either. You could update the device in Domoticz, and it should refresh, but due to a calculation in place, there will be some drift over time.manjh wrote: ↑Saturday 02 November 2024 13:37 I now own about 15 smart-switches and I can switch them on/off from Domoticz.
But most of these switches also have power-monitoring on board, and I have been unable to access the stored information from Domoticz.
When I access them via the Tuya app, there is quite a lot of useful info.
Is there a way to pull that info into Domoticz?
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2025.1 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
OK, thanks. There is quite a bit of info there, but if it isn't shared: tough luck...Xenomes wrote: ↑Saturday 02 November 2024 16:53That data isn’t shared by the tinytuya module, and I don’t think it’s shared from Tuya to tinytuya either. You could update the device in Domoticz, and it should refresh, but due to a calculation in place, there will be some drift over time.manjh wrote: ↑Saturday 02 November 2024 13:37 I now own about 15 smart-switches and I can switch them on/off from Domoticz.
But most of these switches also have power-monitoring on board, and I have been unable to access the stored information from Domoticz.
When I access them via the Tuya app, there is quite a lot of useful info.
Is there a way to pull that info into Domoticz?

Hans
Who is online
Users browsing this forum: No registered users and 1 guest