Page 2 of 11
Re: Oficial Docker Container
Posted: Monday 22 February 2021 21:09
by Harrie
I am a still confused. This is my screen. Is this the correct way?
Re: Oficial Docker Container
Posted: Tuesday 23 February 2021 8:38
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

.
Re: Oficial Docker Container
Posted: Tuesday 23 February 2021 8:40
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 (311.36 KiB) Viewed 5676 times
Re: Oficial Docker Container
Posted: Tuesday 23 February 2021 9:01
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.
Re: Oficial Docker Container
Posted: Tuesday 23 February 2021 11:46
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

I quit searching for the docker solution.

I migrated to a virtual machine. It takes more effort, but it works

!
Re: Oficial Docker Container
Posted: Tuesday 23 February 2021 12:03
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!
Re: Oficial Docker Container
Posted: Tuesday 23 February 2021 13:31
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.
Re: Oficial Docker Container
Posted: Wednesday 24 February 2021 18:40
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.
Re: Oficial Docker Container
Posted: Friday 26 February 2021 14:06
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.
Re: Oficial Docker Container
Posted: Friday 26 February 2021 14:12
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.
Re: Oficial Docker Container
Posted: Friday 26 February 2021 14:14
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.
Re: Oficial Docker Container
Posted: Friday 26 February 2021 15:35
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.
Re: Oficial Docker Container
Posted: Friday 26 February 2021 15:50
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
Re: Oficial Docker Container
Posted: Sunday 28 February 2021 14:20
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
Re: Oficial Docker Container
Posted: Monday 01 March 2021 23:17
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.
Re: Oficial Docker Container
Posted: Tuesday 02 March 2021 20:38
by Jumper3126
Do others see the custom tab when using the zigbee2mqtt plugin in this domoticz docker container?
Re: Oficial Docker Container
Posted: Monday 08 March 2021 10:47
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,

Re: Oficial Docker Container
Posted: Monday 08 March 2021 13:00
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,
Re: Oficial Docker Container
Posted: Monday 08 March 2021 19:25
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.
Re: Oficial Docker Container
Posted: Saturday 13 March 2021 11:17
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 (14.32 KiB) Viewed 5428 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.