1st to apologize I am not an electrician

I have 2 electric meter with S0-outputs (1x electricity used, 1x electricity produced by solar panels). These are coupleed with eltako FSS12-12VDC Enocean counter with my Raspi (FHEM) and are working fine.
Now I wanted to use these S0-ouputs additionaly in an ESP8266 D1 mini with EasyESP. Final goal would be to have a 4x20 I2C LCD showing electrictity used/produced and to send available energypotential to a powerwall/charger for electric vehicles to adjust loading current ...
Therefor I connected
S0+ o (FSS12)
|
S0+ o-----------------o +3V
S0- o-----------------o GPIO
|
---4,7kOhm---o GND
|
S0- o (FSS12)
==> even if now two counters (FSS12 & ESP8266) are attached this is still working fine.
If I want to add the other S0 counter the same way the pulses are messed up (FSS12 are still attached, but to simplify the are not shown below) and I get the sum of both counters on both GPIOs (and on both FSS12)
S0(a)- o-----------------o GPIO(a)
|
---4,7kOhm---o GND
|
---4,7kOhm---o GND
|
S0(b)- o-----------------o GPIO(b)
S0(a)+ o--------
|
S0(b)+ o-----------------o +3V
Would optocoupler help ? How should they be implemented ?
THX
Slowfinger