How do I connect 24v NPN/PNP device to a Raspberry Pi GPIO without cooking the Pi?
Based on the descriptions, the left side shows what is probably inside these receivers.

The first diagram that uses the "NPN" is safer than the "PNP" IMO. 

Yes, you need to connect the ground to the RPi.

Edit: added a third option, most conservative.







simulate this circuit &ndash; Schematic created using CircuitLab