Giter Club home page Giter Club logo

zwave2mqtt-docker's Introduction

Zwave2Mqtt-docker

Pulls Build Image size

Buy Me A Coffee

Docker container for Zwave2Mqtt Gateway and Control Panel app using pkg

Image size acually is lower than 80MB

daniel@daniel:~/Zwave2Mqtt-docker$ docker images
REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE
robertslando/zwave2mqtt         latest              043a0d327ad6        2 minutes ago       76.7MB

Tags

Supported architectures are:

  • x86_64 amd64
  • armv6
  • armv7 (Ex. Raspberry PI)
  • arm64 (Ex. OrangePI NanoPI)

Available Tags:

  • latest: Always points to the latest version published
  • 2.0.6: OZW 1.4
  • 2.0.6-dev: OZW 1.6.962

Install

Here there are 3 different way to start the container and provide data persistence. In all of this solutions remember to:

  1. Replace /dev/ttyACM0 with your serial device
  2. Add -e TZ=Europe/Stockholm to the docker run command to set the correct timezone in container

Run using volumes

docker run --rm -it -p 8091:8091 --device=/dev/ttyACM0 --mount source=zwave2mqtt,target=/usr/src/app/store robertslando/zwave2mqtt:latest

Run using local folder

Here we will store our data in the current path ($(pwd)) named store. You can choose the path and the directory name you prefer, a valid alternative (with linux) could be /var/lib/zwave2mqtt

mkdir store
docker run --rm -it -p 8091:8091 --device=/dev/ttyACM0 -v $(pwd)/store:/usr/src/app/store robertslando/zwave2mqtt:latest

Run as a service

To run the app as a service you can use the docker-compose.yml file you find on github repo. Here is the content:

version: "3.7"
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:
# volumes:
#   zwave2mqtt:
#     name: zwave2mqtt

Like the other solutions, remember to replace device /dev/ttyACM0 with the path of your USB stick and choose the solution you prefer for data persistence.

Upgrade from 1.0.0 to 1.1.0

In 1.0.0 version all application data where stored inside the volume. This could cause many problems expectially when upgrading. To prevent this, starting from version 1.1.0 all persistence data have been moved to application store folder. If you have all your data stored inside a volume zwave2mqtt this is how to backup them:

APP=$(docker run --rm -it -d --mount source=zwave2mqtt,target=/usr/src/app robertslando/zwave2mqtt:latest)
docker cp $APP:/usr/src/app ./
docker kill $APP

This will create a directory app with all app data inside. Move all files like OZW_log.txt zwscene.xml zwcfg_<homehex>.xml in app/store folder and use that folder as volume following this section

ATTENTION

If you get the error standard_init_linux.go:207: exec user process caused "exec format error" probably it's because you previously installed a wrong architecture version of the package so in that case you must delete the existing volume that contains the old executable:

docker volume rm zwave2mqtt

Check files inside volume

docker run --rm -it --mount source=zwave2mqtt,target=/usr/src/app robertslando/zwave2mqtt:latest find /usr/src/app

Delete Volume

docker volume rm zwave2mqtt

Custom builds

Docker images contains latest stable images of zwave2mqtt repo. If you want to keep your image updated with latest changes you can build it on your local machine. Just select a commit and replace existing commit in Dockerfile here

git clone https://github.com/robertsLando/Zwave2Mqtt-docker.git
cd Zwave2Mqtt-docker
sed -i "s|<actualCommit>|<newCommit>|g" Dockerfile
docker build -t robertslando/zwave2mqtt:latest .

Build just the build container

docker build --target=build -t robertslando/zwave2mqtt_build .

SSH inside container

docker run --rm -p 8091:8091 --device=/dev/ttyACM0 -it --mount source=zwave2mqtt,target=/usr/src/app robertslando/zwave2mqtt:latest sh
docker run --rm -p 8091:8091 --device=/dev/ttyACM0 -it --mount source=zwave2mqtt,target=/dist/pkg robertslando/zwave2mqtt_build sh

zwave2mqtt-docker's People

Contributors

robertslando avatar iblis82 avatar seletz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.