If you parse the received message on the gateway, you can have the node ID an thus you will have which sensor sent the data without too much effort, if I understood what you were saying
@adrian_kbb73 Welcome to the MySensors commu ity!
Most of this code seems to be for MySensors 1.x. It needs to be converted to work with 2.x. A guide is available at https://forum.mysensors.org/topic/4276/converting-a-sketch-from-1-5-x-to-2-0-x/