The smallest RS485 IO Module — KC868-HAv2 module. size 3cm*3cm. let your switch panel and dry contact sensor convert to RS485. KC868-HA RS485 INPUT & OUTPUT plugin for ESPHome, easy integrate to home assistant. You can add everyone KC868-HA board with 6 digital input ports and 6 digital output ports to home assistant by RS485.
ESPHome KC868-HA Component github: https://github.com/hzkincony/esphome-kc868-ha
how to config yaml file for ESPHome: https://www.kincony.com/forum/showthread.php?tid=3397
PC config software and firmware download: https://www.kincony.com/forum/forumdisplay.php?fid=5