Skip to content
/ diematic Public
forked from gmasse/diematic

De Dietrich Diematic Modbus data to InfluxDB

License

Notifications You must be signed in to change notification settings

piwai/diematic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diematic

A Python script to monitor De Dietrich boiler equiped with Diematic system using Modbus RS-845 protocol. The values fetched from the boiler are sent to an InfluxDB database, for monitoring with Chronograph.

Screenshot

Hardware requirements

  • A De Dietrich boiler with Diematic regulation and a mini-din socket
  • A mini-din cable
  • A RS-845 to USB adapter
  • A nano-computer with a USB port and Python3 installed (Raspberry pi or similar)

Check tutorials in the "references" section below on how to do the hardware setup.

Installation

git clone https://github.com/gmasse/diematic.git
cd diematic
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp diematic.yaml.orig diematic.yaml
vi diematic.yaml

Test

Run python3 diematic.py --help

usage: diematic.py [-h] [-b {none,influxdb}] [-d DEVICE]
                   [-l {critical,error,warning,info,debug}]

optional arguments:
  -h, --help            show this help message and exit
  -b {none,influxdb}, --backend {none,influxdb}
                        select data backend (default is influxdb)
  -d DEVICE, --device DEVICE
                        define modbus device
  -l {critical,error,warning,info,debug}, --logging {critical,error,warning,info,debug}
                        define logging level (default is critical)

python3 diematic.py --backend none --logging debug

InfluxDB preparation

Minimal

CREATE DATABASE "diematic"
CREATE USER "diematic" WITH PASSWORD 'mySecurePas$w0rd'
GRANT ALL ON "diematic" TO "diematic"
CREATE RETENTION POLICY "one_week" ON "diematic" DURATION 1w REPLICATION 1 DEFAULT

Additionnal steps for down-sampling

CREATE RETENTION POLICY "five_weeks" ON "diematic" DURATION 5w REPLICATION 1
CREATE RETENTION POLICY "five_years" ON "diematic" DURATION 260w REPLICATION 1

CREATE CONTINUOUS QUERY "cq_month" ON "diematic" BEGIN
  SELECT mean(/temperature/) AS "mean_1h", mean(/pressure/) AS "mean_1h", max(/temperature/) AS "max_1h", max(/pressure/) AS "max_1h"
  INTO "five_weeks".:MEASUREMENT
  FROM "one_week"."diematic"
  GROUP BY time(1h),*
END

CREATE CONTINUOUS QUERY "cq_year" ON "diematic" BEGIN
  SELECT mean(/^mean_.*temperature/) AS "mean_24h", mean(/^mean_.*pressure/) AS "mean_24h", max(/^max_.*temperature/) AS "max_24h", max(/^max_.*pressure/) AS "max_24h"
  INTO "five_years".:MEASUREMENT
  FROM "five_weeks"."diematic"
  GROUP BY time(24h),*
END

Crontab

To run the script every minute and feed the database, crontab -e and add the following line:

*/1 *   * * *       ~/diematic/launcher.sh

References

About

De Dietrich Diematic Modbus data to InfluxDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.7%
  • Shell 1.3%