Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

smaus
Posts: 84
Joined: Sunday 18 February 2018 9:32
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by smaus »

Does somebody have te garbagecalendar by jvanderzande running in a synologydocker?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by waltervl »

Just a note that it is now possible to use stable and beta images: https://hub.docker.com/r/domoticz/domoticz/tags
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by Gravityz »

i have been running the docker container without problems for a while.

lately i discovered a problem involving mosquitto

in the old setup i had domoticz running as a package on synology and also mosquitto running as a package.
Since this was the same host i could easilly run mosquitto_pub in a dzvents script by using os execute

now that i have moved to the docker container i discovered that the script can not find mosquitto_pub anymore
this makes sense because the container can only see it's own filesystem and that of the mount points.
copying mosquitto to a mount point obviously does not solve it.

any ideas how i can execute mosquitto_pub from within the docker container?
is it possible/smart to install mosquitto inside the same docker container?

i know i can do apt-get install mosquitto but where does it get installed?

thanks
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by Gravityz »

solved it myself
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by EddyG »

Nice, tell others so they can enjoy your solution too.
General rule with docker is: do not us 127.0.0.1 but only ip addresses like 192.168.x.x
An other rule is: do not install anything inside the docker container, because it is lost when ever you upgrade with an new image.
User avatar
laco
Posts: 86
Joined: Tuesday 30 October 2018 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: Slovensko
Contact:

Domoticz-Google Plugin

Post by laco »

Plugin:
https://github.com/dnpwwo/Domoticz-Google-Plugin
https://easydomoticz.com/forum/viewtopic.php?t=10297

I'm trying to install this plugin to send sound notifications to chromecast devices.
After installation we will print this error.

Code: Select all

2021-11-12 15:17:04.385 Error: google: (GoogleDevs) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/Domoticz-Google-Plugin-master/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2021-11-12 15:17:04.385 Error: google: Module Import failed, exception: 'ModuleNotFoundError'
2021-11-12 15:17:04.385 Error: google: Module Import failed: ' Name: pychromecast'
2021-11-12 15:17:04.385 Error: google: Error Line details not available.
2021-11-12 15:17:04.385 Error: google: Exception traceback:
2021-11-12 15:17:04.386 Error: google: ----> Line 103 in '/opt/domoticz/userdata/plugins/Domoticz-Google-Plugin-master/plugin.py', function <module>
Does anyone have it running in Synology dockers?
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by Gravityz »

Hi Eddy,
i do not agree with that last rule.
the problem with docker is that it runs in it's own container which makes it really hard to communicate or execute commands outside the container.
Because i have a MQTT broadcast script which relies on the local mosquitto_pub command it is almost impossible to use this.

as a workaround i installed mosquitto inside the docker container, not that difficult and it solves my problem.
indeed whenever i upgrade the container i need to install it again but it is just 1 line of code.

so i run internal
curl
mosquitto

to startup mosquitto whenever i start domoticz i modified the docker-entrypoint.sh with this
#!/bin/bash
echo 'Starting Mosquitto'
/usr/sbin/mosquitto -d

my question is,is this a solid solution or should i this differently? building a new image with al these changes sounds like a lot more work


EddyG wrote: Wednesday 10 November 2021 16:27 Nice, tell others so they can enjoy your solution too.
General rule with docker is: do not us 127.0.0.1 but only ip addresses like 192.168.x.x
An other rule is: do not install anything inside the docker container, because it is lost when ever you upgrade with an new image.
Last edited by Gravityz on Saturday 04 December 2021 17:14, edited 1 time in total.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by EddyG »

If you use dzVents in Domoticz to execute the mosquitto_pub command you could use "named pipe"
Here is an explanation and example https://stackoverflow.com/questions/321 ... -container
Scroll down to "Update"
You could send your mosquitto_pub command to a standalone mosquitto server, you could even put your mosquitto server in a container.
This solution only needs a listener on the host system, the mkfifo command is included in the Domoticz container.
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by Gravityz »

thanks for thinking about this
that looks like a way to do it but with all the things i need to change i probably stick to my solution

apt-get install mosquitto && apt-get install mosquitto-clients

sure mosquitto and domoticz are running in the same container but they normally work closely hand in hand so this should not be a problem

i put everything in 1 script(accessible from userdata) which does all the installing of the packages and also installs plugins
If they include the plugin manager in the default docker image(and fix the fact that it needs to install in userdata) i can skip the manual plugin installation

EddyG wrote: Thursday 25 November 2021 19:01 If you use dzVents in Domoticz to execute the mosquitto_pub command you could use "named pipe"
Here is an explanation and example https://stackoverflow.com/questions/321 ... -container
Scroll down to "Update"
You could send your mosquitto_pub command to a standalone mosquitto server, you could even put your mosquitto server in a container.
This solution only needs a listener on the host system, the mkfifo command is included in the Domoticz container.
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by gielie »

I’ve been trying to switch from my pi to the synology docker but I experience a lot of problems.
Domoticz itself runs fine but my Zigbee devices don’t.
For Zigbee I need an MQTT container, zigbee2MQTT container and the python plugin.
What works is adding a Zigbee device trough the plug-in in Domoticz, als I get updates but switching a button on/off won’t work. So it seems there is only a 1 way communication that works.

Is there someone with a clear tutorial how to install these containers the proper way and get this to work?
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by Stormryder »

Added an extra part in original post regarding updating to 2022.01, plus a way to check which python version the container uses and how to change the default version (not visible in quote below).

Stormryder wrote: Friday 26 February 2021 13:44 Updating to 2022.01 (added Feb. 05 2022)
Updating the Domoticz-docker to version 2022.01 works great when using the following steps (thanks to @Gravityz):

From the synology user interface go to docker-container and select the domoticz container
Stop it and rename it to "domoticz-old"
Next go to Register and search the "domoticz/domoticz" image
Choose 'Latest' (or 2022.01) and download it. This will replace the current image with the new, updated one (version 2022.01)
When download is finished go back to the old container domoticz-old and right click to get options from this old container
Choose 'settings duplicate' and name the new container 'Domoticz' and finally start it.

Important after updating; you need to redo the 'Python and Curl plugins/scripts' part of this tutorial
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by waltervl »

Curl should be already installed on the image.
And latest is latest BETA
If you want to update to latest stable you have to use tag stable.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by Stormryder »

waltervl wrote: Saturday 05 February 2022 9:39 Curl should be already installed on the image.
And latest is latest BETA
If you want to update to latest stable you have to use tag stable.
Thanks, added a few words in main post just to make it clear.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by waltervl »

Thanks, also the Domoticz install on Synology wiki has been updated with docker install instructions. See https://www.domoticz.com/wiki/Synology
So also wise the refer to that for first time install.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Stormryder
Posts: 31
Joined: Friday 23 August 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by Stormryder »

waltervl wrote: Saturday 05 February 2022 10:35 Thanks, also the Domoticz install on Synology wiki has been updated with docker install instructions. See https://www.domoticz.com/wiki/Synology
So also wise the refer to that for first time install.
Done, thanks again.
dens1975
Posts: 26
Joined: Monday 12 February 2018 17:03
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by dens1975 »

I'm upgraded to DSM7 and running Domoticz in docker. I got my P1 smart meter and rfxcom running but my Open Zwave USB isn't working. I get a driver failed error.
Is there another driver to load? What can I check?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by waltervl »

dens1975 wrote: Tuesday 08 February 2022 22:02 I'm upgraded to DSM7 and running Domoticz in docker. I got my P1 smart meter and rfxcom running but my Open Zwave USB isn't working. I get a driver failed error.
Is there another driver to load? What can I check?
Did you check the wiki section about drivers https://www.domoticz.com/wiki/Synology
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
dens1975
Posts: 26
Joined: Monday 12 February 2018 17:03
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by dens1975 »

Did you check the wiki section about drivers https://www.domoticz.com/wiki/Synology

Yes I did the Jadahl driver install but I don't have my /dev/ttyACM0 port on which my zwave usb was active.
dens1975
Posts: 26
Joined: Monday 12 February 2018 17:03
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by dens1975 »

I found out that Synology DSM 7 does not support external USB devices and their drivers. USB devices (Wi-Fi dongle, Bluetooth dongle, 3G/4G dongle, USB DAC/speaker, and DTV dongle) are no longer supported in DSM 7.0

This solved my issue: https://mariushosting.com/synology-how- ... -on-dsm-7/

Maybe something to mention in the wiki?
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Synology - guide to switch from Jadahl package to official docker (domoticz-docker)

Post by Gravityz »

this should work as well and if it does is a better solution
you need root access to your synology to create the conf file

the loader script is not necessary.
DSM7 comes with systemd as the service manager. One of the supplied services is systemd-modules-load.service, which can ensure loading the modules.
So all you need is a single .conf file containing a list of wanted modules in /etc/modules-load.d/ and they will be loaded at boot (or whenever systemd-modules-load service is loaded)

In /etc/modules-load.d/

create file
75-usb-serial.conf (this number needs to be higher than usb-kernel.conf)
usbserial.ko
ftdi_sio.ko
cdc-acm.ko


after that reboot
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests