Page 1 of 1
Migrating to Docker and Shell scripts & Z-Wave
Posted: Monday 17 May 2021 13:17
by gbonny
I'm looking forward into migrating to Domoticz 2021.1 in a Docker container preferably. Currently I'm running 2020.2 on Ubuntu 18.04 LTS.
The best way, I think, is to upgrade Ubuntu 18.04 to 20.04 first and then upgrade Domoticz 2021.1. Then export database/settings from Domoticz 2021.1 VM to Domoticz 2021.1 Docker container. To keep the database differences to a minimum. And then reconnect my USBs P1 meter, RFXCOM433 & ZWave.me to the container.
Now I've read topic "Using Docker and userscripts (Lua, DzVents, Python)"
https://domoticz.com/forum/viewtopic.php?f=47&t=35834 because I've had similar questions.
I'm running a shell script notify_xmpp.sh (
https://www.domoticz.com/wiki/Installin ... ion_System ) and would like to move it to /opt/domoticz/userdata preferably. Of course I could try to migrate the shell script to a Python script using the Domoticz interface so it's stored in the database. However I'm not sure this is feasible.
The other thing I'm wondering about is where to place the openz-wave files in the new container. On the current system they are located in /home/domoticz/domoticz/Config/ozwcache_random.xml & zwscene.xml
Will it work from /opt/domoticz/userdata/config like domoticz.db ?
(I don't want to rebuild my complete Z-Wave network.)
I've followed the docker-compose example on:
https://registry.hub.docker.com/r/domoticz/domoticz
So I have a container running already.
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Wednesday 19 May 2021 10:29
by mgugu
I tried Domoticz/docker and I gave up quickly since it looks live there are too many adaptations to perform manually (scripts, GPIO, zwave..).
In addition, from a pure maintenance point of view, I think the best option is to keep Domoticz as it is since there is only one folder to backup without additional operation.
Regarding zwave there is a promising option: zwavejs2mqtt running on docker. This allows zwave IO via mqtt, becoming independant of Domoticz.
Waiting for more info regarding automated migration from OZW and support fo new devices.
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Wednesday 19 May 2021 12:12
by heggink
That is also my challenge: too many dependencies that have to be installed again every time I would update the docker container to a new release (install system utilities, install python dependencies for many plugins, fix ssh keys to passwordless ssh into other systems).
Re zwavejs2mqtt, @moroen and I have been developing a plugin for that. We both already dropped OZW in favour of the plugin and zwavejs2mqtt for many weeks now so I would say its more than an alpha release BUT it provides support for the devices we own and is therefore limited in zwave classes it currently supports as well as teh 256 device limit imposed by the python plugin framework. Adding new classes should be fairly simple (we managed to do that in our case pretty quickly) and with no breaking changes. Also, a change to have multiple plugin instances all focused on their own device classes should be simple which then provides a good workaround for the 256 device limit.
In my experience, zwavejs is a lot more functional and less issues than OZW1.6. For one, I can now easily delete dead devices which I never managed in OZW (they kept popping up every time I restarted). The zwavejs2mqtt web interface also is really effective. Lastly, I very much like the fact that its been running independently in it's own container without ANY issues for quite a while. I can do with domoticz whatever I want without any impact on zwave. I also run zigbee2mqtt in its own container using the same mqtt broker. Updating either of them is a breeze and performance is excellent.
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Wednesday 19 May 2021 13:28
by mgugu
Nice to see you have developped a plugin for zwavejs2mqtt. I'll give it a try. Is
https://github.com/moroen/ZWave-MQTT-plugin the right source ?
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Wednesday 19 May 2021 14:16
by heggink
Yes, that's it! Most credits to @moroen who did the heavy lifting.
One thing missing from the readme: make sure you switch OFF retain in the mqtt settings otherwise the broker will retain the last message per device. Whilst it's a great and helpful feature, the downside is that it also retains messages for deleted devices. You would then have to manually delete those.
Also: please look at the supported zwave classes list to ensure that any and all of your devices are supported.
Other than that, I am really, really happy with it

.
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Wednesday 19 May 2021 16:36
by mgugu
Thank you for these informations. Where can I find the devices compatibility dB ? Is it the same as for Z-Wave JS:
https://devices.zwave-js.io/ ?
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Wednesday 19 May 2021 16:50
by heggink
For zwavejs2mqtt, yes but the plugin is limited to certain zwave classes/device types. The readme lists these. My smoke sensors, pir, lux humidity, contact, thermostat, switches, remotes and so on all work tho.
Sent from my SM-G980F using Tapatalk
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Tuesday 25 May 2021 21:21
by heggink
mgugu wrote:Thank you for these informations. Where can I find the devices compatibility dB ? Is it the same as for Z-Wave JS:
https://devices.zwave-js.io/ ?
@mgugu Did you manage to give it a go?
Sent from my SM-G980F using Tapatalk
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 16:41
by mgugu
Hello @heggink, I just tried that solution. Here is my feedback:
To avoid problem on my working Openzwave network I created a second zwave network for test with a cheap zwave 500 dongle
Installed the gateway on docker and then included a node (a smart plug).
Everything works fine, with no interference between the 2 networks prooving the robustness of zwave protocol.
BUT...
Problems come with Domoticz:
Installed the plugin according to the wiki, restarted Domoticz, installed new hardware and now I get an error:
Code: Select all
Error: Zwave2MQTT: (ZWave-MQTT) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/ZWave-MQTT/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-
plugin.py is however located at the indicated path and Domoticz python version is 3.7.3.
Some hint ?
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 17:17
by heggink
Any errors during requirements installation (sudo pip3 install requirements.txt)?
Sent from my SM-G980F using Tapatalk
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 17:19
by heggink
@moroen any new requirements that may not have made it into requirrments.txt?
Sent from my SM-G980F using Tapatalk
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 17:28
by mgugu
heggink wrote: ↑Thursday 24 June 2021 17:17
Any errors during requirements installation (sudo pip3 install requirements.txt)?
Sent from my SM-G980F using Tapatalk
No problem with the "pip3 install requirements.txt" after changing working directory to Zwave-MQTT.
I am running also in Domoticz the zigbee2MQTT plugin with no issue so I dont suspect a python configuration problem.
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 17:38
by waltervl
mgugu wrote: ↑Thursday 24 June 2021 16:41
Installed the plugin according to the wiki, restarted Domoticz, installed new hardware and now I get an error:
Code: Select all
Error: Zwave2MQTT: (ZWave-MQTT) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/ZWave-MQTT/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-
plugin.py is however located at the indicated path and Domoticz python version is 3.7.3.
Some hint ?
As already mentioned use
sudo pip3 install requirements.txt
https://www.domoticz.com/wiki/Using_Pyt ... ules_Fails
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 17:58
by mgugu
waltervl wrote: ↑Thursday 24 June 2021 17:38
mgugu wrote: ↑Thursday 24 June 2021 16:41
Installed the plugin according to the wiki, restarted Domoticz, installed new hardware and now I get an error:
Code: Select all
Error: Zwave2MQTT: (ZWave-MQTT) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/ZWave-MQTT/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-
plugin.py is however located at the indicated path and Domoticz python version is 3.7.3.
Some hint ?
As already mentioned use
sudo pip3 install requirements.txt
https://www.domoticz.com/wiki/Using_Pyt ... ules_Fails
That was my mistake, error has disappeared now thank you, trying now to include devices ..
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 18:08
by mgugu
Trying to install a device (simple On/Off switch), I get the info (not an error):
Zwave2MQTT: (Zwave2MQTT) Command Class None with type None is unknown
In the gateway the topic type is set to ValueIDtopics, and the payload type to JSON Time-Value
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 18:14
by mgugu
MQTT shows the topic
zwave/Nodon_net2/37/0/currentValue
and a value
{"time":1624551125840,"value":true,"nodeName":"Nodon net2","nodeLocation":"Bureau"}
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 18:19
by heggink
mgugu wrote:Trying to install a device (simple On/Off switch), I get the info (not an error):
Zwave2MQTT: (Zwave2MQTT) Command Class None with type None is unknown
In the gateway the topic type is set to ValueIDtopics, and the payload type to JSON Time-Value
You can ignore these.
Sent from my SM-G980F using Tapatalk
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 18:20
by mgugu
Disabling "Use nodes name instead of numeric nodeIds" is mandatory.
Everything is OK now
Thank all
Re: Migrating to Docker and Shell scripts & Z-Wave
Posted: Thursday 24 June 2021 22:18
by heggink
mgugu wrote:Trying to install a device (simple On/Off switch), I get the info (not an error):
Zwave2MQTT: (Zwave2MQTT) Command Class None with type None is unknown
In the gateway the topic type is set to ValueIDtopics, and the payload type to JSON Time-Value
Btw, feel free to report these on GitHub.
Sent from my SM-G980F using Tapatalk