With this arrangement (only the relay will be on 12V and not 5V):
.
I am looking for the best way to detect if the relay is switched on. I don't want to do this through the D1 relay switching mechanism because the relay can also be switched on by another circuit (not ESP). How on another GPIO can I detect if the relay is switched on ?

I am looking for the best way to detect if the relay is switched on. I don't want to do this through the D1 relay switching mechanism because the relay can also be switched on by another circuit (not ESP). How on another GPIO can I detect if the relay is switched on ?