Page 1 of 1

Python or dzVents

Posted: Saturday 14 December 2024 11:39
by HvdW
I (read Claude) just adapted a script from dzVents to python and put the python script in ~/domoticz/scripts/python
Both are running now and the output of the scripts is written to different files.

- is the place for python scripts ~/domoticz/scripts/python?
- what gives less stress to the system, a python script or a dzVents script

Re: Python or dzVents

Posted: Saturday 14 December 2024 11:49
by heggink
I quite like dzvents due to its simplicity and effectiveness. I have over 110 scrips with a system running at a few% CPU so minimal impact despite the hundreds of devices in my system. Domoticz is very efficient anyway.
I have never done any scripts in python but I have done a few plugins here and there where the complexity and vulnerability of that python subsystem always worried me (memory leaks, crashes). Dzvents can hardly crash your system, python absolutely can (and will ;-)).
This, for me is one of the key reasons why I use domoitcz: efficiency, functionality and the power of dzvents. Then again, others may swear by python I suppose :-).

Re: Python or dzVents

Posted: Saturday 14 December 2024 11:57
by lost
Same answer: When complexity does not need all the python modules that can speed-up things a lot (even if their maintenance can also be problematic over time), stick to Lua (or dzVent that is a domoticz superset of pure Lua).

Lua is a language that was made to be embedded in programs & is very efficient for this + stable: I have scripts that did not change since 8 years of Domoticz. In Python, forget it!

I sometime regret plugins need python & not Lua...

Re: Python or dzVents

Posted: Saturday 14 December 2024 18:53
by waltervl
There is probably still some memory leak in python scripts. Check your memory usage to see if it is still there.

Also python script integration is very rudimental and not documented. I don't think there is a lot of difference in using dzvents (or Lua) on the stress level.

I would stay at Dzvents....

Re: Python or dzVents

Posted: Sunday 15 December 2024 0:22
by solarboy
Dzvents has been rock solid for me but python always brings versioning issues and this new venv stuff is tedious.

Re: Python or dzVents

Posted: Sunday 15 December 2024 2:01
by HvdW
Thank you all for your comments.
I will do some python experimenting juist door the fun of doing so but I'll stick to dzVents.
Praise to the people who implemented it.
It's so dead easy to program and to maintain the scripts.