Since version 7.0 of Synology OS, it’s not possible to use external usb devices (such as zwave sticks)
So I migrated my zwavejs2mqtt environment to an external raspberry pi (using docker)
The migration didn’t go smoothly, it renamed all my entities in HA, so I was busy for about 3 hours renaming all entities in the scripts, automations and UI’s
This was months ago
Now:
I am about to cry… I’ve updated HA to version 2022.4.5 today. After the update my Zwave integration was not working anymore, because it needs a newer version of zwavejs2mqtt. So I tried to update the docker container (I’m a completely noob in docker environment, I’m just following tutorials). In this case, I followed this tutorial: Learn How To Update Docker Images Easily and Quickly
The problem is, after removing the container and re-running it with the new tag (I’m now using direct tags instead of latest), all configurations, settings and nodes in zwavejs2mqtt were lost again!
Is there any way to restore my old stand?
I’ve downloaded the whole content of “Store” before as backup, is there any way to restore that?
On the PI, I can find the following files: “zwavejs2mqtt/docker-compose.yml”. Is this my old configuration? How could I use this?
I dont run my HA and zwave2mqtt in docker, but for things i do run in docker, I usually have stuff like config files and what not mapped to an external directory. what does your docker environment look like?
I would definitely say all is not lost if you have the store directory backed up somewhere. The key is your docker run command or compose needs to properly and exactly specify the volume mapping to where that store directory (and your config files) is. That is how the docker “persists” the storage in between containers being removed/upgraded. How did you install the container - Are you just using a run command or a compose?
I use compose, and my compose looks like this. Be sure to replace PATHTOYOURFILES with the exact path to your store directory. If you haven’t put that store directory back on the RPI, get those files on there in a directory you can map the docker volume to. You can put the files in your home/USER/zwaveconfig directory and for example , the PATHTOYOURFILES would be something like /home/raptor05/zwaveconfig:
I have a docker-compose.yml file in a folder “zwavejs2mqtt”. The content is:
version: '3.7'
services:
zwavejs2mqtt:
container_name: zwavejs2mqtt
image: zwavejs/zwavejs2mqtt:latest
restart: always
tty: true
stop_signal: SIGINT
environment:
- SESSION_SECRET=mysupersecretkey
- ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
# Uncomment if you want logs time and dates to match your timezone instea>
# Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zon>
#- TZ=America/New_York
networks:
- zwave
devices:
# Do not use /dev/ttyUSBX serial devices, as those mappings can change ov>
# Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stic>
- '/dev/ttyACM0:/dev/ttyACM0'
volumes:
- zwave-config:/usr/src/app/store
ports:
- '8091:8091' # port for web interface
- '3000:3000' # port for Z-Wave JS websocket server
networks:
zwave:
volumes:
zwave-config:
name: zwave-config
Where do I find this zwave-config folder on the PI? I have no clue about linix OS. My wisdom about that stuff ends after “cd” and “ls”… Also I absolutly don’t know how to interact with the nano editor…
And how do I start the container using that compose config file?
That portainer container sounds interesting is there any easy to understand tutorial out there?
SSH into the machine or hook up a monitor and keyboard. An alternative would be to install and configure SAMBA so you can navigate the folders on the PI from a windows machine using the file explorer.
At the command line, navigate to the root directory
cd /
Then do a find - look for nodes.json which is a file that would be in the zwavejs2mqtt store directory
find . -name nodes.json
It may find more then one if you setup zwavejs2mqtt and specified different paths. You can navigate to the directory to see the other files and view the file, or just do trial and error through all of the paths. You will Note the directory it is in.
Once you have portainer running, you can then put the compose in a stack in the UI instead of a compose file - no command line needed. The only time you will need the command line is if you need to change or update the portainer container itself (it can’t manage itself).