Communicate between multiple ESP’s with RS485 Modbus

Hello everyone, I was searching on the internet but I could not find answers to my questions. So I would like to try my luck here and see if someone can help me.

I would like to ask if it’s possible to communicate between multiple ESP’s using modbus in ESPHome. So for example - I press a button on esp1 and turn on a relay on esp2.

I have some max485 modules to convert UART to RS485, but I just don’t understand how should the yaml files been written since I’m a total newbie in this field.

Thank you in advance!