Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)
Posted: Tuesday 16 December 2025 19:59
Do you have Bookworm or Trixie?
How are you running Domiticz local or docker?
How are you running Domiticz local or docker?
Open source Home Automation System
https://forum.domoticz.com/
Did you put the device on DP instructions? If No, change it as instcucted in de pdf and restart Domoticz and test again. If Yes, can you run the debug_discoverty.py from the tools directory and make a issue on https://github.com/Xenomes/Domoticz-Tin ... gin/issues and add the dump.json file to the issue.DomoticzRob wrote: Wednesday 17 December 2025 7:15 Now the questions:
1. When I change the set value from Domoticz, the changed value never reaches the thermostat.
The thermostat keeps it old value.
2: Not always is the actual temperature value "actual". The "Last Seen" value is sometimes way back...
3: Log errors:
I do have some errors:
Error: (JSONtoPython) failed to add item '-1', to list for string.
Error: Tuya: Domoticz.Configuration read failed: <built-in function Configuration> returned a result with an exception set
Error: Tuya: Device read failed: bf0fa6dfdcb9523a1cqgjw
What can possibly go wrong?
Okay, I test it last night on Trixie indeed the == version where a issue, but the code without == worked. Did you use sudo to install the pip3 modules?jmd33 wrote: Wednesday 17 December 2025 10:34 I have PiOS Trixie and local Domoticz 2025.2
but I can reformat to Bookworm (or older !) if necessary
Code: Select all
2026-01-21 19:51:47.496 Error: TinyTUYA: Fatal error during Tuya initialization: Failed to initialize Tuya Cloud API: name 'requests' is not defined
2026-01-21 19:51:47.498 Error: TinyTUYA: handleThread: Failed to initialize Tuya Cloud API: name 'requests' is not defined line 1044That is a strange one. requests is part of Tinytuya, and on my three test systems I don't have the error. I have added it to the import of the plugin. Hopefully the error is gone now. Version 2.3.6cVarazir wrote: Wednesday 21 January 2026 19:53 I'm getting this, I just updated
Code: Select all
2026-01-21 19:51:47.496 Error: TinyTUYA: Fatal error during Tuya initialization: Failed to initialize Tuya Cloud API: name 'requests' is not defined 2026-01-21 19:51:47.498 Error: TinyTUYA: handleThread: Failed to initialize Tuya Cloud API: name 'requests' is not defined line 1044
Did a git pull and restarted domoticz dockerXenomes wrote: Friday 23 January 2026 19:37That is a strange one. requests is part of Tinytuya, and on my three test systems I don't have the error. I have added it to the import of the plugin. Hopefully the error is gone now. Version 2.3.6cVarazir wrote: Wednesday 21 January 2026 19:53 I'm getting this, I just updated
Code: Select all
2026-01-21 19:51:47.496 Error: TinyTUYA: Fatal error during Tuya initialization: Failed to initialize Tuya Cloud API: name 'requests' is not defined 2026-01-21 19:51:47.498 Error: TinyTUYA: handleThread: Failed to initialize Tuya Cloud API: name 'requests' is not defined line 1044
Code: Select all
2026-01-23 22:15:20.728 Error: TinyTUYA: (tinytuya) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/:/opt/domoticz/userdata/Domoticz_Python_Environment:/opt/venv/lib/python3.11/site-packages:/usr/lib/python313.zip:/usr/lib/python3.13:/usr/lib/python3.13/lib-dynload:/opt/venv/lib/python3.13/site-packages:/opt/venv/local/lib/python3.13/dist-packages:/opt/venv/lib/python3/dist-packages:/opt/venv/lib/python3.13/dist-packages'.
2026-01-23 22:15:20.797 Error: TinyTUYA: Traceback (most recent call last):
2026-01-23 22:15:20.797 Error: TinyTUYA: File "/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 73, in <module>
2026-01-23 22:15:20.797 Error: TinyTUYA: import requests
2026-01-23 22:15:20.797 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/requests/__init__.py", line 43, in <module>
2026-01-23 22:15:20.797 Error: TinyTUYA: import urllib3
2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/__init__.py", line 7, in <module>
2026-01-23 22:15:20.798 Error: TinyTUYA: from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/connectionpool.py", line 11, in <module>
2026-01-23 22:15:20.798 Error: TinyTUYA: from .exceptions import (
2026-01-23 22:15:20.798 Error: TinyTUYA: ...<13 lines>...
2026-01-23 22:15:20.798 Error: TinyTUYA: )
2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/exceptions.py", line 2, in <module>
2026-01-23 22:15:20.798 Error: TinyTUYA: from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
2026-01-23 22:15:20.798 Error: TinyTUYA: ModuleNotFoundError: No module named 'urllib3.packages.six.moves'Python 3.13 are you in trixie? if so there is part on the Readme for Trixie, that includes the install of the missing urllib3 python module.Varazir wrote: Friday 23 January 2026 22:16 Did a git pull and restarted domoticz docker
Code: Select all
2026-01-23 22:15:20.728 Error: TinyTUYA: (tinytuya) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/:/opt/domoticz/userdata/Domoticz_Python_Environment:/opt/venv/lib/python3.11/site-packages:/usr/lib/python313.zip:/usr/lib/python3.13:/usr/lib/python3.13/lib-dynload:/opt/venv/lib/python3.13/site-packages:/opt/venv/local/lib/python3.13/dist-packages:/opt/venv/lib/python3/dist-packages:/opt/venv/lib/python3.13/dist-packages'. 2026-01-23 22:15:20.797 Error: TinyTUYA: Traceback (most recent call last): 2026-01-23 22:15:20.797 Error: TinyTUYA: File "/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 73, in <module> 2026-01-23 22:15:20.797 Error: TinyTUYA: import requests 2026-01-23 22:15:20.797 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/requests/__init__.py", line 43, in <module> 2026-01-23 22:15:20.797 Error: TinyTUYA: import urllib3 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/__init__.py", line 7, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/connectionpool.py", line 11, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .exceptions import ( 2026-01-23 22:15:20.798 Error: TinyTUYA: ...<13 lines>... 2026-01-23 22:15:20.798 Error: TinyTUYA: ) 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/exceptions.py", line 2, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead 2026-01-23 22:15:20.798 Error: TinyTUYA: ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
I have run this this since I reinstalled using Docker. Something has happen with.Xenomes wrote: Friday 23 January 2026 22:25Python 3.13 are you in trixie? if so there is part on the Readme for Trixie, that includes the install of the missing urllib3 python module.Varazir wrote: Friday 23 January 2026 22:16 Did a git pull and restarted domoticz docker
Code: Select all
2026-01-23 22:15:20.728 Error: TinyTUYA: (tinytuya) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/:/opt/domoticz/userdata/Domoticz_Python_Environment:/opt/venv/lib/python3.11/site-packages:/usr/lib/python313.zip:/usr/lib/python3.13:/usr/lib/python3.13/lib-dynload:/opt/venv/lib/python3.13/site-packages:/opt/venv/local/lib/python3.13/dist-packages:/opt/venv/lib/python3/dist-packages:/opt/venv/lib/python3.13/dist-packages'. 2026-01-23 22:15:20.797 Error: TinyTUYA: Traceback (most recent call last): 2026-01-23 22:15:20.797 Error: TinyTUYA: File "/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 73, in <module> 2026-01-23 22:15:20.797 Error: TinyTUYA: import requests 2026-01-23 22:15:20.797 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/requests/__init__.py", line 43, in <module> 2026-01-23 22:15:20.797 Error: TinyTUYA: import urllib3 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/__init__.py", line 7, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/connectionpool.py", line 11, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .exceptions import ( 2026-01-23 22:15:20.798 Error: TinyTUYA: ...<13 lines>... 2026-01-23 22:15:20.798 Error: TinyTUYA: ) 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/exceptions.py", line 2, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead 2026-01-23 22:15:20.798 Error: TinyTUYA: ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
Schermafdruk van 2026-01-23 22-22-40.png
I'm running Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] on linuxXenomes wrote: Friday 23 January 2026 22:25Python 3.13 are you in trixie? if so there is part on the Readme for Trixie, that includes the install of the missing urllib3 python module.Varazir wrote: Friday 23 January 2026 22:16 Did a git pull and restarted domoticz docker
Code: Select all
2026-01-23 22:15:20.728 Error: TinyTUYA: (tinytuya) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/:/opt/domoticz/userdata/Domoticz_Python_Environment:/opt/venv/lib/python3.11/site-packages:/usr/lib/python313.zip:/usr/lib/python3.13:/usr/lib/python3.13/lib-dynload:/opt/venv/lib/python3.13/site-packages:/opt/venv/local/lib/python3.13/dist-packages:/opt/venv/lib/python3/dist-packages:/opt/venv/lib/python3.13/dist-packages'. 2026-01-23 22:15:20.797 Error: TinyTUYA: Traceback (most recent call last): 2026-01-23 22:15:20.797 Error: TinyTUYA: File "/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 73, in <module> 2026-01-23 22:15:20.797 Error: TinyTUYA: import requests 2026-01-23 22:15:20.797 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/requests/__init__.py", line 43, in <module> 2026-01-23 22:15:20.797 Error: TinyTUYA: import urllib3 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/__init__.py", line 7, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/connectionpool.py", line 11, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .exceptions import ( 2026-01-23 22:15:20.798 Error: TinyTUYA: ...<13 lines>... 2026-01-23 22:15:20.798 Error: TinyTUYA: ) 2026-01-23 22:15:20.798 Error: TinyTUYA: File "/opt/domoticz/userdata/Domoticz_Python_Environment/urllib3/exceptions.py", line 2, in <module> 2026-01-23 22:15:20.798 Error: TinyTUYA: from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead 2026-01-23 22:15:20.798 Error: TinyTUYA: ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
Schermafdruk van 2026-01-23 22-22-40.png
The Domoticz Docker container has been updated to a higher release of the distribution. I will test it and fix the code or the requirements guide.Varazir wrote: Friday 23 January 2026 23:27 I'm running Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] on linux
Now I remember I did large update of apps on my system few days ago. Something broke this I guess.
I notice the about page looks more high techXenomes wrote: Saturday 24 January 2026 8:48The Domoticz Docker container has been updated to a higher release of the distribution. I will test it and fix the code or the requirements guide.Varazir wrote: Friday 23 January 2026 23:27 I'm running Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] on linux
Now I remember I did large update of apps on my system few days ago. Something broke this I guess.

Out of the scope of the plugin:
What do you mean with "Edit your customstart.sh to remove old lines see the customstart.sh in github" ?Xenomes wrote: Saturday 24 January 2026 15:29Out of the scope of the plugin:
You need to update your docker installation to the current version.
https://github.com/domoticz/domoticz-docker
put docker-entrypoint.sh in your directory where your customstart.sh is located.
Edit your customstart.sh to remove old lines see the customstart.sh in github.
In the scope:
The plugin needs tinytuya and PyCryptodome for the pip3 installation. Then it should work again.
The customstart.sh script handles all my package installations, both apt and pip dependencies. When I rebuild the container, everything gets freshly installed. I keep my git clones in a separate Docker shared volume so they persist between rebuilds.Varazir wrote: Saturday 24 January 2026 17:17 What do you mean with "Edit your customstart.sh to remove old lines see the customstart.sh in github" ?
I never got installing tinytuya and PyCryptodome using the customstart.sh script.
So I installed all lib's to folder and point my docker to that for python.
Could you share your customstart.sh and docker-entrypoint.sh ?Xenomes wrote: Saturday 24 January 2026 17:36The customstart.sh script handles all my package installations, both apt and pip dependencies. When I rebuild the container, everything gets freshly installed. I keep my git clones in a separate Docker shared volume so they persist between rebuilds.Varazir wrote: Saturday 24 January 2026 17:17 What do you mean with "Edit your customstart.sh to remove old lines see the customstart.sh in github" ?
I never got installing tinytuya and PyCryptodome using the customstart.sh script.
So I installed all lib's to folder and point my docker to that for python.
They are not really exciting, the docker-entrypoint.sh is unchanged, and the customstart.sh is only simply modified.Varazir wrote: Saturday 24 January 2026 18:27 Could you share your customstart.sh and docker-entrypoint.sh ?
I'm getting this,Xenomes wrote: Sunday 25 January 2026 8:56They are not really exciting, the docker-entrypoint.sh is unchanged, and the customstart.sh is only simply modified.Varazir wrote: Saturday 24 January 2026 18:27 Could you share your customstart.sh and docker-entrypoint.sh ?
https://raw.githubusercontent.com/domot ... rypoint.sh
- Spoiler: show
Code: Select all
domoticz-1 | building '_cffi_backend' extension
domoticz-1 | creating build/temp.linux-armv7l-cpython-313/src/c
domoticz-1 | arm-linux-gnueabihf-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -DFFI_BUILDING=1 -I/usr/include/ffi -I/usr/include/libffi -I/opt/venv/include -I/usr/include/python3.13 -c src/c/_cffi_backend.c -o build/temp.linux-armv7l-cpython-313/src/c/_cffi_backend.o
domoticz-1 | error: command 'arm-linux-gnueabihf-gcc' failed: No such file or directory
domoticz-1 | [end of output]
domoticz-1 |
domoticz-1 | note: This error originates from a subprocess, and is likely not a problem with pip.
domoticz-1 | ERROR: Failed building wheel for cffi
domoticz-1 | Failed to build PyCryptodome cffi
domoticz-1 | error: failed-wheel-build-for-install
domoticz-1 |
domoticz-1 | × Failed to build installable wheels for some pyproject.toml based projects
domoticz-1 | ╰─> PyCryptodome, cffiCode: Select all
domoticz-1 | 2026-01-25 13:29:47.381 Status: EventSystem: reset all device statuses...
domoticz-1 | 2026-01-25 13:29:47.702 Status: PluginSystem: 2 plugins started.
domoticz-1 | 2026-01-25 13:29:48.092 Status: Python EventSystem: Initializing event module.
domoticz-1 | 2026-01-25 13:29:48.092 Status: Python EventSystem: Initializing event module.
domoticz-1 | 2026-01-25 13:29:48.093 Status: EventSystem: Started
domoticz-1 | 2026-01-25 13:29:48.094 Status: EventSystem: Queue thread started...
domoticz-1 | 2026-01-25 13:29:49.016 Error: TinyTUYA: (tinytuya) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/:/usr/lib/python313.zip:/usr/lib/python3.13:/usr/lib/python3.13/lib-dynload:/opt/venv/lib/python3.13/site-packages:/opt/venv/local/lib/python3.13/dist-packages:/opt/venv/lib/python3/dist-packages:/opt/venv/lib/python3.13/dist-packages'.
domoticz-1 | 2026-01-25 13:29:49.032 Error: TinyTUYA: Traceback (most recent call last):
domoticz-1 | 2026-01-25 13:29:49.032 Error: TinyTUYA: File "/opt/domoticz/userdata/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 78, in <module>
domoticz-1 | 2026-01-25 13:29:49.032 Error: TinyTUYA: import tinytuya
domoticz-1 | 2026-01-25 13:29:49.032 Error: TinyTUYA: ModuleNotFoundError: No module named 'tinytuya'