A collection on Node-RED nodes interfacing with Zigbee2MQTT.
Inspired by node-red-contrib-zigbee2mqtt with following key differences:
- Written in (mostly) Typescript
- Uses built-in Node-RED MQTT configuration nodes
- Uses the new Zigbee2MQTT API
This project is work in progress and might be subject to change dramatically.
Right now, it lives in "personal pet project" status, which I do use to automate my home with, so you can expect some stability :)
Currently, only few nodes are available:
View source: example-flow.json
See Node-RED docs about how to install nodes using NPM or package.json
But in the gist it is just:
# Navigate to node-red userDir (yours might differ!)
cd $HOME/.node-red
# Install this package
npm install node-red-contrib-z2m
# Restart Node-RED!
# Clone this repository
git clone https://github.com/kristianheljas/node-red-contrib-zigbee2mqtt
cd node-red-contrib-zigbee2mqtt
# Install dependencies (also installs husky git hooks)
yarn
# Compile sources (--dev enables sourceMaps, useful for debugging)
yarn build --dev
# Install this repository locally
cd /path/to/node-red-user-dir
npm install /path/to/node-red-contrib-zigbee2mqtt
To automatically watch for file changes run yarn gulp watch
instead (also supports --dev flag
)
You can run integrated node-red devlopment server by running yarn gulp start
, which will:
- Compile all sources & copy static assets
- Run node-red development server
- Automatically compile and restart the server on file changes
By default the development server listens on port 1880
, but can be configured via PORT
enviroment variable (ie. PORT=8080 yarn gulp start
).
The development server stores it's data and configuration inside .node-red/
directory.
# Start local node-red instance & watch for file changes
yarn gulp start
## EDIT SOURCES ##
# Commit changes
git add .
git commit # runs lint-staged and commitlint automatically
# Push changes
git push
You can also run linting and formatting manually using:
# Fix eslint problems
yarn lint
# Format code using prettier
yarn format
This project is enforcing Conventional Commits.
@commitlint/config-conventional
conguration is used, which is based on the Angular convention.
feat: new feature
fix(scope): bug in scope
feat!: breaking change in API
chore(deps): update dependencies
build
: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)ci
: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)chore
: Changes wich doesn't change source code or tests e.g. chnages to the build process, auxiliary tools, librariesdocs
: Documentation only changesfeat
: A new featurefix
: A bug fixperf
: A code change that improves performancerefactor
: A code change that neither fixes a bug nor adds a featurerevert
: Revert somethingstyle
: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)test
: Adding missing tests or correcting existing tests