Code Monkey home page Code Monkey logo

deconz2mqtt's Introduction

deconz2mqtt

This is a Python utility that translates the deCONZ rest api to MQTT messages. Will later be using WebSockets for fetching changes on the fly that are published to MQTT. There is also a full update of all items every x minutes, to make sure we have the last updated values.

The utility is connecting to the deCONZ rest api

TODO

  • Handle scenes
  • OpenHAB examples and details about how to use it
  • Get WebSocket port from config
  • Config what to care about sensors, groups, lights etc

Installation

To get this working you must have deCONZ running on a computer and the deCONZ rest api in place

Clone this repo and install the dependencies

$ git clone this.repo 
$ cd this.repo
$ cp default.template.cfg default.cfg
  • Update the new file default.cfgwith all the correct values
  • Get a new api_key to insert if you do not have one

Run

$ make init test run

Run script as system service

Create Systemd service

Create systemd service, assuming repo was cloned to /home/pi folder on a RaspberryPi, adjust paths if needed

$ sudo ln -s /home/pi/deconz2mqtt/deconz2mqtt.service /etc/systemd/system/deconz2mqtt.service

Set permissions:

$ sudo chmod 644 /etc/systemd/system/deconz2mqtt.service

Reload systemd then enable the service at startup:

$ sudo systemctl daemon-reload
$ sudo systemctl enable deconz2mqtt.service
$ sudo systemctl start deconz2mqtt.service

Check service status and view log snippet with:

$ sudo systemctl status deconz2mqtt.service

To view more lines of logs add -nXX where XX is the number of lines e.g. to view 50 lines of logs

$ sudo systemctl status deconz2mqtt.service -n50

Start, stop and restart with:

$ sudo systemctl start deconz2mqtt.service
$ sudo systemctl stop deconz2mqtt.service
$ sudo systemctl restart deconz2mqtt.service

This is work is inspired by

leaf-python-mqtt and deconz-mqtt

deconz2mqtt's People

Contributors

steintore avatar

Stargazers

 avatar

Watchers

 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.