Hello, I am trying to setup the Modbus RTU IO 8CH https://www.waveshare.com/wiki/Modbus_RTU_IO_8CH#Read_Input_Channel_Status
I’ve tried numerous configuration options that I could find in the forums and examples but non o those worked. Let me explain my setup.
I already have Modbus RTU Relay 32CH from Waveshare configured and working with my HA. The communication between is made over ethernet converter from rs485 to eth. The configuration below is working:
modbus:
- name: modbus_hub
type: rtuovertcp
host: 192.168.31.17
port: 4196
lights:
- name: "wave-ch1"
address: 0
write_type: coil
- name: "wave-ch2"
address: 1
write_type: coil
- name: "wave-ch3"
address: 2
write_type: coil
I now have added the digital IO and trying to configure it. Since I’ve suspected there might be an address collision I’ve assigned custom address to the second device, which is 40 at the moment.
Using serial port tools and USB to RTU converter I have no issues communicating with the machine, reading its input status, reading its address etc. Just following the wiki and running proper HEX codes over serial produces correct responses.
The configuration for coil and relays seems to be not a problem to HA but when it comes to the digital input reading I can’t figure it out. I’ve tried setting it up as stated in here Modbus - Home Assistant
I’ve also tried setting it up as discrete input, and as holding. I am setting proper refresh intervals. I don’t fully understand what is the slave option in the whole setup. Usually the device is in the Unavailable or Unknown state.
When I configure this device on HA and I monitor the serial I can see HA is trying to send HEX codes to Modbus but they don’t seem correct.
Is there a way for me to manually configure something in HA to communicate with this device ? I already can do it manually and it doesn’t seem to be any out of the box solutions in HA available. Maybe some better debugging tools ? Please help.
Some examples of manual usage:
Currently I can DI1 on DRY contact.
I send code:
40020000000876DD
I get response:
Which is correct, which also proves the address on 40 is correct