Domoticz systemd or python problem ?

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
ricorico94
Posts: 110
Joined: Monday 26 October 2015 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Domoticz systemd or python problem ?

Post by ricorico94 »

Hi,
I try to reinstall domoticz on a fresh Trixie installation on Raspberry ¨Pi 3B+. I don't use Docker (it looks complicated..).
I installed domoticz using the simple "sudo bash -c "$(curl -sSfL https://install.domoticz.com)" " command. This domoticz shows a version 2026.4.
I could import my previous domoticz database (which was 2024.4) and some features/sensors are working fine.
However, I face problem to add several python plugins and as I 'm investigating if it's problem due to Virtual environment, I notice that my domoticz doesn't seem using the systemd though I read on wiki that since Feb 26, it should be automatically started by systemd:

Code: Select all

pi@domoticz:~ $ sudo systemctl status domoticz
[sudo] Mot de passe de pi :
● domoticz.service - LSB: Home Automation System
     Loaded: loaded (/etc/init.d/domoticz.sh; generated)
     Active: active (running) since Sun 2026-10-25 18:59:08 CET; 17s ago
 Invocation: d0533f4822c14897b840aa3058f79fec
       Docs: man:systemd-sysv-generator(8)
    Process: 1061 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SUCC>
      Tasks: 50 (limit: 806)
        CPU: 4.515s
     CGroup: /system.slice/domoticz.service
             └─1111 /home/pi/domoticz/domoticz -daemon -www 8080 -sslwww 443
Moreover, I can't find any domoticz.service file in /etc/systemd/system (whereas there is a domoticz.sh in /etc/init.d).
So this raises several questions (at least..):
- is it normal ? (domoticz version shows 2026.4..)
- how could I move to using the systemd ? where can I find the domoticz.service file ? (the linux wiki shows some "text/code", but I'm surprised that it shows "User=domoticz" whereas the underneath domticz.sh shows User=pi, so I'm not sure how far it must be customized
- (until I can move to systemd) how should I modify my current init.d domoticz.sh to support Python virtual environment ? The wiki states to add 1 line (without telling where), but on the forum I found another post stating to add 2 rows
In the do_start() function, before the line start-stop-daemon --chuid $USERNAME --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1, add:

export VIRTUAL_ENV=/home/pi/Domoticz_Python_Environment
export PATH="$VIRTUAL_ENV/bin:$PATH"
- do you thin the errors below are linked to these Python virtual environment ?

Code: Select all

2026-10-25 20:09:10.592  Error: SmartLife-Tuya: (tuya) failed to load 'plugin.py'.
2026-10-25 20:09:10.637  Error: SmartLife-Tuya: Traceback (most recent call last):
2026-10-25 20:09:10.638  Error: SmartLife-Tuya:   File "/home/pi/domoticz/plugins/Domoticz-TUYA-Plugin/plugin.py", line 65, in <module>
2026-10-25 20:09:10.638  Error: SmartLife-Tuya:     import tuyaha
2026-10-25 20:09:10.638  Error: SmartLife-Tuya:   File "/home/pi/Domoticz_Python_Environment/lib/python3.13/site-packages/tuyaha/__init__.py", line 2, in <module>
Post Reply