Easiest way to migrate Openzwave to ZWave-JS-UI

For Z-Wave related questions in Domoticz

Moderator: leecollings

User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by waltervl »

Code: Select all

- "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by Dave47 »

Did not work. The same problem.
Must i install zwave-js-ui first?
Where can i place the file:

Code: Select all

version: '3.7'
services:
  zwave-js-ui:
    container_name: zwave-js-ui
    image: zwavejs/zwave-js-ui: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 instead of UTC
      # Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      #- TZ=America/New_York
    networks:
      - zwave
    devices:
      # Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
      # Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
      - '/dev/serial/by-id/insert_stick_reference_here:/dev/zwave'
    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
And which directory i have to make?
Last edited by Dave47 on Friday 17 March 2023 15:35, edited 1 time in total.
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by thomasbaetge »

First, from what I found so far, you can connect the USB device only to either domoticz OZW or ZWJS at a time.

For installation of zwave-js-ui with docker do as follows (other options may work too, but this is how I did it and it works)

Assuming you're on a Raspberry or other Linux device
Create a directory for Docker (in your users home dir, no need for root)

Code: Select all

mkdir docker
Within that, create a subdir for zwave-js-ui

Code: Select all

cd docker
mkdir zwjs
within that folder, place your docker-compose.yaml

Within that directory, create another one for data storage

Code: Select all

cd zwjs
mkdir store

in the YAML under volumes, enter your created store path:

like I did, please adjust your path, unless your name is thomas :)

Code: Select all

  volumes:
      - /home/thomas/docker/zwjs/store:/usr/src/app/store
You also should adjust the TZ settings (unless you are in the US)

save it and fire it up with:

Code: Select all

docker compose up -d
wait for it to finish (pull and build container), go to your browser and enter <IP of machine>:8091 and you should be presented with the UI.
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by thomasbaetge »

waltervl wrote: Friday 17 March 2023 14:46

Code: Select all

- "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
or maybe

Code: Select all

'/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0'
Assuming that is the correct path for your device.
I am not sure, if " instead of ' will work propperly in a YAML file (but I may be wrong)
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by MikeyMan »

thomasbaetge wrote: Friday 17 March 2023 15:33 First, from what I found so far, you can connect the USB device only to either domoticz OZW or ZWJS at a time.
Correct. So disable plugin first.
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by Dave47 »

When i try in opt/domoticz
docker compuse up -d
The same output

I disabled ozw.
Is it maybe from paring devices secure on that stick?
Must i install zwave-js-ui first to try 3.3 dockers?
In dockers ik have to set the serial device byid and in zwave-js-ui the same?
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by waltervl »

@Dave47, see the wiki (after you have installed Domoticz):
Follow the wiki: https://www.domoticz.com/wiki/Zwave-JS-UI
Basic steps:

- Install a MQTT Broker eg Mosquitto (if not already present in your network or on Domoticz server), see wiki page MQTT for installation instructions.
- Install Zwave JS UI on your Domoticz server and plug in your Zwave stick. See instructions https://zwave-js.github.io/zwave-js-ui/ ... uick-start
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by Dave47 »

Ok i read that but docker gives every time the same problem
Dockers is the first step?
Or must i also install zwave-js-ui next to it?
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by thomasbaetge »

Dave,

I am not sure how to actually help you. It seems to me, that it is all a little bit blurry to you.
So let's take one step back:
What system are you running? I assume Linux, are you using a Raspberry?
Second: do you have a working domoticz installation on that (including working OZW)?
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by Dave47 »

Yes. Raspberry pi 3b
Domoticz 2023.1
And ozw working.
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by thomasbaetge »

Great, it's not all too bad then :)

So let's forget domoticz and OZW for now (no need to touch any of them for now).

let's check your docker installation:
ssh into your Raspberry and issue

Code: Select all

which docker compose
result should be smth like:
/usr/bin/docker
/usr/bin/compose

if it is, that is out of the way too.
next step is to 'install' zwjs. it is not really an installation, all you require for that is a folder structure and a YAML file, as I described earlier.
or you follow the link that walter gave.
if you got that, please confirm, as I asked before, that your USB device ID actually exists in your system. Instructions how to do so, please see before.
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by JuanUil »

JuanUil wrote: Saturday 24 December 2022 16:13 HI all,

I also have struggeld a lot with switching to ZWave-JS-UI.
But now all is working verry well and better then in OZW.
I have made a tutorial to complete install.
For the moment it is only in Dutch and maybe not complete.
Coming time I will translate and update.
you can download it from :
https://mega.nz/file/3JxQ3Y7R#LIFf5wcVo ... KTAX1e5dFA

good luck!

Jan
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by thomasbaetge »

Dave47 wrote: Friday 17 March 2023 14:38 Did not work. "dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
Is that with " or only ' and /dev or dev?
oops, just saw that.
Correctly it has to be:

Code: Select all

- '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
with the / in front of dev and in ' instead of ".
did you try that?
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by Dave47 »

Ok i have which docker compose
/usr/bin/docker
/usr/bin/compose

So i can forget that error from yaml file in opt/domoticz?
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by thomasbaetge »

nope. that is still not good.
I give you my docker-compose.yaml with commented filepath for testing.
Place that somewhere in a subfolder under your user (not in /opt or elsewhere) and try to fire it up with

Code: Select all

docker compose up
don't use the -d option, so you see what is going on there.

the file:

Code: Select all

version: '3.7'
services:
  zwave-js-ui:
    container_name: zwave-js-ui
    image: zwavejs/zwave-js-ui:latest
    restart: unless-stopped
    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 instead of UTC
      # Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      - TZ=Europe/Berlin
    networks:
      - zwave
    devices:
      # Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
      # Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
      - '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
    volumes:
      #- /home/thomas/docker/zwjs/store:/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
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by Dave47 »

- '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
Did not work in docker version 3.3
Tommorow i try your docker-compose.ym 3.7l in user
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by Dave47 »

@ Thomasbeatge

I have put docker-compose.yml file in zwjs or schould i put it in dockers folder?

This is goin on

Code: Select all

pi@raspberrypi:~/docker/zwjs $ docker compose up
[+] Running 1/2
 ⠿ Network zwjs_zwave     Created                                                                                                                                                                                                       0.2s
 ⠋ Container zwave-js-ui  Creating                                                                                                                                                                                                      0.0s
Error response from daemon: Conflict. The container name "/zwave-js-ui" is already in use by container "2ff5a4ecc2339b259469fef1e9d8d3b8d04dbabcfd55ca553a8dc57b81a08b6b". You have to remove (or rename) that container to be able to reuse that name.
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by thomasbaetge »

I would put it into zwjs but it doesn't really matter.
Just keep it a bit separated, especially the folder where you store your data.

I found it a good practice to create a 'docker' folder in my user and then a subfolder for every image I am running.

As for your error message, you are already running a container with the same name
try docker compose ls to check for running instances and terminate with docker compose down.
Dave47
Posts: 136
Joined: Thursday 19 July 2018 14:36
Target OS: -
Domoticz version: 2023.1
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by Dave47 »

Ok. I See

pi@raspberrypi:~ $ docker compose ls
NAME STATUS CONFIG FILESdomoticz running(1) /opt/domoticz/docker-compose.yml


I dont understand. I have removed this morning docker-compose.yml from /opt/domoticz
I did sudo rm docker-compose.yml
But how can i stop this: docker compose down ? And container name?
It is running after i removed this morning. Wrong way to remove the file?
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: Easiest way to migrate Openzwave to ZWave-JS-UI

Post by thomasbaetge »

But that is your domoticz container, that is under a different name (I hope).

maybe you do some digging into the docker compose documentation:
https://docs.docker.com/compose/

If that doesn't help, it may be worth opening a separate thread for your issue because we're kinda 'hijacking' this thread already for your problem ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest