Skip to content

Commit

Permalink
feat: move docs to github pages using docsify (#122)
Browse files Browse the repository at this point in the history
* feat: move docs to docsify

* fix: add some notations

* chore: add docs script

* fix: remove readme stuff

* fix: markdown lint issues

* fix: other lint issues

* fix: remove reverse proxy from quick start

* fix: indentation issue in entity name

* fix: move features to main page, fix broken healthcheck

* fix: add nginx syntax and fixed hass devices image path

* fix: lint issues
  • Loading branch information
robertsLando authored Jan 2, 2021
1 parent 5c511b6 commit 3e9425d
Show file tree
Hide file tree
Showing 32 changed files with 861 additions and 798 deletions.
801 changes: 3 additions & 798 deletions README.md

Large diffs are not rendered by default.

Empty file added docs/.nojekyll
Empty file.
45 changes: 45 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Zwave To MQTT

![GitHub package.json version](https://img.shields.io/github/package-json/v/zwave-js/zwavejs2mqtt)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![MadeWithVueJs.com shield](https://madewithvuejs.com/storage/repo-shields/1897-shield.svg)](https://madewithvuejs.com/p/zwavejs2mqtt/shield-link)
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.png?v=103)](https://opensource.org/licenses/mit-license.php)
[![ci](https://github.com/zwave-js/zwavejs2mqtt/workflows/ci/badge.svg?branch=master)](https://github.com/zwave-js/zwavejs2mqtt/actions?query=workflow%3Aci+branch%3Amaster)
[![Docker Build](https://github.com/zwave-js/zwavejs2mqtt/workflows/Docker%20Build/badge.svg?branch=master)](https://github.com/zwave-js/zwavejs2mqtt/actions?query=workflow%3A%22Docker+Build%22+branch%3Amaster)
[![GitHub All Releases](https://img.shields.io/github/downloads/zwave-js/zwavejs2mqtt/total)](https://github.com/zwave-js/zwavejs2mqtt/releases)
[![Coverage Status](https://coveralls.io/repos/github/zwave-js/zwavejs2mqtt/badge.svg?branch=master)](https://coveralls.io/github/zwave-js/zwavejs2mqtt?branch=master)
[![Known Vulnerabilities](https://snyk.io/test/github/zwave-js/zwavejs2mqtt/badge.svg?targetFile=package.json)](https://snyk.io/test/github/zwave-js/zwavejs2mqtt?targetFile=package.json)
[![Dependencies Status](https://david-dm.org/zwave-js/zwavejs2mqtt/status.svg)](https://david-dm.org/zwave-js/zwavejs2mqtt)
[![devDependencies Status](https://david-dm.org/zwave-js/zwavejs2mqtt/dev-status.svg)](https://david-dm.org/zwave-js/zwavejs2mqtt?type=dev)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/zwave-js/zwavejs2mqtt.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/zwave-js/zwavejs2mqtt/alerts/)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/zwave-js/zwavejs2mqtt.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/zwave-js/zwavejs2mqtt/context:javascript)

[![Join channel](https://img.shields.io/badge/SLACK-zwave2mqtt.slack.com-red.svg?style=popout&logo=slack&logoColor=red)](https://join.slack.com/t/zwave2mqtt/shared_invite/enQtNjc4NjgyNjc3NDI2LTc3OGQzYmJlZDIzZTJhMzUzZWQ3M2Q3NThmMjY5MGY1MTc4NjFiOWZhZWE5YjNmNGE0OWRjZjJiMjliZGQyYmU "Join channel")

[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/MVg9wc2HE "Buy Me A Coffee")

[![dockeri.co](https://dockeri.co/image/zwavejs/zwavejs2mqtt)](https://hub.docker.com/r/zwavejs/zwavejs2mqtt)

<div>
<img src="/_images/zwavejs_logo.svg" width="300" alt="zwavejs">
<span style="font-size: 25px">TO</span>
<img src="/_images/MQTT-Logo.png" alt="mqtt">
</div>

Fully configurable Zwave to MQTT **Gateway** and **Control Panel**.

- **Backend**: [NodeJS](https://nodejs.org/en/), [Express](https://expressjs.com/), [socket.io](https://github.com/socketio/socket.io), [Mqttjs](https://github.com/mqttjs/MQTT.js), [zwavejs](https://github.com/zwave-js/node-zwave-js), [Webpack](https://webpack.js.org/)
- **Frontend**: [Vue](https://vuejs.org/), [socket.io](https://github.com/socketio/socket.io), [Vuetify](https://github.com/vuetifyjs/vuetify)

## Features

- Configurable Zwave to Mqtt Gateway
- Home Assistant integration (**beta**)
- Zwave Control Panel:
- **Nodes management**: check all nodes discovered in the z-wave network, send/receive nodes values updates directly from the UI and send action to the nodes and controller for diagnostics and network heal
- **Custom Node naming and Location**: Starting from v1.3.0 nodes `name` and `location` are stored in a JSON file named `nodes.json`. This because not all nodes have native support for naming and location features ([#45](https://github.com/zwave-js/zwavejs2mqtt/issues/45)). This change is back compatible with older versions of this package: on startup it will get all nodes names and location from the `zwcfg_homeHEX.xml` file (if present) and create the new `nodes.json` file based on that. This file can be imported/exported from the UI control panel with the import/export buttons placed on the top of nodes table, on the right of controller actions select.
- **Firmware updates**: You are able to send firmware updates to your devices using the UI, just select the controller action `Begin Firmware Update`
- **Groups associations**: create associations between nodes (also supports multi-instance associations, need to use last version of zwave-js)
- **Custom scenes management**
- Log debug in UI
- Mesh graph showing devices neighbors
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
30 changes: 30 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!-- markdownlint-disable MD041 -->

- Getting started

- [Introduction](README.md)
- [Quick Start](getting-started/quick-start.md)
- [Why ZwaveJS](getting-started/why.md)

- Usage

- [Setup](usage/setup.md)
- [Behind a Proxy](usage/reverse-proxy.md)

- Guide

- [Mqtt](guide/mqtt.md)
- [Nodes Management](guide/nodes-management.md)
- [Homeassistant](guide/homeassistant.md)
- [Healthcheck](guide/healthcheck.md)
- [Z2M Migration](guide/migrating.md)
- [Env Vars](guide/env-vars.md)
- [FAQ](guide/faq.md)

- Development

- [Introduction](development/intro.md)

- [Screenshots](screenshots.md)
- [Thanks](thanks.md)
- [Author](author.md)
5 changes: 5 additions & 0 deletions docs/author.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Author

[Daniel Lando](https://github.com/robertsLando)

Support me on [Patreon](https://www.patreon.com/user?u=16906849) :heart:
23 changes: 23 additions & 0 deletions docs/development/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Development

Developers who wants to debug the application have to open 2 terminals.

In first terminal run `npm run dev` to start webpack-dev for front-end developing and hot reloading at <http://localhost:8092>
(**THE PORT FOR DEVELOPING IS 8092**)

In the second terminal run `npm run dev:server` to start the backend server with inspect and auto restart features (if you don't have nodemon installed: `npm install -g nodemon`)

To package the application run `npm run pkg` command and follow the steps

## Developing against a different backend

By default running `npm run dev:server` will proxy the requests to a backend listening on _localhost_ on port _8091_.

If you want to run the development frontend against a different backend you have the following environment variables
that you can use to redirect to a different backend:

- **SERVER_HOST**: [Default: 'localhost'] the hostname or IP of the backend server you want to use;
- **SERVER_PORT**: [Default: '8091'] the port of the backend server you want to use;
- **SERVER_SSL**: [Default: undefined] if set to a value it will use _https_/_wss_ to connect to the backend;
- **SERVER_URL**: [Default: use the other variables] the full URL for the backend API, IE: `https://zwavetomqtt.home.net:8443/`
- **SERVER_WS_URL**: [Default: use the other variables] the full URL for the backend Socket, IE: `wss://zwavetomqtt.home.net:8443/`
66 changes: 66 additions & 0 deletions docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Quick start

Actually there are different ways of running Zwavejs2mqtt. Choose the one that best fit your needs

## Docker

The easier one is by using docker:

```bash
# Using volumes as persistence
docker run --rm -it -p 8091:8091 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest

# Using local folder as persistence
mkdir store
docker run --rm -it -p 8091:8091 --device=/dev/ttyACM0 -v $(pwd)/store:/usr/src/app/store zwavejs/zwavejs2mqtt:latest

# As a service
wget https://raw.githubusercontent.com/zwave-js/zwavejs2mqtt/master/docker/docker-compose.yml
docker-compose up
```

> [!NOTE]
> Replace `/dev/ttyACM0` with your serial device
For more info about docker check [here](https://github.com/zwave-js/zwavejs2mqtt/tree/master/docker)

## Kubernetes

```bash
kubectl apply -k https://raw.githubusercontent.com/zwave-js/zwavejs2mqtt/master/kustomization.yaml
```

> [!TIP]
> You will almost certainly need to instead use this as a base, and then layer on top patches or resource customizations to your needs or just copy all the resources from the [kubernetes resources](https://github.com/zwave-js/zwavejs2mqtt/tree/master/kubernetes) directory of this repo
## NodeJS or PKG version

1. Now you can use the packaged version (you don't need NodeJS/npm installed) or clone this repo and build the project:

- For the packaged version:

```sh
cd ~
mkdir zwavejs2mqtt
cd zwavejs2mqtt
# download latest version
curl -s https://api.github.com/repos/zwave-js/zwavejs2mqtt/releases/latest \
| grep "browser_download_url.*zip" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -i -
unzip zwavejs2mqtt-v*.zip
./zwavejs2mqtt
```

- If you want to compile last code from github:

```sh
git clone https://github.com/zwave-js/zwavejs2mqtt
cd zwavejs2mqtt
npm install
npm run build
npm start
```

2. Open the browser <http://localhost:8091>
9 changes: 9 additions & 0 deletions docs/getting-started/why.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Why Zwavejs

1. Entirely written in JS (Typescript). This is good for many reasons:
- We can drop the `node-openzwave-shared` that is maintained by me but would need a complete refactor and it's hard to maintain both projects.
- It will not require to compile OZW and we can have more control of updates/versions with zwavejs releases.
- JS it's straightforward to debug all through the stack rather than a black box that is abstracted by another library
2. Better support/collaboration: OZW is widely used and the author had many other related projects to maintain/support causing many delays or even no responses at all to some issues. Zwave is a good protocol but there are many devices compatibility issues and most of the issues on z2m were related to them. It's become really clear from the time building and maintaining z2m that the community is really important and have found working with @AlCalzone and the growing dev community around zwavejs to be really beneficial for fast paced change and this project is fully embraced by that community too.
3. Its device database keeps growing and uses configurations imported both from OpenHAB and OZW (ozw db import is waiting to be approved check updates [here](https://github.com/OpenZWave/open-zwave/issues/2461)).
4. Better code testing and overall features: it supports OTA Updates, Secure Node Replace and there is a work in progress for security S2 that are not supported by OZW
6 changes: 6 additions & 0 deletions docs/guide/env-vars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Environment variables

> [!NOTE]
> Each one of the following environment variables corresponds to their respective options in the UI settings and options saved in the UI take presence over these environment variables.
- `OZW_NETWORK_KEY`
9 changes: 9 additions & 0 deletions docs/guide/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# FAQ

> A: Why when I add a value to Gateway values table I don't see all my devices?
**B: When adding values to the gateway values table it shows JUST ONE DEVICE FOR EACH TYPE. This is to make it easier and faster to setup your network as if you have a network with lot devices (light, light dimmers for example) you just need to add the values you want to bridge to mqtt (for a light it will always be just the switch to turn it on/off for example without all configuration values) and it will bridge those values for all the devices of that type (without configure the values one by one).**

> A: My device is X and has been discovered as Y, why?
**B: Hass Discovery is not easy, zwave have many different devices with different values. Unfortunately not all devices respect specifications so for those cases I have created Hass Devices table where you can manually fix the discovery payload and than save it to make it persistent. I have also created a file `/hass/devices.js` where I place all devices specific values configuration, your contribution is needed there, so submit a PR with your files specification to help it grow.**
10 changes: 10 additions & 0 deletions docs/guide/healthcheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Health check endpoints

`/health`: Returns `200` if both mqtt and zwave client are connected, `500` otherwise
`/health/mqtt`: Returns `200` if mqtt client is connected, `500` otherwise
`/health/zwave`: Returns `200` if zwave client is connected, `500` otherwise

> [!NOTE]
> Remember to add the header: `Accept: text/plain` to your request.
Example: `curl localhost:8091/health/zwave -H "Accept: text/plain"`
Loading

0 comments on commit 3e9425d

Please sign in to comment.