OVEN MK110 (ОВЕН) MODBUS RTU integration

Hi there!

I was fighting with the device in subject and finally found the way how to work with it in HA.
Probably this article require Russian translation as far as this device is well known withing CIS region.

So… to read registers of OVEN MK110 or any similar OVEN device you need a RS485 USB converter. Previously I spent a lot of time figuring out why system did not work. The reason was incorrect driver support in Hassio for russian converter. I got other from AliExpress for $2.Once I got Chinese dongle everything went fine.

My device setup in configuration.yaml:

  name: oven110
  type: serial
  method: rtu
  port: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
  baudrate: 9600
  stopbits: 1
  bytesize: 8
  parity: N

port: value may be found in Hass.io/System/Hardware menu page.

Then you may set up a sensor to read Inputs of the device. Values are stored in 51 register:

- platform: modbus
    - name: InputsState
      hub: oven110
      slave: 16
      register: 51
      count: 1

The value received should be parsed by bits, so I set up binary sensors for that and parsed InputsState value:

  - platform: template
        friendly_name: "Сетевое питание"
        value_template: "{{ states('sensor.InputsState')|int|bitwise_and(1) > 0 }}"
        friendly_name: "Аккумулятор"
        value_template: "{{ states('sensor.InputsState')|int|bitwise_and(2) > 0 }}"
        friendly_name: "Cигнализация"
        value_template: "{{ states('sensor.InputsState')|int|bitwise_and(4) > 0 }}"
        friendly_name: "Вода"
        value_template: "{{ states('sensor.InputsState')|int|bitwise_and(8) > 0 }}"
        friendly_name: "Задымление!"
        value_template: "{{ states('sensor.InputsState')|int|bitwise_and(16) > 0 }}"
        friendly_name: "Движение"
        value_template: "{{ states('sensor.InputsState')|int|bitwise_and(32) > 0 }}"
        friendly_name: "Датчик протечки"
        value_template: "{{ states('sensor.InputsState')|int|bitwise_and(64) > 0 }}"

To change outputs state you need to write registers using modbus function 16. And this took time to figure out how it can be done in HA. Finally I found that HA uses this function if value provided for writing is an array.

For writing registers I use automation where first value in the array is what I want to write, the second is dummy just to call function 16:

- alias: Water ON
    - platform: state
      entity_id: binary_sensor.switch2
      from: 'on'
      to: 'off'
  - service: modbus.write_register
      hub: oven110
      unit: 16
      address: 0000
      value: [0,0]
  - service: notify.telegram_id1
      message: "*Water should be ON.*"

Register 0000 is linked to Digital Output #1. Maximum value in output registers: 1000
Full set of registers and its functions are described in the documentation.

Hello. I am from Russia too:) and i have DO module the same company. OVEN MY210-402, but it use Modbus TCP. and i have a problem. may be you can help me. This module has 16 Discrete output , and they kept in 470 register as a bitmask. how can i write singl bin in this register? i try you example , but nothing happened:(

We could discuss your case in Discord https://discord.gg/cKk4hk
Search for me: Dimster(Дмитрий)#7409

Good day! Russian convector RS485 is a convector of the company OWEN too? How did the inoperability manifest? When reading, did the data jump?