De Dietrich/Diematic (Modbus) to MQTT Interface

In fact, i just followed champ2410 (Guillaume) tuto :

to sum-up :
we need 3 files in the main folder of the app

1) Dockerfile

ARG BUILD_FROM
FROM $BUILD_FROM

# Install requirements for add-on
RUN \
    apk add --no-cache \
         python3 py3-virtualenv

RUN python3 -m venv /venv \
	 && . /venv/bin/activate \
	 && pip install --upgrade pip setuptools

ENV PATH="/venv/bin:$PATH"

RUN pip3 install pytz
RUN pip3 install paho-mqtt


# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh

COPY src/ /

CMD [ "/run.sh" ]

2) config.yaml

name: "Diematic 3"
description: "Diematic 3"
version: "2.0.1"
slug: "diematic_3"
init: false
arch:
  - aarch64
  - amd64
  - armhf
  - armv7
  - i386
startup: before

3) run.sh
python3 Diematic32MQTT.py

/!\ run.sh needs to be created in linux environment (in windows with notepad, it was not recognized)

Then you go in Home Assistant
=> Setup
=> Apps
=> Install app
You should find “Diematic 3” in ‘local add-ons’
=> Install

Hello,
as you may already have seen it, package already contains a Dockerfile usable without the run.sh file. Is it compatible with Hassio ?

In this case , adding the config.yaml file would allow to have a delivery package containing all files

Hello Benoit & all

First, thank you very much for the work done to decode Dietrich boiler's data.
I try implementing what you propose in my HA instance

  • Copy your entire package in the "addon" folder using SAMBA (I only updated the Diematic32MQTT.conf file to match with my boiler's input, IP, port, brocker data)
  • Add the config.yaml
  • Re-start HA and I was able to install the app

However, when staring the app, it goes to error and stop after few seconds with the following logs:

Traceback (most recent call last):
  File "./Diematic32MQTT.py", line 260, in <module>
    logging.config.fileConfig('./conf/logging.conf');
  File "/usr/local/lib/python3.8/logging/config.py", line 71, in fileConfig
    formatters = _create_formatters(cp)
  File "/usr/local/lib/python3.8/logging/config.py", line 104, in _create_formatters
    flist = cp["formatters"]["keys"]
  File "/usr/local/lib/python3.8/configparser.py", line 960, in __getitem__
    raise KeyError(key)
KeyError: 'formatters'

Any clue on what could be the problem ?

I'm running HA 2026.6.1

Thanks in advance,
Skifou

Hello All!

Benoit, thank you for your work on Diematic_to_MQTT!

I have managed to get it running with my De Dietrich GT1200 using a Diematic 3 FM16 controller and a USR-W610 in transparent TCP server mode.

The connection, synchronization, MQTT publishing are working. However, my controller consistently fails on the final register block:

Read 0x0001–0x003F OK
Read 0x0040–0x007F OK
Read 0x0180–0x01BF OK
Read 0x01C0–0x01D6 fails

The failing request is:

0A 03 01 C0 00 17

The first three blocks return valid frames every cycle.

For the ease of debugging I run Diematic32MQTT.py locally on my pc, later i plan to run it as app in HA.

Is there anything that could be done ?

Here is fragment of the log (i included 3 cycles).

2026-07-10 12:41:08,053 - Diematic - DEBUG - Bus status switched to MASTER after 5.233271837234497
2026-07-10 12:41:08,055 - Diematic - INFO - ModBus Master Slave Synchro OK
2026-07-10 12:41:08,056 - DDModbus - DEBUG - Send read request: 0a030001003f556100
2026-07-10 12:41:08,321 - DDModbus - DEBUG - Answer received: 0a037eb80a000000d2000c0029000500f600fa001e000100040001000000aa00a00032000100ce0005001d80143b0e00a00032003c0001ffff0003000e00c801c20000012a0a0200c800a0003c0001ffff0003000700c801f40000ffff0b00000c000000180b0000ca850f000093940f2c0b0009000b00022600000004019d00000352000000
2026-07-10 12:41:08,323 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:08,325 - DDModbus - DEBUG - Send read request: 0a0300400040449500
2026-07-10 12:41:08,789 - DDModbus - DEBUG - Answer received: 0a0380000100001a009b0a00960096012c02ee0028260000280231002a44593353000000000a00001a00bc0a873b0e080000000100000000010000000000000000000000640a020000000000ea050b00f500000f01000a000a9394000a0007001a0f0000000000001c0000000002310b00000000020320090000ca850f00b4000f03e0d20a000000
2026-07-10 12:41:08,791 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:08,792 - DDModbus - DEBUG - Send read request: 0a0301800040455500
2026-07-10 12:41:09,240 - DDModbus - DEBUG - Answer received: 0a038000b80a0000ca850fef9809000a0000b0090000ef98b60a0000ef980ef600080002000000c50a0000ef980e0070090c020000d30a0000ef980e0a0000000200000000df00000200ee0a00000000640b0000ee0a02002800000001000000000000000000000000000000284a0100784a0100000000090b0232002a7f017f0000bdbcdc000000
2026-07-10 12:41:09,241 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:09,242 - DDModbus - DEBUG - Send read request: 0a0301c00017057f00
2026-07-10 12:41:11,757 - DDModbus - WARNING - No answer to masterReadAnalog
2026-07-10 12:41:11,759 - Diematic - WARNING - ModBus Master Slave Synchro Error
2026-07-10 12:41:12,970 - DDModbus - DEBUG - Frame received: 25030065000192f100
2026-07-10 12:41:12,972 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:12,974 - Diematic - DEBUG - Bus status switched to SLAVE
2026-07-10 12:41:13,320 - DDModbus - DEBUG - Frame received: 26030065000192c200
2026-07-10 12:41:13,321 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:13,640 - DDModbus - DEBUG - Frame received: 270300650001931300
2026-07-10 12:41:13,641 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:14,015 - DDModbus - DEBUG - Frame received: 14030065000196d000
2026-07-10 12:41:14,017 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:14,320 - DDModbus - DEBUG - Frame received: 150300650001970100
2026-07-10 12:41:14,321 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:14,679 - DDModbus - DEBUG - Frame received: 160300650001973200
2026-07-10 12:41:14,681 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:15,010 - DDModbus - DEBUG - Frame received: 17030065000196e300
2026-07-10 12:41:15,013 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:15,350 - DDModbus - DEBUG - Frame received: 180300650001961c00
2026-07-10 12:41:15,351 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:15,680 - DDModbus - DEBUG - Frame received: 19030065000197cd00
2026-07-10 12:41:15,682 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:16,040 - DDModbus - DEBUG - Frame received: 1a030065000197fe00
2026-07-10 12:41:16,042 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:16,360 - DDModbus - DEBUG - Frame received: 1b0300650001962f00
2026-07-10 12:41:16,363 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:16,710 - DDModbus - DEBUG - Frame received: 1c0300650001979800
2026-07-10 12:41:16,714 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:17,040 - DDModbus - DEBUG - Frame received: 1d0300650001964900
2026-07-10 12:41:17,042 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:17,390 - DDModbus - DEBUG - Frame received: 1e0300650001967a00
2026-07-10 12:41:17,392 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:17,720 - DDModbus - DEBUG - Frame received: 1f030065000197ab00
2026-07-10 12:41:17,721 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:18,230 - Diematic - DEBUG - Bus status switched to MASTER after 5.256027936935425
2026-07-10 12:41:18,230 - Diematic - INFO - ModBus Master Slave Synchro OK
2026-07-10 12:41:18,231 - DDModbus - DEBUG - Send read request: 0a030001003f556100
2026-07-10 12:41:18,580 - DDModbus - DEBUG - Answer received: 0a037eb80a000000d2000c0029000500f500fa001e000100040001000000aa00a00032000100cf0005001d80143b0e00a00032003c0001ffff0003000e00c801c20000012a0a0200c800a0003c0001ffff0003000700c801f40000ffff0b0000bd0f0000000000001c0b0000ca850f0b0000000000002a022600000004019d0000b1ea000000
2026-07-10 12:41:18,581 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:18,582 - DDModbus - DEBUG - Send read request: 0a0300400040449500
2026-07-10 12:41:19,050 - DDModbus - DEBUG - Answer received: 0a038000010a0000ca850f00960096012c02ee0028260000280231002a44593353000000000000c50a0000ef980e0070090c02000000000001000000000000000000000064df0afe0200ee0a00000000f5000000ee000a000aee0a000a0007001a1e005601660b00000000000002312b0f3f04000203200a00000410002005000f03e0e180000000
2026-07-10 12:41:19,052 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:19,054 - DDModbus - DEBUG - Send read request: 0a0301800040455500
2026-07-10 12:41:19,530 - DDModbus - DEBUG - Answer received: 0a0380b80a00001a009b0a873b0e080000000100b80a0000000009000000ad0a28004000d90a00001a00bc0a873b0e080000000100d90a00000000d90a0000ef980e3a0ed90a020000000000ea050b0000140b0000939400280000000100000000000000000000000000000028939400780b0009000b0000160231002a980e1d0b0000cc57000000
2026-07-10 12:41:19,531 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:19,533 - DDModbus - DEBUG - Send read request: 0a0301c00017057f00
2026-07-10 12:41:22,034 - DDModbus - WARNING - No answer to masterReadAnalog
2026-07-10 12:41:22,035 - Diematic - WARNING - ModBus Master Slave Synchro Error
2026-07-10 12:41:23,100 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:23,101 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:23,101 - Diematic - DEBUG - Bus status switched to SLAVE
2026-07-10 12:41:23,380 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:23,381 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:23,600 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:23,602 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:23,820 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:23,823 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:24,190 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:24,192 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:24,410 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:24,411 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:24,656 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:24,658 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:24,801 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:24,803 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:25,130 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:25,131 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:25,340 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:25,340 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:25,500 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:25,501 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:25,711 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:25,713 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:25,930 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:25,931 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:26,070 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:26,071 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:26,212 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:26,213 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:26,420 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:26,421 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:26,760 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:26,762 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:26,920 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:26,921 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:27,130 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:27,131 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:27,350 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:27,351 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:27,730 - DDModbus - DEBUG - Frame received: 0b1001b40001020000d38400
2026-07-10 12:41:27,731 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:28,234 - Diematic - DEBUG - Bus status switched to MASTER after 5.132521867752075
2026-07-10 12:41:28,236 - Diematic - INFO - ModBus Master Slave Synchro OK
2026-07-10 12:41:28,237 - DDModbus - DEBUG - Send read request: 0a030001003f556100
2026-07-10 12:41:28,492 - DDModbus - DEBUG - Answer received: 0a037eb80a000000d2000c0029000500f500fa001e000100040001000000aa00a00032000100ce0005001d8014000000a00032003c0001ffff0003000e00c801c20000012ad40a00c800a0003c0001ffff0003000700c801f40000ffff0b0000280000007d0b00001c0b0000ca850f0e080f0b0000ef98022600000004019d0000f573000000
2026-07-10 12:41:28,494 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:28,495 - DDModbus - DEBUG - Send read request: 0a0300400040449500
2026-07-10 12:41:28,950 - DDModbus - DEBUG - Answer received: 0a0380000100001a009b0a00960096012c02ee0028260000280231002a44593353000000000a00001a00bc0a873b0e080000000100000000010000000000000000000000640a020000000000ea050b00f500000f01000a000a9394000a0007001a0000008c0b7e0b1c00000000023128004000000203201a000b0b873b0e08000f03e017a5000000
2026-07-10 12:41:28,950 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:28,951 - DDModbus - DEBUG - Send read request: 0a0301800040455500
2026-07-10 12:41:29,411 - DDModbus - DEBUG - Answer received: 0a0380b80a00001a009b0a873b0e080000000100b80a0000000000000000ad0a28004000d90a00001a00bc0a873b0e080000000100d90a00000000d9cb0a28004000f70a00001a00da0a873b0e080000000100f70a000000280000000100000000000000000000000000000028000c0078000a0007001a00280231002a0b260b000000e840000000
2026-07-10 12:41:29,411 - DDModbus - DEBUG - Answer valid
2026-07-10 12:41:29,412 - DDModbus - DEBUG - Send read request: 0a0301c00017057f00
2026-07-10 12:41:31,926 - DDModbus - WARNING - No answer to masterReadAnalog
2026-07-10 12:41:31,929 - Diematic - WARNING - ModBus Master Slave Synchro Error
2026-07-10 12:41:33,130 - DDModbus - DEBUG - Frame received: 20030065000192a400
2026-07-10 12:41:33,132 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:33,134 - Diematic - DEBUG - Bus status switched to SLAVE
2026-07-10 12:41:33,460 - DDModbus - DEBUG - Frame received: 210300650001937500
2026-07-10 12:41:33,461 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:33,710 - DDModbus - DEBUG - Frame received: 220300650001934600
2026-07-10 12:41:33,713 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:34,021 - DDModbus - DEBUG - Frame received: 230300650001929700
2026-07-10 12:41:34,023 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:34,280 - DDModbus - DEBUG - Frame received: 240300650001932000
2026-07-10 12:41:34,282 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:34,602 - DDModbus - DEBUG - Frame received: 25030065000192f100
2026-07-10 12:41:34,603 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:34,962 - DDModbus - DEBUG - Frame received: 26030065000192c200
2026-07-10 12:41:34,962 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:35,280 - DDModbus - DEBUG - Frame received: 270300650001931300
2026-07-10 12:41:35,281 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:35,630 - DDModbus - DEBUG - Frame received: 14030065000196d000
2026-07-10 12:41:35,632 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:35,951 - DDModbus - DEBUG - Frame received: 150300650001970100
2026-07-10 12:41:35,951 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:36,322 - DDModbus - DEBUG - Frame received: 160300650001973200
2026-07-10 12:41:36,324 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:36,642 - DDModbus - DEBUG - Frame received: 17030065000196e300
2026-07-10 12:41:36,645 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:36,991 - DDModbus - DEBUG - Frame received: 180300650001961c00
2026-07-10 12:41:36,993 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:37,300 - DDModbus - DEBUG - Frame received: 19030065000197cd00
2026-07-10 12:41:37,302 - DDModbus - DEBUG - slave address is not matching expected list
2026-07-10 12:41:37,661 - DDModbus - DEBUG - Frame received: 1a030065000197fe00
2026-07-10 12:41:37,661 - DDModbus - DEBUG - slave address is not matching expected list

Hello,

the problem can come from different source:

  • your boiler doesn’t support the last datablock : try to short it if it stops before 1D6
  • the time left for the boiler to answer is too short before switching in master mode : try to comment the previous block read to test

Regulator are not exactly the same in each boiler, it’s not possible for me to test the interface except for my own boiler => I apologize for that :slightly_smiling_face:
benoit

Hi,

My problem with my diematic4 isystem is still occurring.
After few weeks or days, diematic4 is stopping answering to RS485 queries:

2026-08-30 15:46:42,733 - Diematic - WARNING - Synchro timeout
2026-08-30 15:46:42,736 - Diematic - WARNING - Init Link with Regulator
2026-08-30 15:46:45,840 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:46:48,844 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:46:51,848 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:46:54,851 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:46:57,855 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:47:00,859 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:47:03,863 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:47:06,866 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:47:09,870 - DDModbus - WARNING - No answer to masterReadAnalog
2026-08-30 15:47:12,873 - DDModbus - WARNING - No answer to masterReadAnalog

Restarting the script does not solve the probem,
Restarting the RS485/tcp does not solve the problem,
Only a restart (power off/on) of the whole boiler/diematic4 solves the problem, diematic4 answers queries again.

It seems diematic4 is purely stopping responding to RS485.

Do you have any idea about such a problem ?

Hello,
the interface has been designed for Diematic3, some partial adaptations integrated for Diematic Delta.

For Diematic 4, it is a very good thing that it is functionnal 99% of the time. To correct the last 1%, a developper with a Diematic 4 equipped boiler should spent at least few times.

I do not belong such boiler. Another solution could be possible if you manage to catch log just a the crash time : with information of what happen just before it, it could be possible to try some correction.
regards,
Benoit

Thanks for the hint.
I will try to store docker logs more permanently.
It is easy to find from where is starts to malfunction and to look at the logs just before.
It may be necessary to raise the log level.

What is strange is how fast the problem happens : it seems to be more frequent in summer than during winter / heating time:
Few weeks between problems in winter.
Few days only during summer (it will be easier to catch)

Edit: script is already saving several days of logs by itself. This will ease things.

Hi all, I took some time porting the findings of Diematic_to_MQTT, isystem-to-mqtt, diematic_server, diematic-to-mqtt, python-diematic to a new Python library built upon Home Assistant’s new modbus-connection library. It’s fully live tested against my own De Dietrich Diematic 4 (with iSystem control panel). I’m looking for testers that have a Diematic 3 system or a Diematic 4 system with the iniControl control panel. Let me know what you think! The goal would be to use the library for a future HA Core integration for De Dietrich.

You can find the library here:

Core PR can be found below, feel free to test this with any rs485 to tcp gateway (the one mentioned in Diamatic_to_MQTT should work fine, I personally use this one). The initial feature set is small and only includes sensors that will work for all platforms (Diematic 3/4 + iSystem).