Synology - script doesn't work

Moderator: leecollings

User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Synology - script doesn't work

Post by fabry91 »

Hello,

I have a Synology NAS with Domoticz running as a docker, I previuosly have Domoticz running on a raspberry and the script for a SR-201 relay was working perfect.

Now that I migrate to Synology nas I'm having some problem to run the script, it self it is:

echo -n "11" | nc -n -w 1 192.168.0.99 6722
echo -n "21" | nc -n -w 1 192.168.0.99 6722

The first is for the on action and the second for the off action, the .sh script is present in my nas, maybe I write the wrong path? :roll:
The log file say:

Code: Select all

Error: SQLHelper: Error script not found '/volume1/docker/Domoticz/scripts/relay_ch1_on.sh'
Thank you in advanced
Attachments
Untitled.jpg
Untitled.jpg (35.82 KiB) Viewed 160026 times
Untitled.jpg
Untitled.jpg (24.16 KiB) Viewed 160026 times
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

From within the folders of the Synology NAS are not reachable with the normal Synology path
It depends on how you installed the Domoticz container in Docker.
So tell us the install.
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

EddyG wrote: Wednesday 05 January 2022 9:58 From within the folders of the Synology NAS are not reachable with the normal Synology path
It depends on how you installed the Domoticz container in Docker.
So tell us the install.
Hello Eddy,

thank you for your reply!

i have followed this docker guide: https://registry.hub.docker.com/r/domoticz/domoticz

I don't know which one of these two path is the installation path container of Domoticz:
Attachments
Untitled.jpg
Untitled.jpg (67.25 KiB) Viewed 160008 times
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

fabry91 wrote: Wednesday 05 January 2022 11:02 i have followed this docker guide: https://registry.hub.docker.com/r/domoticz/domoticz
Did you follow the docker run method or the docker-compose methode
and what is the part that you used in

Code: Select all

-v <path for config files>:/opt/domoticz/userdata \
or

Code: Select all

    volumes:
      - ./config:/opt/domoticz/userdata
And if you used the compose methode, what path on your Synology is that docker-compose.yaml file
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

EddyG wrote: Wednesday 05 January 2022 11:28
fabry91 wrote: Wednesday 05 January 2022 11:02 i have followed this docker guide: https://registry.hub.docker.com/r/domoticz/domoticz
Did you follow the docker run method or the docker-compose methode
and what is the part that you used in

Code: Select all

-v <path for config files>:/opt/domoticz/userdata \
or

Code: Select all

    volumes:
      - ./config:/opt/domoticz/userdata
And if you used the compose methode, what path on your Synology is that docker-compose.yaml file
I don't remember which method I followed :( where can I find the docker-compose.yaml file? Is in the docker folder of volume1?

Anyway I checked the container log of the first day when I installed Domoticz with docker, it seems to be opt/domoticz/...

But if I check the /volume1/opt/ I only find "containerd" without any domoticz folder
Attachments
Untitled.jpg
Untitled.jpg (81.24 KiB) Viewed 159997 times
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

Do you know where your domoticz.db file is placed? normally the scripts and plugin dirs are below that one.
Could be /Volume1/docker/Domoticz
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

EddyG wrote: Wednesday 05 January 2022 12:15 Do you know where your domoticz.db file is placed? normally the scripts and plugin dirs are below that one.
Could be /Volume1/docker/Domoticz
Yes it is placed in the docker/Domoticz folder, and also the scripts are presents in the scripts folder:
Attachments
Untitled.jpg
Untitled.jpg (87.63 KiB) Viewed 159975 times
ss.jpg
ss.jpg (71.64 KiB) Viewed 159975 times
Last edited by fabry91 on Wednesday 05 January 2022 12:47, edited 1 time in total.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

Your script location from within docker is not

Code: Select all

/volume1/docker/Domoticz/scripts/relay_ch1_on.sh
but probably

Code: Select all

/opt/domoticz/userdata/scripts/relay_ch1_on.sh
you could check that with

Code: Select all

docker run -it domoticz/domoticz /bin/bash
ls -al /opt/domoticz/userdata/scripts/ 
exit docker with just exit.
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

EddyG wrote: Wednesday 05 January 2022 12:44 Your script location from within docker is not

Code: Select all

/volume1/docker/Domoticz/scripts/relay_ch1_on.sh
but probably

Code: Select all

/opt/domoticz/userdata/scripts/relay_ch1_on.sh
you could check that with

Code: Select all

docker run -it domoticz/domoticz /bin/bash
ls -al /opt/domoticz/userdata/scripts/ 
exit docker with just exit.
It can't find the path if I search:
Attachments
sss.jpg
sss.jpg (102.85 KiB) Viewed 159974 times
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

Then you have a problem with the Domoticz docker installation.
The scripts and plugins directories are not brought outside of docker and cannot be accessed.
Now it depends on the method how you installed Domoticz in docker.

Just to give an idea. My test system (raspberry) runs with this compose file.

Code: Select all

version: '2.1'

services:
  domoticz:
    image: domoticz/domoticz:latest
    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    devices:
       - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
    ports:
      - "8080:8080"
    volumes:
      - /var/lib/docker/volumes/domoticz:/opt/domoticz/userdata
      - /var/lib/docker/volumes/domoticz/www/templates:/opt/domoticz/www/templates
      - /var/lib/docker/volumes/domoticz/scripts:/opt/domoticz/scripts
    environment:
      - TZ=Europe/Amsterdam
      - LOG_PATH=/opt/domoticz/userdata/domoticz.log
It gets the www/templates and scripts directories outside of docker.
Last edited by EddyG on Wednesday 05 January 2022 13:02, edited 1 time in total.
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

EddyG wrote: Wednesday 05 January 2022 12:55 Then you have a problem with the Domoticz docker installation.
The scripts and plugins directories are not brought outside of docker and cannot be accessed.
Now it depends on the method how you installed Domoticz in docker.
Okay, but why the plugin that I have placed in "volume1/docker/domoticz/plugin" are working and I can see in the hardware tab? :|
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

I have no idea, because I don't know you setup. "domoticz" is an other dir then "Domoticz", or did you mistype the "D"?

BUT did you check if the suggested script path worked?

Code: Select all

/opt/domoticz/userdata/scripts/relay_ch1_on.sh
Or

Code: Select all

/opt/domoticz/scripts/relay_ch1_on.sh
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

EddyG wrote: Wednesday 05 January 2022 13:04 I have no idea, because I don't know you setup. "domoticz" is an other dir then "Domoticz", or did you mistype the "D"?
I mistype the "D", the setup it seems correct because also the container volume path is "/opt/domoticz/userdate/", maybe I need to copy the scripts file in "/volume1/docker/domoticz/scripts" to "/opt/domoticz/scripts" folder?
Attachments
Untitled.jpg
Untitled.jpg (51.75 KiB) Viewed 159955 times
User avatar
waltervl
Posts: 5715
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Synology - script doesn't work

Post by waltervl »

What is in /opt/domoticz (ls /opt/domoticz) from within the docker container? Is there a scripts folder? And what is in scripts?

Then use could use /opt/domoticz/scripts/relay_ch1_on.sh as action
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

waltervl wrote: Wednesday 05 January 2022 13:11 What is in /opt/domoticz (ls /opt/domoticz) from within the docker container? Is there a scripts folder? And what is in scripts?

Then use could use /opt/domoticz/scripts/relay_ch1_on.sh as action
Here what there is inside "/opt/domoticz/scripts/":
Attachments
Untitled.jpg
Untitled.jpg (200.09 KiB) Viewed 159953 times
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

fabry91 wrote: Wednesday 05 January 2022 13:10
EddyG wrote: Wednesday 05 January 2022 13:04 I have no idea, because I don't know you setup. "domoticz" is an other dir then "Domoticz", or did you mistype the "D"?
I mistype the "D", the setup it seems correct because also the container volume path is "/opt/domoticz/userdate/", maybe I need to copy the scripts file in "/volume1/docker/domoticz/scripts" to "/opt/domoticz/scripts" folder?
So add /volume1/docker/Domoticz/scripts with /opt/domoticz/scripts to the path in the docker GUI on the Synology.
Keep in mind that you have to change the action path in Domoticz too.
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

EddyG wrote: Wednesday 05 January 2022 15:10
fabry91 wrote: Wednesday 05 January 2022 13:10
EddyG wrote: Wednesday 05 January 2022 13:04 I have no idea, because I don't know you setup. "domoticz" is an other dir then "Domoticz", or did you mistype the "D"?
I mistype the "D", the setup it seems correct because also the container volume path is "/opt/domoticz/userdate/", maybe I need to copy the scripts file in "/volume1/docker/domoticz/scripts" to "/opt/domoticz/scripts" folder?
So add /volume1/docker/Domoticz/scripts with /opt/domoticz/scripts to the path in the docker GUI on the Synology.
Keep in mind that you have to change the action path in Domoticz too.
Added folder "docker/domoticz/scripts" with mount path "opt/domoticz/scripts" but same result:
Attachments
domo.jpg
domo.jpg (22.53 KiB) Viewed 159934 times
container.jpg
container.jpg (52.06 KiB) Viewed 159934 times
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

same typo "domoticz" -> "Domoticz" in scripts action path in Domoticz
AND you should change the path.

Remember: Inside docker path start with /opt/domoticz
Outside docker path start with /volume1/docker/Domoticz
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Synology - script doesn't work

Post by fabry91 »

EddyG wrote: Wednesday 05 January 2022 15:24 same typo "domoticz" -> "Domoticz" in scripts action path in Domoticz
AND you should change the path.

Remember: Inside docker path start with /opt/domoticz
Outside docker path start with /volume1/docker/Domoticz
Yes, check, everything is right?
Attachments
container.jpg
container.jpg (52.32 KiB) Viewed 159929 times
domo.jpg
domo.jpg (34.83 KiB) Viewed 159929 times
domologs.jpg
domologs.jpg (37.58 KiB) Viewed 159929 times
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - script doesn't work

Post by EddyG »

It should be:

Code: Select all

script:///opt/domoticz/scripts/relay....
because Domoticz is inside docker and using paths like /opt/domoticz/.....

You could check what the right path is by going inside docker.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest