Page 1 of 1

CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 13:47
by hjzwiers
CLuaHandler: cannot open /opt/domoticz/userdata/scripts/lua_parsers/watermeter.lua: No such file or directory

But the file is in /opt/stacks/domoticz/config/scripts/lua/watermeter.lua

I have made the location and file available, but no result. That why I need it through MQTT

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 15:03
by waltervl
If you are running from docker: check your volumes. You probably have to make an extra link to /opt/domoticz/userdata/scripts (but I am no docker expert....)

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 15:13
by eddieb

Code: Select all

    volumes:
      - ./config:/opt/domoticz/userdata
      - ./config/www/templates:/opt/domoticz/www/templates
works here ...
what I put in ./config/scripts/lua appears in /opt/domoticz/userdata/scripts/lua

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 16:06
by hjzwiers
I think i understand ...

I put the line in the config file, added the script in /opt/stacks/domoticz/config/scripts/lua/watermeter.lua

and restarted, but I still get: CLuaHandler: cannot open /opt/domoticz/userdata/scripts/lua_parsers/watermeter.lua: No such file or directory

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 17:22
by waltervl
you should put it in
/opt/stacks/domoticz/config/scripts/lua_parsers/watermeter.lua

You can check what happens if you login to the container with

Code: Select all

docker exec -it domoticz
and list the contents of folder /opt/domoticz/userdata/scripts/lua_parsers

Code: Select all

ls -l /opt/domoticz/userdata/scripts/lua_parsers

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 17:50
by eddieb
hmm,
my directory has a different name ...

Code: Select all

root@domoticz2:~# docker exec -it domoticz bash
root@domoticz:/opt/domoticz# ls -l /opt/domoticz/userdata/scripts/lua/
total 132
-rw-r--r-- 1 root root 69100 Jun 12 14:00 JSON.lua
-rw-r--r-- 1 root root 12387 Jun 12 14:00 XmlParser.lua
drwxr-xr-x 2 root root  4096 Jun 12 14:37 garbagecalendar
-rw-r--r-- 1 root root  1870 Jun 12 14:00 script_device_demo.lua
-rw-r--r-- 1 root root  1932 Jun 12 14:00 script_time_demo.lua
-rwxr-xr-x 1 root root 21692 Jun 12 14:00 script_time_garbagecalendar.lua
-rw-r--r-- 1 root root  5968 Jun 12 14:00 xml2lua.lua
drwxr-xr-x 2 root root  4096 Jun 12 14:00 xmlhandler

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 18:38
by hjzwiers
The point is that I don't have that directory, and if I make it it doesn't work!

/opt/stacks/domoticz/config/scripts/lua_parsers/watermeter.lua

/opt/stacks/domoticz/config/scripts/lua/watermeter.lua: this directory is made by the system : same problem as @eddieb

I don't know what you mean with getting direct entrance to the directory .....

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 20:06
by waltervl
And what if you create it from within the container?

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 20:12
by hjzwiers
I,d like to try, can you lead me through the process please?

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 20:14
by waltervl
Please do the following:
waltervl wrote: Thursday 12 June 2025 17:22 what happens if you login to the container with

Code: Select all

docker exec -it domoticz
and list the contents of folder /opt/domoticz/userdata/scripts/lua_parsers

Code: Select all

ls -l /opt/domoticz/userdata/scripts/lua_parsers

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 20:28
by hjzwiers
hjz@debian:/opt/stacks/domoticz$docker exec -it domoticz
docker: 'docker exec' requires at least 2 arguments

Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

See 'docker exec --help' for more information

I did it from the docker directory, but it is asking for more arguments?

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 20:40
by eddieb

Code: Select all

docker exec -it domoticz bash

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Thursday 12 June 2025 20:50
by hjzwiers
I had to use: sudo docker exec -it domoticz bash

i was within the docker: root@355aab15c8a9

ls -l /opt/domoticz/userdata/scripts/lua_parsers : response was "No such file or directory"

I then made the directory lua_parsers and copied the file into it.

Ran domoticz and it worked!!

I got domoticz-solaredge also working that way! Good learning point!

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Friday 13 June 2025 11:43
by waltervl
You have to be aware you have to do this everytime you update the Domoticz Docker image!

Re: CLuaHandler: cannot open watermeter.lua: No such file or directory

Posted: Friday 13 June 2025 11:51
by hjzwiers
Thanks for the heads up.

I've now edited most of the plugins within the docker file, I don't know if that's the way, but it got domoticz-solaredge started up.