Migrating to Docker and Shell scripts & Z-Wave

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

Moderator: leecollings

Post Reply
gbonny
Posts: 27
Joined: Friday 27 October 2017 22:08
Target OS: Linux
Domoticz version:
Contact:

Migrating to Docker and Shell scripts & Z-Wave

Post 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.
Domoticz 2024.7 on Ubuntu 22.04 LTS VM on ESXi 7
SolarEdge Web API, P1 meter, RFXCOM433E, OpenZWave via ZMEEUZB1, MQTT AD Client Gateway ZWave-JS-UI, Philips Hue bridge, Kodi Media server, Panasonic TV, OWM, BuienRadar and HTTP/HTTPS poller Watermeter
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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.
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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 ?
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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 ;) .
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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/ ?
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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 ?
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post by heggink »

Any errors during requirements installation (sudo pip3 install requirements.txt)?

Sent from my SM-G980F using Tapatalk

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post by heggink »

@moroen any new requirements that may not have made it into requirrments.txt?

Sent from my SM-G980F using Tapatalk

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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.
User avatar
waltervl
Posts: 5734
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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 ..
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post by mgugu »

MQTT shows the topic
zwave/Nodon_net2/37/0/currentValue
and a value
{"time":1624551125840,"value":true,"nodeName":"Nodon net2","nodeLocation":"Bureau"}
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post by mgugu »

Disabling "Use nodes name instead of numeric nodeIds" is mandatory.
Everything is OK now
Thank all
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Migrating to Docker and Shell scripts & Z-Wave

Post 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

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest