What is this device connected to my cold water pipe?
Suspicion coupled with an image search says yes, it's (almost certainly) a trap primer for the floor drain. Makes sure the floor drain trap does not dry out when disused and allow sewer gas to vent into the space.