@Bard Look Here and read well…follow the instructions completely. The gist of what you are doing is you are creating a full ‘custom component’ replacement for the ‘standard’ modbus component.
OK, just got to test this as well. It works great. I can finally delete my second instance of Hass and run all in a single container. Thanks @PtP.
Here is the corrected custom_component modbus1.py:
Base your changes on existing current modbus code using @paul_c5x4 mods.
Understood? NOTE: The component is called custom_component modbus1.py
PS: Stay safe in these troubled times!