From 0b1c5b825e58f1946aa0006801c94b4b69b38321 Mon Sep 17 00:00:00 2001 From: gotnone Date: Thu, 29 May 2025 00:12:58 -0500 Subject: [PATCH] [modbus] [modbus_controller] Fix server role read coil 0x1 crc (#8859) Co-authored-by: Stanley Pinchak --- esphome/components/modbus/modbus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/modbus/modbus.cpp b/esphome/components/modbus/modbus.cpp index 80c2ffe3d6..cd5fc55689 100644 --- a/esphome/components/modbus/modbus.cpp +++ b/esphome/components/modbus/modbus.cpp @@ -90,7 +90,7 @@ bool Modbus::parse_modbus_byte_(uint8_t byte) { } else { // data starts at 2 and length is 4 for read registers commands - if (this->role == ModbusRole::SERVER && (function_code == 0x3 || function_code == 0x4)) { + if (this->role == ModbusRole::SERVER && (function_code == 0x1 || function_code == 0x3 || function_code == 0x4)) { data_offset = 2; data_len = 4; }