A method of selectively pairing a plurality of sensors to a gateway from among a plurality of gateways in a wireless network, said sensors and said gateways being collectively referred to as devices, the method comprising: - prior to receipt of a discovery message, keeping said plurality of devices in a non-transmitting state; - transmitting a discovery message from a discovery initiating agent; - at each of said plurality of devices that have received said discovery message, broadcasting a primary discovery response; - determining, at said discovery initiating agent, respective proximities of said gateways to said discovery initiating agent and respective proximities of said sensors to said discovery initiating agent or one or more of said gateways, based on at least said primary discovery responses; - selecting, at said discovery initiating agent, a gateway and a subset of said plurality of sensors on the basis of said respective proximities; and - commissioning, by a commissioning agent, configuration parameters to said selected gateway and said subset of said plurality of sensors characterized in that the method further comprises: - at devices from among said plurality of devices that have not received said discovery message but that have received a primary discovery response, hop 1, broadcasting a secondary discovery response, hop 2; - at devices from among said plurality of devices that have not received said discovery message or a primary discovery response, hop 1, but that have received a secondary discovery response, hop 2, from a gateway out of range from said discovery initiating agent that has received a primary discovery response, hop 1, from at least one sensor, broadcasting a tertiary discovery response, hop 3; and in that said determining comprises: - at said discovery initiating agent and said plurality of devices, determining neighbor information based on said primary, secondary, and/or tertiary discovery responses; - broadcasting said neighbor information determined at said discovery initiating agent to gateways within range of said discovery initiating agent; - comparing, at each of said gateways within range of said discovery initiating agent, said neighbor information of said respective gateway to said neighbor information of said discovery initiating agent; - broadcasting said neighbor information determined at said gateways to sensors within range of said respective gateways; - comparing, at each of said sensors within range of one or more gateways, said neighbor information of said respective sensor to said neighbor information of said respective one or more gateways; and - providing a result of said comparing (1033a/b) to said discovery initiating agent or said one or more gateways. - prior to receipt of a discovery message, keeping said plurality of devices in a non-transmitting state; - transmitting a discovery message from a discovery initiating agent; - at each of said plurality of devices that have received said discovery message, broadcasting a primary discovery response; - determining, at said discovery initiating agent, respective proximities of said gateways to said discovery initiating agent and respective proximities of said sensors to said discovery initiating agent or one or more of said gateways, based on at least said primary discovery responses; - selecting, at said discovery initiating agent, a gateway and a subset of said plurality of sensors on the basis of said respective proximities; and - commissioning, by a commissioning agent, configuration parameters to said selected gateway and said subset of said plurality of sensors - at devices from among said plurality of devices that have not received said discovery message but that have received a primary discovery response, hop 1, broadcasting a secondary discovery response, hop 2; - at devices from among said plurality of devices that have not received said discovery message or a primary discovery response, hop 1, but that have received a secondary discovery response, hop 2, from a gateway out of range from said discovery initiating agent that has received a primary discovery response, hop 1, from at least one sensor, broadcasting a tertiary discovery response, hop 3; - at said discovery initiating agent and said plurality of devices, determining neighbor information based on said primary, secondary, and/or tertiary discovery responses; - broadcasting said neighbor information determined at said discovery initiating agent to gateways within range of said discovery initiating agent; - comparing, at each of said gateways within range of said discovery initiating agent, said neighbor information of said respective gateway to said neighbor information of said discovery initiating agent; - broadcasting said neighbor information determined at said gateways to sensors within range of said respective gateways; - comparing, at each of said sensors within range of one or more gateways, said neighbor information of said respective sensor to said neighbor information of said respective one or more gateways; and - providing a result of said comparing (1033a/b) to said discovery initiating agent or said one or more gateways.