dzVents error in Domoticz (beta) in Docker  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
BarryT
Posts: 365
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

dzVents error in Domoticz (beta) in Docker

Post by BarryT »

Hi all,

today i'm busy to try to get all my software in to docker (portainer) and want to stop with sd cards and stuff.
So far so good, and the first things works, but i'm struggling with some error messages in dzVents when using the first script:

Code: Select all

2024-12-28 13:17:00.520 dzVents: Alarmering: : ------ Start internal script: 7-Alarmering-:, trigger: "every 1 minutes"
2024-12-28 13:17:00.521 dzVents: Debug: Alarmering-: : OpenURL: url = https://alarmeringen.nl/feeds/area/*.rss
2024-12-28 13:17:00.521 dzVents: Debug: Alarmering-: : OpenURL: method = GET
2024-12-28 13:17:00.521 dzVents: Debug: Alarmering-: : OpenURL: post data = nil
2024-12-28 13:17:00.521 dzVents: Debug: Alarmering-: : OpenURL: headers = nil
2024-12-28 13:17:00.521 dzVents: Debug: Alarmering-: : OpenURL: callback = alarmering
2024-12-28 13:17:00.522 dzVents: Alarmering: : ------ Finished 7-Alarmering-
2024-12-28 13:17:00.903 dzVents: Alarmering: : ------ Start internal script: 7-Alarmering-: HTTPResponse: "alarmering"
2024-12-28 13:17:00.945 dzVents: Debug: Alarmering-: : utcTimeDiffSeconds = 3600
2024-12-28 13:17:00.945 dzVents: Debug: Alarmering-: : Existing result_table: type = table
2024-12-28 13:17:00.945 dzVents: Debug: Alarmering-: : html file = /volumies/domoticz/www/templates/Alarmering.html
2024-12-28 13:17:00.946 Error: dzVents: Alarmering-: : An error occurred when calling event handler 7-Alarmering-
2024-12-28 13:17:00.946 Error: dzVents: Alarmering-: : ...ta/scripts/dzVents/generated_scripts/7-Alarmering.lua:83: attempt to index a nil value (local 'file')
All rights of the files are correct but the HTML page is not present nor it created..
Someone has an idea?

Thanks!
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: dzVents error in Domoticz (beta) in Docker

Post by gizmocuz »

I guess you mean you have created a script in the Domoticz Events Editor?
does /volumies/domoticz/www/templayes/Alarmering.html exists?

Did you mount any folders in the docker compose file? And places your html files in here?
Did you override the templates folder in the docker compose file?

For example, underneath your domoticz docker compose folder (I hope you created a folder for each compose project),
you can create a folder templates

then in your docker-compose.yml file you can mount this like

./templates:/opt/domoticz/www/templates

Now you script should be able to use /opt/domoticz/www/templates and see the file
Quality outlives Quantity!
BarryT
Posts: 365
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: dzVents error in Domoticz (beta) in Docker

Post by BarryT »

gizmocuz wrote: Saturday 28 December 2024 15:12 I guess you mean you have created a script in the Domoticz Events Editor?
does /volumies/domoticz/www/templayes/Alarmering.html exists?

Did you mount any folders in the docker compose file? And places your html files in here?
Did you override the templates folder in the docker compose file?

For example, underneath your domoticz docker compose folder (I hope you created a folder for each compose project),
you can create a folder templates

then in your docker-compose.yml file you can mount this like

./templates:/opt/domoticz/www/templates

Now you script should be able to use /opt/domoticz/www/templates and see the file
Hi Gizmo, thanks for answering!

I guess you mean you have created a script in the Domoticz Events Editor?
That's correct.. It worked before with my normal installed domoticz, but in docker it doesnt work anymore.
Ofcourse the file is there (but if it wasnt its being created)
i'm using portainer as my main interface to do docker images and stacks (thas the easiest way to backup things, and its great).

Did you mount any folders in the docker compose file? And places your html files in here?
Did you override the templates folder in the docker compose file
I'm using this:

Code: Select all

volumes:
  domoticz:
services:
  domoticz:
    image: domoticz/domoticz:beta
    container_name: domoticz
    restart: unless-stopped
#    network_mode: host
    #Pass devices to container
    #devices:
    # - /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AQ5NB7WR-if00-port0:/dev/ttyUSB0 #P1Monitor
    # - /dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0
    ports:
#     - 30:90 #HTTPS
       - 88:88/tcp #HTTP
#     - 6144:tcp #REMOTE DOMOTICZ
    volumes:
      - ./volumies/domoticz/:/opt/domoticz/userdata
#      - /volumies/domoticz/plugins/:/opt/domoticz/plugins
#      - /volumies/domoticz/www/templates:/opt/domoticz/www/templates
#      - /volumies/domoticz/www/styles:/opt/domoticz/www/styles
#      - /volumies/domoticz:/config
    environment:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - TZ=Europe/Amsterdam
      - PUID=1005
      - PGID=1005
      - WWW_PORT=88
      - SSL_PORT=0
      - loglevel error,status
#      - LOG_PATH=/volumies/domoticz/domoticz.log
Last edited by BarryT on Saturday 28 December 2024 16:24, edited 1 time in total.
BarryT
Posts: 365
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: dzVents error in Domoticz (beta) in Docker

Post by BarryT »

And this is the directory, also taken all files as user root with rwx rwx rwx, and this has worked before..
on some way it looks like it doesnt see the directory?
{EFB4E180-840B-45A6-AD08-F27D2926FA13}.png
{EFB4E180-840B-45A6-AD08-F27D2926FA13}.png (18.03 KiB) Viewed 225 times
(Btw, i copied the file Alarmering from my working backup system, so that could not be the issue i guess)
Also i tried to delete it to see it is making a new one, but it does not..
BarryT
Posts: 365
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: dzVents error in Domoticz (beta) in Docker

Post by BarryT »

Nobody? Still not working ;)
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: dzVents error in Domoticz (beta) in Docker  [Solved]

Post by gizmocuz »

If you remark the volume line, it is not working

# - /volumies/domoticz/www/templates:/opt/domoticz/www/templates

Remove the '#'

and restart your container

And in your script use the path /opt/domoticz/www/templates
Quality outlives Quantity!
BarryT
Posts: 365
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: dzVents error in Domoticz (beta) in Docker

Post by BarryT »

Ahh, it works!

Thanks Gizmocuz, for this answer!
I tought we had to use the mounted directory, but it is the /opt/ map i had to use in the script.. How stupid!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests