Hi,
I have several LUA scripts running as files in the .../domoticz/scripts/ directory.
I also have one LUA script that I inserted via the web interface.
All works fine and in parallel.
The only difference I see is that scripts added to the .../domoticz/scripts/ directory are not visible in the web interface and visa versa.
Are there any other advantages/disadvantage for putting LUA scripts in the web interface, possibly in terms of speeds, flexibility, backing up, etc., that are worth knowing?
thanks!
Differences using LUA script in webinterface vs flat file
Moderator: leecollings
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Differences using LUA script in webinterface vs flat file
I believe file based scripts are executed before the database scripts (at least that was my finding several months ago).
So file based scripts are slightly faster, definnitely if there's only one. The more scripts the slower they get.
As for backup, I prefer files also because I backup my whole domoticz folder. Even when the database is completely corrupted I still have the scripts.
Another advantage that I can think of is that while you keep the script open in a editor you can use undo the revert recent changes.
So file based scripts are slightly faster, definnitely if there's only one. The more scripts the slower they get.
As for backup, I prefer files also because I backup my whole domoticz folder. Even when the database is completely corrupted I still have the scripts.
Another advantage that I can think of is that while you keep the script open in a editor you can use undo the revert recent changes.
-
- Posts: 662
- Joined: Thursday 10 November 2016 9:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Differences using LUA script in webinterface vs flat file
That's right, but I wonder if there is a way to test without waiting for execution (every mn for a time script, once changed for a device)... Well, a way to trigger the Domoticz Lua interperter off line!Egregius wrote:Another advantage that I can think of is that while you keep the script open in a editor you can use undo the revert recent changes.
At the moment, I stick to python, only making the domoticz glue with Lua, for this reason (well, some heavy json results parsing, for instance; is usually easier in python too but sometimes I may have sticked to Lua if debug was easier)...
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Differences using LUA script in webinterface vs flat file
I only use one lua script to pass the changed device to php, all the rest is done there.
You can always trigger the device by calling the json updatedevice command in a browser
You can always trigger the device by calling the json updatedevice command in a browser

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