https://github.com/terual/dsmr2mqtt
DSMR to MQTT bridge written in C
https://github.com/terual/dsmr2mqtt
dsmr dsmr5 mqtt slimme-meters slimmemeter smart-meter smartmeter
Last synced: about 2 months ago
JSON representation
DSMR to MQTT bridge written in C
- Host: GitHub
- URL: https://github.com/terual/dsmr2mqtt
- Owner: terual
- License: apache-2.0
- Created: 2018-11-09T17:14:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-31T13:18:47.000Z (about 6 years ago)
- Last Synced: 2025-03-24T23:51:26.716Z (2 months ago)
- Topics: dsmr, dsmr5, mqtt, slimme-meters, slimmemeter, smart-meter, smartmeter
- Language: C
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dsmr2mqtt
This utility reads the telegrams from your DSMR-compatible smart meter and sends it
to a MQTT broker. I made use of [dsmr-p1-parser](https://github.com/lvzon/dsmr-p1-parser) and [libmosquitto](https://mosquitto.org/man/libmosquitto-3.html).I wrote this so I would be able to plug my smart meter into my OpenWRT router with a
prefabricated cable (I used this one: https://www.sossolutions.nl/slimme-meter-kabel).I used the MQTT topic definitions of [dsmr-reader](https://github.com/dennissiemensma/dsmr-reader).
If you want to use other definitions, you can change the the #defines at the beginning of the *dsmr2mqtt.c* file.## Compiling
### Debian/Ubuntu
First make sure you have git installed and the necessary library.
```
# apt install git libmosquitto-dev
```Then get the source code and use the command make to build the dsmr2mqtt executable:
```
$ cd [whatever build dir]
$ git clone https://github.com/terual/dsmr2mqtt
$ cd dsmr2mqtt
$ make
$ ./dsmr2mqtt
```### Cross-compiling for OpenWRT
To compile this for OpenWRT, use the following [guide](https://openwrt.org/docs/guide-developer/using_the_sdk),
place the Makefile.openwrt in a seperate dsmr2mqtt package folder, and rename it to Makefile.## Using the tool
```
Usage: dsmr2mqtt [-d ] [-m ] [-p ]
-d Serial device for DSMR device (default is /dev/ttyUSB0)
-m Host name for MQTT broker (default is localhost)
-p Host name for MQTT broker port (default is 1883)
```