De Dietrich/Diematic (Modbus) to MQTT Interface

Hello,

I just publish a Dietrich/Diematic (Modbus) to MQTT Interface.

Here it is:

My project is now using Home Assistant as front end
Regards
Benoit

1 Like

Hello Benoit

Very good job. as i wrote on github i am trying to adapt your script to communicate with sofath heat pump. i thought something broke in the code but by losing power yesterday my usr adapter broke.

would there be a lot of work on your code to use the rs485 modbus to usb adapter or the rs485 hat for rapsberry pi?
in my opinion it would be a better solution - in one housing I enclose the rpi and rs485 hat and mount it inside the device.

I’m pretty weak at python.
you would be able to work together to modify it a little. today I will try to write you which registers should be read/write from the sofath (dedetrich) caliane heat pump (direct evaporation) I have a diematic 4 controller.
the reading values for the alarms are different. in the heat pump value 65535 = no alarm.

because i ordered a new rs485 - tcpip adapter and i dont know when it will come. I was forced to run a preview of the heat pump with this script found on github - it works reasonably well except that it throws a lot of communication errors - well, I can run the bimaster mode. there was no error problem in your script.

Oh My God!

I’ve just found your message now and it looks awesome!

I have an “old” De Dietrich MC 25 LP with a Diematic 3 control board and I thought I was out of luck to integrate it with Home Assistant…

Thanks to your message, it seems that it’s almost possible!

I’ve read your instructions on GitHub, it seems quite complex for a newbie like me, but, I would be happy to try!

Can it helps you to have more Home Assistant user? And if yes, how can we help?

Hello.

Sorry to not have answered earlier, I didn’t receive notification and was busy : I’ve add the MQTT discovery feature for Hassio. So you don’t have to write MQTT message definition, just to build the cards you want.

Benoit

To answer @Wrafal , yes some significant coding have to be done if you user an USB RS485 or RS485 hat for Raspberry PI: you need to detect the beginning and end of each modbus frame. This job is already done in the rs485 - tcpip adapter.

Benoit

Hello.
Thanks for you great work I have a MC25MI and I look for trying to connect it to hassio. I am a beginner and I would like to know if it is possible to run the script in the same Raspeberry Pi where I have my HA and under Home Assistant OS? Can you help me with this part of the setup?

Regards

Hello,

Yes it is possible, I dit it with HA but with the Install Home Assistant Core .

The Diematic to MQTT interface needs only python 3.8 or more and few libraries.

I don’t know HA OS but if the line command python3 --version give a result it should be possible…
Benoit

Hello!

Is there anyway to get Energy Cost (kwH) using modbus? In specification:

is at T1/TELECOMMANDE2, but querying register I’m getting nothing.

Hey there! I’m currently having a completely different question. Does anyone advise how the dedietrich heatpump Is controlled by indoor unit? 2 terminals (S1 And S2) marked from diagram but if I trace they Are fused ending up on L1 And N of the control/supply board. I do miss the whole control indoor board anyway.
Could anyone help?

Hello,

I have 2 questions :

  • I use USB/RS485 converter… Is this compatible?
  • As I’m a newbie :slight_smile: Could it be possible to add it directly as an add-on (like Zwvea2MQTT/Zigbee2Mqtt etc… )?

thank’s!

Hello,
Unfortunately the answer it’s no to both questions:

  • the software is not compatible with usb/485. It should possible but some extra software need to be added to split the received bytestream in modbus frame. Today it’s done bye the RS485/ethernet interface
  • I don’t know how to package and create an hassio addon and not the time to learn it.

But I’m open to github Pull Request :slight_smile:
Regards

1 Like

Hello @BenoitS,
Would it be complicated to adapt your program to work with Diematic Delta ? I’ll be happy to help, but have no idea about the feasibility (I have a din connector but read somewhere the modbus communication was different from your model).
Thanks!

Hi again,

Could you please also share tour YAML paramteres for your cards?

Hello
Did any one use the Home Assistant Python Scripts integration (I gues it will not work because of missing Python imports support) or the HACS custom integration pyscript?
I would like to run the everything (if possible) within Home Assistant with additional integrations like MQTT.
Looking forward to find someone to exchange experiences.

Hello @matiou ,

it’s feasible but not easy.
Have a look here

Difficult for me due to lack of time and no access to a Diematic Delta regulator.

Benoit

 cards:
      - type: entities
        entities:
          - entity: sensor.ext_temp
          - entity: sensor.power
          - entity: sensor.alarm
          - entity: select.zone_a_mode
            icon: mdi:water-boiler
          - entity: sensor.zone_a_mode
            icon: mdi:water-boiler
          - entity: sensor.zone_a_temp
          - entity: binary_sensor.zone_a_pump
            icon: mdi:pump
          - entity: sensor.pump_power
          - entity: select.hot_water_mode
            name: Mode ECS
            secondary_info: last-updated
            icon: mdi:water-boiler
          - entity: sensor.hot_water_mode
            icon: mdi:water-boiler
          - entity: sensor.hot_water_temp
          - entity: binary_sensor.hot_water_pump
        title: Chauffage
        show_header_toggle: true
        state_color: true
      - type: entities
        entities:
          - entity: number.zone_a_temp_day
            icon: mdi:thermometer-plus
            name: Température Jour
          - entity: number.zone_a_temp_night
          - entity: number.zone_a_temp_antiice
          - entity: number.hot_water_temp_day
            icon: mdi:water-plus
          - entity: number.hot_water_temp_night
          - entity: switch.heater_datetime_set
        title: Réglages Chauffage
        show_header_toggle: false
      - type: entities
        entities:
          - entity: sensor.heater_datetime
            icon: mdi:clock-time-eight-outline
          - entity: sensor.type
            icon: mdi:cpu-32-bit
          - entity: sensor.ctrl
            icon: mdi:cpu-32-bit
          - entity: sensor.zone_a_temp
          - entity: sensor.zone_b_temp
          - entity: sensor.ext_temp
          - entity: sensor.hot_water_temp
          - entity: binary_sensor.zone_a_pump
            icon: mdi:pump
          - entity: binary_sensor.zone_b_pump
            icon: mdi:pump
          - entity: binary_sensor.hot_water_pump
            icon: mdi:pump
          - entity: sensor.pump_power
          - entity: binary_sensor.burner_status
            icon: mdi:fire-circle
          - entity: sensor.fan_speed
            icon: mdi:fan
          - entity: sensor.ionization_current
          - entity: sensor.boiler_temp
          - entity: sensor.target_temp
          - entity: sensor.return_temp
          - entity: sensor.smoke_temp
          - entity: sensor.water_pressure
          - entity: sensor.alarm_id
            icon: mdi:water-boiler-alert
        title: Paramêtres Chauffage
        state_color: true
1 Like

Hi Benoit
You’ve done a fantastic job and I’m trying to use it to monitor my old MC25BIC from de dietrich in HA ios : Home Assistant 2022.12.6, Supervisor 2022.11.2, Operating System 9.4 with an interface
USR-TCP232-306

I’ve followed your procedure in Python script deployment and copied all files in directory /share/mosquitto/boiler. In terminal, if I browse to that directory, I can launch the script with python3 Diematic32MQTT.py and get data on log.out file. Example for 2 lines

2022-12-17 12:33:49,581 - main - INFO - Publish :home/heater/boiler/ext/temp 8.2
2022-12-17 12:33:49,582 - main - INFO - Publish :home/heater/boiler/temp 43.3

Hourra, my MC25Bic is alive !!

Then I’ve set 2 people in HA “core-mosquitto” and “boiler” and set this conf in mosquitto broker :

logins:

  • username: core-mosquitto
    password: x
  • username: boiler
    password: x
    require_certificate: false
    certfile: fullchain.pem
    keyfile: privkey.pem
    customize:
    active: true
    folder: mosquitto

Unfortunately I did not manage to get mqqt in HA to discover the boiler and in fact I do not know how to get HA to read the file Diematic32MQTT.conf.

Thanks a lot for your help :slight_smile:

Hello,

I’ve too remarks :slight_smile: which may help you to understand what happen

  • I’ve no knowledge to generate an HA module, and unfortunately no time to get it. The file Diematic32MQTT.conf is not written to be read by HA, only by the Diematic32MQTT software.

  • only basic connection to mqtt brooker is available, without login/password, without certificate neither cyphering. It could be quite easy to implement, but not done. Always a problem of time.

Do you use any of these security features?

Benoit

Thanks for your answer.
1- Ok understand. I can run the Diematic32MQTT software in terminal in HA and it works. Could find a way to have it launched at HA startup?
2- I’ve installed MQTT just to read this diematic32mqtt so I’ll adapt :slight_smile:
Merci encore :slight_smile:

Hello,

to run it as a service, have a look here :

It works under raspbian, with HA OS, I don’t know.

Benoit