I’ve spent hours trying to get my ventilation unit to connect to home assistant.
It uses modbus protocol and I’ve succesfully communicated with it using windows test software. However, I can’t seem to get any readings from it in home assistant.
Using the logger I think I’ve tracked down the problem in that the modbus commands being sent out dont match what the slave is expecting as per the documentation
and this is what the logs say modbus is sending:
pymodbus.transaction] Transaction failed. (Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received))
2021-04-25 19:15:48 DEBUG (SyncWorker_1) [pymodbus.transaction] RESETTING Transaction state to 'IDLE' for retry
2021-04-25 19:15:48 DEBUG (SyncWorker_1) [pymodbus.transaction] Retry on empty - 2
2021-04-25 19:15:48 DEBUG (SyncWorker_1) [pymodbus.transaction] SEND: 0x1 0x3 0x0 0xe 0x0 0x1 0xe5 0xc9
2021-04-25 19:15:48 DEBUG (SyncWorker_1) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-04-25 19:15:48 DEBUG (SyncWorker_1) [pymodbus.transaction] Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
Address: 0x1 (this is the slave address you specified in your config, and matches your document)
Function Code: 0x3 (valid register reading code according to your document)
Register ID: 0x0 0xe (== 14 decimal, see comment below)
Data Length: 0x0 0x1 (16 bit integer)
Failure Control: 0xe5 0xc9 (if this is a checksum it will change depending on what you send)
So the only odd thing is the register address. It’s sending a request for address 14, you specified 13 and a count of two (13 and 14).
You could try adding the reverse_order: true option to your config. See the option here: Modbus - Home Assistant
Excellent. I’ve never used Modbus but read this topic and tried to find a solution as an exercise as I may soon have to use it to connect to a solar inverter. I’ll be using TCP rather than serial though.