ESPHOME modbus optimalization

So i am trying to connect an esp32 via modbus to multiple slaves (all the same), the slaves are basically a panel with 10 buttons and some enviroment sensors and rgb.


It has some documentation explaining the best way to read the data without over using the modbus. I first tried with esphome and it worked for one slave but when adding another it got slow due to many requests.

This is a picture of some of the registers a slave has. Now the documentation says i should read register 13 and if this changes i should read registers 14-23. But how do i add sensors for register 14-23 without them being updated via the update_interval ( i am using 100ms for the buttons pressed). Further wanted to read some other registers containing enviroment data and rgb values, for this i added the skip_update_interval so it wouldnt be updated every 100ms.

Are there any optimizations that i can do? Or should i write a full custom component or just not use esphome for this?

Many thanks

I have never tried Esphome with multiple slaves. You might find some limitations, but I believe that with lambdas you can find solutions.
Anyway, every slave have to have independent slave address.
How is our serial wiring set up?

Right now its just a test setup, an esp connected to the first device and then the frist connected to the second and so on

Hey, did you manage to optimize it? I was also thinking about making some custom modbus based wall switches, but I wasn’t sure what would be the best way to get updates from them when there will be 10+ of them and also some other modbus modules on the bus. I feel like polling them every 100ms would overwhelm the bus, but maybe Im wrong. Im pretty new to modbus