Modbus question discrete input

I want to used modbus in homeassistant. but I can not find Read Discrete Input.
follow is available:
Modbus Binary Sensor 01 Read Coils
Modbus Sensor 03 04 read holding Input registers
Modbus switch 05 write Single Coil

where i can use read discrete input?

Anyone have the answer on this one?

I have a modbus system that have the following configuraton:
Coils, addresses that starts with 0, home assistant = binary sensor, coils
Inputs, addresses that starts with 1, home assistant = ?
Input Registers, addresses that starts with 3, home assistant = sensor, register_type = input
Holding Registers, addresses that starts with 4, home assistant = sensor, register_type = holding

So how do you configure HA to read the 1xxxxx addresses? “Discrete Input”?

More info:
https://www.csimn.com/CSI_pages/Modbus101.html

Did anyone figure out how to read discrete inputs with the Modbus Component?

I am able to read temperatures using input registers via modbus sensor, coils via modbus binary sensor and output coils via the modbus switch.

I am trying to monitor an EasyIO-30p via modbus TCP and can’t figure out how to read the Binary Inputs.

Thanks in advance.

Looks like it is not implemented from pymodbus. There is read_discrete_inputs() for that purpose.

Probably someone could add this as a feature request.

if anything has changed in the last year - the read_discrete_inputs function is still needed :slight_smile: ?

Maybe it will be useful to someone - it was about input_type: discrete_input - then the client sends the function No. 2 instead of No. 1 and it’s OK. Working example below.

binary_sensor:
  - platform: modbus
    scan_interval: 1   
    coils:
    - name: ModbusALARMX1
      hub: hub1
      slave: 5
      coil: 0
      input_type: discrete_input
    - name: ModbusALARMX2
      hub: hub1
      slave: 5
      coil: 1
      input_type: discrete_input
    - name: ModbusALARMX3
      hub: hub1
      slave: 5
      coil: 2      
      input_type: discrete_input
1 Like

Not sure when this has been implemented but it works!