Oficial Docker Container Topic is solved

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

Harrie
Posts: 5
Joined: Saturday 31 January 2015 15:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Harderwijk, Nederland
Contact:

Re: Oficial Docker Container

Post by Harrie »

I am a still confused. This is my screen. Is this the correct way?
Attachments
Knipsel.JPG
Knipsel.JPG (48.02 KiB) Viewed 5474 times
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Stormryder »

Could someone explain where the scripts are stored in the docker container?
I have copied the scripts folder from my previous (Jadahl package) setup to the docker/domoticz (which is connected to /opt/domoticz/userdata).
But the scripts inside Domoticz are not in sync with the scripts in this folder. I get an error when I run a .py script:
sh: 1: {command of the script, eg. /opt/domoticz/userdata/scripts/python/1234546.py} not found
But when I look in the folder /opt/domoticz/userdata/scripts/python/123456.py is there (I use file station so I look inside /volume1/docker/domoticz/scripts/python/)

And when I add a new script it is nowhere to be found in the scripts folder. So it looks like the scripts are stored somewhere else?

I am moving from the Jadahl-package to the official Docker-image, mainly because the package is no longer supported.
The complete setup was still working perfect, but wanted to change before DSM 7 messed things up :).
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Stormryder »

Harrie wrote: Monday 22 February 2021 21:09 I am a still confused. This is my screen. Is this the correct way?
Hi Harrie,

I have the same setup, but I didn't use a config folder. But this should not matter afak.
In File Station you are now able to see the Domoticz-docker files, correct?
Screenshot is because of some other issue, but you can see the connection I made between domoticz/docker and /opt/domoticz/userdata
Schermafbeelding 2021-02-23 om 08.24.41.png
Schermafbeelding 2021-02-23 om 08.24.41.png (311.36 KiB) Viewed 5459 times
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Stormryder »

Stormryder wrote: Tuesday 23 February 2021 8:38 Could someone explain where the scripts are stored in the docker container?
I have copied the scripts folder from my previous (Jadahl package) setup to the docker/domoticz (which is connected to /opt/domoticz/userdata).
But the scripts inside Domoticz are not in sync with the scripts in this folder. I get an error when I run a .py script:
sh: 1: {command of the script, eg. /opt/domoticz/userdata/scripts/python/1234546.py} not found
But when I look in the folder /opt/domoticz/userdata/scripts/python/123456.py is there (I use file station so I look inside /volume1/docker/domoticz/scripts/python/)

And when I add a new script it is nowhere to be found in the scripts folder. So it looks like the scripts are stored somewhere else?

I am moving from the Jadahl-package to the official Docker-image, mainly because the package is no longer supported.
The complete setup was still working perfect, but wanted to change before DSM 7 messed things up :).
And when I edit a DzVent script in Domoticz Interface and save that, I see the change when I go to volume1/docker/domoticz/scripts/dzvents/generated_scripts/[scriptname].lua. So the connection between Domoticz and the folder in File Station is there.
Harrie
Posts: 5
Joined: Saturday 31 January 2015 15:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Harderwijk, Nederland
Contact:

Re: Oficial Docker Container

Post by Harrie »

@Stormryder: thanks. I did it like that.
I get a empty folder 'plugins' and domoticz.db (+ .db-shm and .db-wal).

But when i want to execute a script with a virtual switch i get an error:
Error: SQLHelper: Error script not found '/opt/domoticz/userdata/scripts/hs/hsDomCopy.py

Adding /scripts/hs/hsDomCopy.py to plugins does change nothing.

BTW i am on DSM DSM 6.2.3-25426 Update 3

:oops: I quit searching for the docker solution.
:D I migrated to a virtual machine. It takes more effort, but it works :lol: !
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Stormryder »

Harrie wrote: Tuesday 23 February 2021 11:46 But when i want to execute a script with a virtual switch i get an error:
Error: SQLHelper: Error script not found '/opt/domoticz/userdata/scripts/hs/hsDomCopy.py

Adding /scripts/hs/hsDomCopy.py to plugins does change nothing.
Strange, I have the same issue with scripts 'not being found'.
So I guess this is some sort of bug or maybe we (I, because you moved on :)) should change some settings.
Hopefully somebody can add in on this and give some help!
iganin
Posts: 47
Joined: Tuesday 28 October 2014 17:55
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Aalter, Belgium
Contact:

Re: Oficial Docker Container

Post by iganin »

I need 1wire via owfs support. That is why I've created my own docker. If this container supports it I will be more than happy to switch to the official one.
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Stormryder »

The Python and curl scripts are running now.
In the Docker GUI on Synology I went to Terminal -> make.
In the bash I did the following;

apt update
apt install curl
apt install python (Yes)
apt install python-requests (Yes)

As stated in one of the first posts, the packages are not installed inside the container. So therefor you need to install them separately inside the container.
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Jumper3126 »

Just went from the Jadahl version to this docker version. Works nicely with zigbee2mqtt in other docker container.
However, it seems that the DZVentz scripts are not work, while the blockly scripts do. Any idea how to solve this?

All scripts work perfectly in the Jadahl version.
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Stormryder »

Jumper3126 wrote: Friday 26 February 2021 14:06 Just went from the Jadahl version to this docker version. Works nicely with zigbee2mqtt in other docker container.
However, it seems that the DZVentz scripts are not work, while the blockly scripts do. Any idea how to solve this?

All scripts work perfectly in the Jadahl version.
I just made a guide maybe this will help you out?
viewtopic.php?f=47&t=35639

Probably because either python or another language is not installed. Which were all installed in the Jadahl package, but not in the Docker version.
Last edited by Stormryder on Friday 26 February 2021 14:58, edited 1 time in total.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

Jumper3126 wrote: Friday 26 February 2021 14:06 However, it seems that the DZVentz scripts are not work, while the blockly scripts do. Any idea how to solve this?
What kind of errors do you get? Or is it not working at all (without erors?)
Do you heva DzVents scripts running in a folder or through the events system (Setup-Events)?
In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the check-box ‘dzVents disabled’ is not checked.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Jumper3126 »

I was able to solve it by copying the scripts folder from the Jadahl version to the new docker folder. So thanks for helping out there.

Last item that I havent been able to fix is the custom tab for zigbee2mqtt. It also didn't appear initially with the Jadahl version, but I had a work around by copying the content of /domoticz/domoticz/var/www/templates to \domoticz\domoticz\www\templates, and restart. needed to have domoticz running, otherwise var/www/template is empty.

Copying the www\templates content from jadahl to dockers didnt solve it. And I haven't been able to locate the /domoticz/var/www/templates in the dockers version.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

Officially, the installation of the Custom Page is a task for the plugin at start of the plugin. From the wiki, https://www.domoticz.com/wiki/Developin ... hin_plugin

Setup custom page within plugin
Create custom HTML file in your plugins' folder, let's assume it is index.html
General idea is to install custom page when your plugin starts and remove it when plugin stops. To do so you need to modify your plugin's onStart and onStop methods. Base folder for Python will be Domoticz root (not your plugin root)

There is already an issue for this on the github of Zigbee2MQTT https://github.com/stas-demydiuk/domoti ... issues/556
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
bce626
Posts: 17
Joined: Saturday 03 November 2018 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: Oficial Docker Container

Post by bce626 »

thank you for your response and explanation.
I added my domoticz compose file.
it's true, learn to walk first, then learn to run.
but I was very curious.
I have figured out how the data persists, but the python version not quite yet

Code: Select all

#domoticz
  domoticz:
    image: domoticz/domoticz
    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    # devices:
    #   - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
    ports:
      - "8081:8080"
    volumes:
     - /home/pi/docker/config/domoticz:/opt/domoticz/work
     - /home/pi/docker/config/domoticz:/opt/domoticz/userdata
     - /home/pi/docker/config/domoticz:/opt/domoticz/conf
    environment:
      - TZ=Europe/Amsterdam
      - LOG_PATH=/opt/domoticz/userdata/domoticz.log
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Jumper3126 »

waltervl wrote: Friday 26 February 2021 15:50 Officially, the installation of the Custom Page is a task for the plugin at start of the plugin. From the wiki, https://www.domoticz.com/wiki/Developin ... hin_plugin

Setup custom page within plugin
Create custom HTML file in your plugins' folder, let's assume it is index.html
General idea is to install custom page when your plugin starts and remove it when plugin stops. To do so you need to modify your plugin's onStart and onStop methods. Base folder for Python will be Domoticz root (not your plugin root)

There is already an issue for this on the github of Zigbee2MQTT https://github.com/stas-demydiuk/domoti ... issues/556
Correct, only till it is solved, there is a fully functional work-around. But as there is no domoticz/var/www/templates folder (at least, cant find it), this work-around doesnt help in this docker container.
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Jumper3126 »

Do others see the custom tab when using the zigbee2mqtt plugin in this domoticz docker container?
tygerlord
Posts: 6
Joined: Monday 04 January 2021 11:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by tygerlord »

waaren wrote: Tuesday 09 February 2021 11:39
tygerlord wrote: Tuesday 09 February 2021 11:17 Thanks, but it's docker image, I would like to have a see on Dockerfile source used to create this image
This one ?
yes, ;)
YOYO
Posts: 27
Joined: Tuesday 09 June 2015 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.23393
Location: The Netherlands
Contact:

Re: Oficial Docker Container

Post by YOYO »

Hello,

Today i switched from the Linuxserverio docker image to the official docker image.
Seems to work fine in general but i cant import my scripts folder from the old docker image.

Scripts should be located in /opt/domoticz/scripts but that map is empty on the image.
i made an persistent link in the docker config and added my folder with scripts to it.
In the docker image with docker exec -it DomoticzMaster ls -l /opt/domoticz/scripts/ i can see my scripts so thats working ok.
Nevertheless domoticz cant see my scripts there in the events window and if i create a new event (Blocky/Lua/Dzvents) i cant see that file being generated anywhere?

Someone who can tell me where to find them?

Cheers,
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by Jumper3126 »

tygerlord wrote: Monday 08 March 2021 10:47
waaren wrote: Tuesday 09 February 2021 11:39
tygerlord wrote: Tuesday 09 February 2021 11:17 Thanks, but it's docker image, I would like to have a see on Dockerfile source used to create this image
This one ?
yes, ;)
Just for my understanding, is it correct that with this script, I can create my own containers, instead of using the containers from the dockerhub?
Although I'm not very experienced in linux, it doesn't look completely un-doable.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Oficial Docker Container

Post by EddyG »

Harrie wrote: Sunday 14 February 2021 14:17 So what do i enter in 'Bestand/Map' and 'Pad koppelen' in DSM? Do i have to enter something in 'Mileu' ??

My 'best' logging so far is: Error: SQLHelper: Error script not found '/opt/domoticz/userdata/scripts/hs/hsDomCopy.py'

The /opt/domoticz/userdata is unknown to me!.

Any help welcome.
Thanks in advance
First you have to decide where to put the "external" files. I put those in "/volume1/docker/domoticz"
Make config directory like

Code: Select all

mkdir /volume1/docker/domoticz/config 
Like in the compose file.
When you launch Domoticz in Docker put this folder in Advanced Settings
2021-03-13_11-20-46.png
2021-03-13_11-20-46.png (14.32 KiB) Viewed 5211 times
If you want to use other port settings etc.. put those in Environment.

In my Synology NAS there is docker-compose present, check if it is in yours. This is a better/easier way to get a container running.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest