Page 1 of 1

Domoticz in Docker

Posted: Wednesday 01 January 2025 17:13
by BarryT
Hi all,

first of all Happy New Year!

after a lot of trail and error our Domoticz in Docker is working, but now i'm struggling with some scripts:
Our tuya script is not working, it cant find its files:

Code: Select all

2025-01-01 17:14:57.850  Status: Tuya: Started.
2025-01-01 17:14:58.003  Error: Tuya: (tuya) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/Domoticz-TUYA-Plugin/:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.9/dist-packages'.
2025-01-01 17:14:58.021  Error: Tuya: Traceback (most recent call last):
2025-01-01 17:14:58.021  Error: Tuya:   File "/opt/domoticz/userdata/plugins/Domoticz-TUYA-Plugin/plugin.py", line 65, in <module>
2025-01-01 17:14:58.021  Error: Tuya:     import tuyaha
2025-01-01 17:14:58.021  Error: Tuya: ModuleNotFoundError: No module named 'tuyaha'
this tuyaha is installed on the system and is working in normal installation of domoticz, but in docker it does not...
After installing the "pip install tuyaha" inside the domoticz docker console it is working, but does not survive an reboot/restart.

the same for our heos script, it is also not working anymore:

Code: Select all

/opt/domoticz/userdata/scripts/barry/bparadise.sh: 1: /usr/local/bin/heos_player: not found
/opt/domoticz/userdata/scripts/barry/bparadise.sh: 2: /usr/local/bin/heos_player: not found
/opt/domoticz/userdata/scripts/barry/bparadise.sh: 3: /usr/local/bin/heos_player: not found 
the heos_player is installed in the usr/local/bin directory, but docker (domoticz) does not seems to see it.

After installing the "pip install heospy" inside the domoticz docker console it is working,
but after restart/update the container its gone and does not work anymore and need to install pip heospy again.

Console:

Code: Select all

root@mainserver:/opt/domoticz# pip3 install tuyaha
Collecting tuyaha
  Downloading tuyaha-0.0.11-py3-none-any.whl (13 kB)
Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from tuyaha) (2.32.3)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->tuyaha) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests->tuyaha) (2.3.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->tuyaha) (2024.12.14)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/dist-packages (from requests->tuyaha) (3.4.1)
Installing collected packages: tuyaha
Successfully installed tuyaha-0.0.11
root@mainserver:/opt/domoticz# pip3 install heospy
Collecting heospy
  Downloading heospy-0.2.7-py3-none-any.whl (16 kB)
Collecting six
  Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
Collecting future
  Downloading future-1.0.0-py3-none-any.whl (491 kB)
     |████████████████████████████████| 491 kB 7.8 MB/s 
Installing collected packages: six, future, heospy
Successfully installed future-1.0.0 heospy-0.2.7 six-1.17.0
root@mainserver:/opt/domoticz# 
Can someone help me with this?

Thanks,
Barry

Re: Domoticz in Docker

Posted: Wednesday 01 January 2025 18:26
by BarryT
Never mind, i found out that the customstart.sh script does its job!

In the script i added:

Code: Select all

pip install tuyaha
pip install heospy
And everything works again :-)