power source: wall charger AND battery

Oh, thank you very much!!! I think this is the easiest solution for my issue. Unfortuantely, I cannot test it because of a lack of diodes. It is just one thing that I miss and would be great if this was possible somehow, to see if V1 or V2 is used, maybe with some kind of digitalRead and two wires attached after the diodes? Any idea to do this?