Meltem WRG II integration via Meltem Gateway and Modbus

Hi everyone,

I’d like to share my experience integrating my Meltem WRG II units (M-WRG-II E-T-FC) into HA utilizing the Meltem Gateway.

This guide deals specifically with the integration of WRG II devices which are connected to the Meltem Gateway (M-WRG-GW) into Home Assistant. Not any other versions they offer!

Setup

After talking to the Meltem support they told me that their gateway exposes a Modbus RTU interface via the Micro-USB interface. There is no need to enable anything. You can also still use their app in parallel in combination with HA if you want or switch completely to HA.

First pair all your WRG devices to the gateway using the official app.If that worked you can continue with the HA integration. Then connect a MicroUSB cable to the gateway and plug it into your computer, RPi or whatever you are running HA on. The gateway is then powered via USB and your HA computer should recognize a new COM interface you can connect to. On my Pi4 with Hass.io it is /dev/ttyACM0. You can also check dmesg output via terminal what got recognized by the kernel.

If that works you must setup the modbus RTU integration according to Modbus - Home Assistant.

My config now looks like this:

- name: modbus_hub
  type: serial
  port: /dev/ttyACM0
  baudrate: 19200
  bytesize: 8
  method: rtu
  parity: E
  stopbits: 1

# Lüftung SZ
  sensors:
    - name: "Lüftung SZ Ablufttemperatur"
      slave: 3
      address: 41000   
      data_type: float32
      device_class: temperature
      unit_of_measurement: "°C"      
      scan_interval: 60      
      precision: 1
      swap: word
    - name: "Lüftung SZ Außenlufttemperatur"
      slave: 3
      address: 41002      
      data_type: float32
      device_class: temperature
      unit_of_measurement: "°C"
      precision: 1
      scan_interval: 60      
      swap: word
    - name: "Lüftung SZ Fortlufttemperatur"
      slave: 3
      address: 41004
      data_type: float32
      device_class: temperature
      unit_of_measurement: "°C"      
      scan_interval: 60      
      precision: 1
      swap: word
    - name: "Lüftung SZ Feuchte Abluft"
      slave: 3
      address: 41006
      data_type: int16
      device_class: humidity
      unit_of_measurement: "%"    
      scan_interval: 60      
    - name: "Lüftung SZ CO² Abluft"
      slave: 3
      address: 41007
      data_type: int16
      device_class: carbon_dioxide
      unit_of_measurement: "ppm"      
      scan_interval: 60
    - name: "Lüftung SZ Zulufttemperatur"
      slave: 3
      address: 41009
      data_type: float32
      device_class: temperature
      unit_of_measurement: "°C"      
      scan_interval: 60
      precision: 1
      swap: word
    - name: "Lüftung SZ Feuchte Zuluft"
      slave: 3
      address: 41011
      data_type: int16
      device_class: humidity
      unit_of_measurement: "%"    
      scan_interval: 60
    - name: "Lüftung SZ Lüfterstufe Abluft"
      slave: 3
      address: 41020      
      data_type: int16
      device_class: volume_flow_rate
      unit_of_measurement: "m3/h"      
      scan_interval: 60
    - name: "Lüftung SZ Lüfterstufe Zuluft"
      slave: 3
      address: 41021   
      data_type: int16
      device_class: volume_flow_rate
      unit_of_measurement: "m3/h"      
      scan_interval: 60
    - name: "Lüftung SZ Zeit bis Filterwechsel"
      slave: 3
      address: 41027
      data_type: int16
      device_class: duration
      unit_of_measurement: "d"      
      scan_interval: 60

Writing register ^= changing modes, fan speeds etc

To change fan speeds, modes etc. you must basically write 3 register after another. E.g. this script sets the mode to “Auto”

alias: Ventilation - SZ - Auto
sequence:
  - service: modbus.write_register
    metadata: {}
    data:
      hub: modbus_hub
      slave: 3
      address: 41120
      value: 2
  - service: modbus.write_register
    metadata: {}
    data:
      hub: modbus_hub
      slave: 3
      address: 41121
      value: 16
  - service: modbus.write_register
    metadata: {}
    data:
      hub: modbus_hub
      slave: 3
      address: 41132
      value: 0
mode: single

For all other options please have a look into the documentation of their Modbus versions. See chapter 16 in https://www.meltem.com/fileadmin/user_upload/Downloads_WRG_2/Oeffentliche_Downloads/DE/Betriebsanleitungen/Geraete/Meltem-M-WRG-II-P-E-M-(-F%2C-FC)-Installations-und-Betriebsanleitung.pdf

REMARKS

  • On the Gateway the Modbus register 41000 and 41004 are reversed. That’s why those differ in my config to the documentation. Meltem confirmed this when talking to them that the registers are different here.
  • The first slave ID being used is 2 and then increment in the sequence you’ve added your devices via the app to the gateway.