Coder Social home page Coder Social logo

mqtt-republisher's Introduction

SUMMARY
=======

A quick python script to accept incoming MQTT payloads under the topic of /raw/, and look them up in a table for republishing under a logical topic name

It stems from a suggestion by Robert at http://blog.hekkers.net/2012/09/18/mqtt-about-dumb-sensors-topics-and-clean-code/ to try and organize disparate sources into one logical hierarchy. 

Anything that is published under /raw/ but does not match anything in the map gets republished with /unknown/ prepended to the topic.

Some examples of source data I have...

/raw/flat.vpn.glasgownet.com/ups/voltage -> /bishopbriggs/gordonhouse/electricity/voltage
/raw/flat.vpn.glasgownet.com/meterpulsecounter/watts -> /bishopbriggs/gordonhouse/electricity/watts
/raw/weather1.vpn.glasgownet.com/weather/outside_temp -> /milngavie/parentshouse/garden/temperature
/raw/weather1.vpn.glasgownet.com/weather/inside_temp -> /milngavie/parentshouse/sunlounge/temperature
/raw/wmlp1000/apci/core_temp -> /mobile/wmlp1000/cpu_temp

INSTALL
=======

mkdir /usr/local/mqtt-republisher/ /etc/mqtt-republisher/
cd /usr/local/
git clone git://github.com/kylegordon/mqtt-republisher.git
cp mqtt-republisher.init /etc/init.d/mqtt-republisher
cp map.csv /etc/mqtt-republisher/
cp mqtt-republisher.cfg.example /etc/mqtt-republisher/mqtt-republisher.cfg
update-rc.d mqtt-republisher defaults
cp mqtt-republisher.default /etc/default/mqtt-republisher

Edit /etc/mqtt-republisher/map.csv and /etc/mqtt-republisher/mqtt-republisher.cfg to suit, and then

/etc/init.d/mqtt-republisher start

mqtt-republisher's People

Contributors

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