GithubHelp home page GithubHelp logo

vaterlangen / smartmetertomqtt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oetken/smartmetertomqtt

0.0 0.0 0.0 131 KB

Smart Meter to MQTT application.

License: GNU General Public License v3.0

Shell 1.41% C++ 91.77% HTML 3.33% CMake 3.48%

smartmetertomqtt's Introduction

Details

This tool reads data from Sml (Smart Message Language) devices or M-Bus devices and publishes the data via MQTT.

Sml support is currently limited to reading.

MQTT is limited to non-SSL (you may easily adopt this...)

Tested with:

Tested on:

  • Debian Bullseye
  • Raspberry Pi OS (Debian 10.7 based)
  • Raspberry Pi Zero W / Pi 3b

Goals:

  • simple and very few effort!

Depends on:

Installation

Check Releases for a link to amd64 Debian builds. Or build from source:

Prerequisits

Libmbus Libsml and QtMQTT:

cd WHATEVERWORKSPACEYOUWANT
sudo apt install -y git cmake build-essential qtbase5-dev cmake devscripts qtbase5-private-dev debhelper uuid-dev libqt5xmlpatterns5-dev libqt5serialport5-dev dh-make dh-exec
git clone https://github.com/rscada/libmbus
git clone https://github.com/volkszaehler/libsml
git clone https://github.com/qt/qtmqtt

cd libsml 
sed -i 's/.*\s-C\stest$//g' Makefile
dpkg-buildpackage -b --no-sign
cd ..

cd libmbus
./build-deb.sh
cd ..

cd qtmqtt;
QT_VERSION="$(qmake --version | sed -n  's/.*version\s*\([0-9]*\.[0-9]*\.[0-9]*\)\s*.*/\1/p')";
git tag -l | grep -E "${QT_VERSION}$" || QT_VERSION=$(git tag -l | grep -oP "$(qmake --version | sed -n  's/.*version\s*\([0-9]*\.[0-9]*\.\)[0-9]*\s*.*/\1/p')[0-9]+$" | tail -n 1);
git checkout v$QT_VERSION;
cd .. && mv qtmqtt "qtmqtt-$QT_VERSION"; cd "qtmqtt-$QT_VERSION";
qmake;
dh_make -s -c gpl -e [email protected] --createorig -y
dpkg-buildpackage -b --no-sign
cd ..

sudo dpkg -i *.deb

# alternative for mqtt:
#git checkout v$(qmake --version | sed -n  's/.*version\s*\([0-9]*\.[0-9]*\.[0-9]*\)\s*.*/\1/p')
#if no suitable version is found check tags and pick a good one
#qmake
#make
#sudo make install

Compile

git clone https://github.com/oetken/smartmetertomqtt.git
cd smartmetertomqtt
mkdir build
cd build
cmake ..
# for Release mode use: cmake .. -DCMAKE_BUILD_TYPE=Release
cpack
sudo dpkg -i *.deb

Configuration

  • when run as user without argument the config is located in ~/.config/SmartHomeTools/SmartMeterToMqtt.json
  • when run as service the config is located in /etc/smartmeter.json
  • you can pass the config file location via "-f"
  • There are several configuration options like mean filtering or skipping of values. Check the example config.

-> see SmartMeterToMqtt.json_example

Installation as service

Done by the debian package.

Copyright 2021 - 2021, Andreas Oetken and the smartmetertomqtt contributors.

smartmetertomqtt's People

Contributors

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