I'm trying to control an opto-isolator (actually a photorelay such as a TLP354x but it doesn't really matter here).
The problem lie in an external device (black magic box) which is also controlled by my "input signal" (coming from SW1 which is a physical pushbutton that connects to the ground).
When the black magic box is disconnected, everything works fine and dandy but when I do connect it, the PNP transistor (Q1 : BC557) is always switched on no matter what I do. On the other hand, if I disconnect the right part of the schematic (pnp + opto), the black magic box works perfectly but the both of them do not play well together.
The black box input seem to be floating and is supposed to be an open-collector input. When left without the pnp connected, the voltage floats between 0 and 0,5V until I press SW1 when it goes firmly to 0V.
As soon as I connect the PNP, the voltage at the input is between 9 and 12V depending whether I leave the pull-up resistor (R3) or not and what value I give to R2. When I press SW1 it also goes firmly to 0V but the floating voltage seem to upset the magic black box and also makes the PNP conducts somehow.

simulate this circuit – Schematic created using CircuitLab
I cannot seem to understand the behaviour of the two together.
What other options could I have to "monitor" the state of this input without disturbing it?
Thank you for your help,
