I have a ventilation unit (Zehnder Comfoair) that is communicating with a control panel using RS-232. I am able to control the unit with Node-Red on my Rapsberry Pi if I connect the ventilation unit to the Pi instead of to the control panel. Now I would like to control the unit with both the panel and the Pi so I think I need a kind of serial port multiplexer as shown in the sketch below. Is there any utility that is already doing this? If not, do you have any advice on how to do it, preferably in shell or Python?
EDIT 20200126: Thanks @Marco G. I succeeded in connecting both in parallel. I used node-red and a Bash script. I have the control panel (ComfoSense) connected to ttyUSB0 and the ventilation unit to ttyUSB1 through RS232-USB converters. They are both configured the same way (stty -F /dev/ttyUSB0 raw 9600 cs8, same for ttyUSB1) and they are both linked together with socat (socat /dev/ttyUSB0 /dev/ttyUSB1) so I can use the control panel. The Comfoair node is communicating with a virtual serial port (/home/pi/VMC/ttyV0) that I link to the ventilation unit (socat PTY,link=/home/pi/VMC/ttyV0 /dev/ttyUSB1) only when I want to send a command. During that time the control panel cannot communicate but that is not a problem it is only for a short time.