HA as virtual Modbus device

Hello,
I have a question regarding Modbus:
Is it possible for HA to send data to a Modbus client (Waveshare Modbus to ETH configured as a client) and essentially simulate a Modbus sensor?
Example:


The background is an existing sensor, which is to be read out via Modbus (connected to Waveshare Modbus/ETH 1) and in communication with Home Assistant. The data should be forwarded to another master (in this case an inverter) using a Modbus client (Waveshare Modbus/ETH 2). The problem here is that the registers queried by the master are different and should be converted by Home Assistant.
Is that possible?
Kind regards
Michael

I think Node red would be your best bet. Should be pretty straight forward.
Multi masters in MODBus can be a bit tricky though.

You can setup my mqmgateway, configure two modbus TCP networks for waveshare devices and you have two options here:

  • directly chain state and commands for both modbus devices in mqmgateway configuration
  • expose all registers via MQTT and create automation in HA to pass data from one modbus client to another.