Zwave
Zwave
5/2022
Converted from using deprecated zwave handler in Home Assistant to zwave2mqtt.
Then converted to zwavejs2mqtt and using that now
Zwavejs2mqtt
WARNING
After installing, when you go to the
Guide here: https://flemmingss.com/how-to-set-up-zwavejs2mqtt-on-a-raspberry-pi-and-integrate-it-with-home-assistant/
cd ~
mkdir zwavejs2mqtt
cd zwavejs2mqtt
curl -fsSL https://raw.githubusercontent.com/zwave-js/zwavejs2mqtt/master/docker/docker-compose.yml -o docker-compose.yml
Edit compose file
sudo nano docker-compose.yml
I changed TZ (time zone,) and port from 3000 to 3001. I have conflict with 3000
My file contents:
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 instead of UTC
# Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- TZ=America/Los_Angeles
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/ttyACM1:/dev/zwave'
- '/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM1'
# - '/dev/ttyACM1:/dev/zwave'
volumes:
- zwave-config:/usr/src/app/store
ports:
- '8092:8091' # port for web interface
- '3001:3001' # port for Z-Wave JS websocket server
networks:
zwave:
volumes:
zwave-config:
# name: zwave-config
To figure out port
ls -l /dev
Long answer, find. In alphabetical order of last column. My zwave is ttyACM0 and zigbee is ttyUSB0
crw-rw---- 1 root dialout 166, 0 May 30 16:41 ttyACM0
crw-rw---- 1 root dialout 204, 64 May 30 16:41 ttyAMA0
crw------- 1 root root 5, 3 May 30 16:41 ttyprintk
crw-rw---- 1 root dialout 188, 0 May 30 16:41 ttyUSB0
To install, run from zwavejs2mqtt directory
docker-compose up -d
Setup
On a browser, to go
http://ip addr of docker pi:8091/
http://ip addr of docker pi:8092/
It will bring up zwave2mqtt webpage
Go to settings,
zwave make sure serial port has correct setting to find zwave usb stick, I used /dev/ttyACM1
Turn logging on
mqtt. Enter you mqtt broker info. I set prefix to zwavemqtt so any messages to from this program need that to start
gateway:
Type ValueID topics
Payload Type Just value for normal use Entire zwave object to figure out how things works
Turn on send zwave events
Turn on Hass discovery to see how things work
Zwave2mqtt OLD
To install from command line in docker, run this:
docker run --rm -it -p 8091:8091 --device=/dev/ttyACM0 -e TZ=America/Los_Angeles --mount source=zwave2mqtt,target=/usr/src/app/store robertslando/zwave2mqtt:latest
To install with docker compose, create docker-compose.yml file with the following content:
version: "3.0"
services:
zwave2mqtt:
container_name: zwave2mqtt
image: robertslando/zwave2mqtt:latest
restart: always
tty: true
stop_signal: SIGINT
networks:
- zwave
devices:
- "/dev/ttyACM0:/dev/ttyACM0"
volumes:
- ./store:/usr/src/app/store
ports:
- "8091:8091"
networks:
zwave:
Run this to install
sudo docker-compose up -d
-e TZ=America/Los_Angeles to set time zone for LA America/Los_Angeles
I also changed port from 3000 to 3001 because Grafina uses 3000
change to
- '/dev/serial/by-id/usb-0658_0200-if00'
https://github.com/OpenZWave/Zwave2Mqtt#wrench-usage
https://selfhostedhome.com/migrating-to-zwave2mqtt-for-home-assistant/
Change /dev/ttyACM0
When I added a zigbee stick, my stick address changed to /dev/ttyACM1
I used Portainer to duplicate the zwave2mqtt container, and changed /dev/ttyACM0 to /dev/ttyACM1 in two places, and then started the new container. Portainer deleted the original container, and then started the new one and it all worked