Oficial Docker Container Topic is solved
Moderators: leecollings, remb0
-
- 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
I am a still confused. This is my screen. Is this the correct way?
- Attachments
-
- Knipsel.JPG (48.02 KiB) Viewed 5475 times
-
- Posts: 31
- Joined: Friday 23 August 2019 9:43
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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 .
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 .
-
- Posts: 31
- Joined: Friday 23 August 2019 9:43
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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
-
- Posts: 31
- Joined: Friday 23 August 2019 9:43
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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.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 .
-
- 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
@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 !
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 !
-
- Posts: 31
- Joined: Friday 23 August 2019 9:43
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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!
-
- 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
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.
-
- Posts: 31
- Joined: Friday 23 August 2019 9:43
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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.
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.
-
- Posts: 105
- Joined: Thursday 31 December 2015 15:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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.
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.
-
- Posts: 31
- Joined: Friday 23 August 2019 9:43
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Oficial Docker Container
I just made a guide maybe this will help you out?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.
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.
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Oficial Docker Container
What kind of errors do you get? Or is it not working at all (without erors?)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?
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
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 105
- Joined: Thursday 31 December 2015 15:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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.
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.
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Oficial Docker Container
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
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
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- 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
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
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
-
- Posts: 105
- Joined: Thursday 31 December 2015 15:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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.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
-
- Posts: 105
- Joined: Thursday 31 December 2015 15:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Oficial Docker Container
Do others see the custom tab when using the zigbee2mqtt plugin in this domoticz docker container?
-
- 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
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,
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,
-
- Posts: 105
- Joined: Thursday 31 December 2015 15:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Oficial Docker Container
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
First you have to decide where to put the "external" files. I put those in "/volume1/docker/domoticz"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
Make config directory like
Code: Select all
mkdir /volume1/docker/domoticz/config
When you launch Domoticz in Docker put this folder in Advanced Settings 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.
Who is online
Users browsing this forum: No registered users and 0 guests