Git Product home page Git Product logo

zigbee2grafana's Introduction

zigbee2grafana

a convoluted setup to extract local zigbee sensor data, take action depending on sensor state, or export data onwards for display with shiny grafana dashboards.

the motivation was to use grafana/prometheus for visual dashboards, and using simple JS code for taking action based on sensor values e.g. setting heating at certain time.

most of the code here consists of small scripts, and lots of glue. the real work is handled by zigbee2mqtt!

modes of operation

3 modes of operations can be used - but in both cases, it needs a sensor and one of these zigbee USB devices plugged in locally.

  • local-local - zigbee gateway runs locally, and the UI runs locally (separate docker-compose)

  • local-remote - zigbee gateway runs locally, and the UI runs somewhere else (in a server you own)

  • local-only - zigbee gateway runs locally, and no UI is provided (enough for local logic)

local-local

# prepare data folders
% git clone https://github.com/pldubouilh/zigbee2grafana.git
% cd zigbee2grafana
% mkdir -p data/prometheus/data data/grafana/data
% chmod 777 data/prometheus/data data/grafana/data

# start zigbee gateway
% sudo docker-compose -f zigbee-local.yml up

# start ui (separate shell)
% sudo docker-compose -f ui-local.yml up

# open browser at http://127.0.0.1:3000

local-remote

locally

% git clone https://github.com/pldubouilh/zigbee2grafana.git
% cd zigbee2grafana

# copy ssh keys over so that push gateway can send over state of sensors
% cp ~/.ssh/serverkey dockers/logic/ssh/key
% cp ~/.ssh/known_hosts dockers/logic/ssh/

# amend script to set destination IP
% vim dockers/logic/index.js

# start zigbee gateway
% sudo docker-compose -f zigbee-remote.yml up

# open browser at http://127.0.0.1:3000

and on the remote end

# prepare data folders
% git clone https://github.com/pldubouilh/zigbee2grafana.git
% cd zigbee2grafana
% chmod 777 data/prometheus/data data/grafana/data

# amend Caddyfile with domain name of server
% vim data/caddy/Caddyfile

# run
% apt install docker-compose
% sudo docker-compose -f ui-remote.yml up

# open browser at https://mydomain.com - login details are in data/caddy/Caddyfile

local-only

% git clone https://github.com/pldubouilh/zigbee2grafana.git
% cd zigbee2grafana

# start zigbee gateway
% sudo docker-compose -f zigbee-local.yml up

zigbee2grafana's People

Contributors

pldubouilh avatar

Watchers

 avatar  avatar  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.