ModBus multiread binary sensor

The ModBus integration allows to read multiple ModBus registers for sensors, but unfortunately not for binary sensors. I’ve found this issue in github, which seems to address the same problem Allow multiread in modbus binary_sensor by janiversen · Pull Request #59886 · home-assistant/core · GitHub and states the issue as merged, but neither did I find anything about it in the documentation of the ModBus integration nor does it work for me.
If I insert the count option to my binary ModBus sensor, the configuration check gives me this error: Invalid config for [modbus]: [count] is an invalid option for [modbus]. Check: modbus->modbus->0->binary_sensors->0->count. (See /config/configuration.yaml, line 145).

I’m not able to test this myself at the moment, but it looks like it should be slave_count.
How you unpack the bits from there is unclear.

Was able to test and confirm it works as intended.
Looks like HA unpacks the binary sensors for you. :+1:

binary_sensors:
    - name: Test Binary Modbus
      slave: 1
      address: 1
      device_class: power
      slave_count: 10

Thanks for your hint, I assumed this option will iterate the unit addresses and not the register, but obviously iterates the register as it works for me as well.
Even if I heavily dislike this term and would prefer unit_count i.e., analog to the term unit instead of slave, but that’s another topic.

1 Like

Agreed - slave normally refers to unit address not the coil address. The nomenclature used by Home assistant Modbus compared to Modbus standard protocol is a bit off to say the least.

Anyway, glad I could help.

1 Like