Massively Distributed Embedded Systems (MDES) such as Wireless Sensor Networks (WSN) are gaining increasing attention, since they enable a broad range of novel applications starting from monitoring oceans to exploring distant planets. WSNs consist of hundreds of nodes that have typically very limited recourses (computational, memory, energy, etc.) and are deployed in a dynamic environment, where they have to continuously adapt to new conditions. Due to the small-size requirement of the nodes, they are highly resource-constrained. Because of that, the amount of functionality that may be present in each node is limited. Therefore, cooperation between nodes is needed in order to accomplish complex tasks. These facts turn the design of applications for WSNs into a challenge. A promising approach how to deal with it is to use the emergent self-organization metaphor. In this paper a new process algebra (PA) called "Locality-aware extension of π-Calculus" is presented. The algebra is one of several techniques included in a new design methodology for the design of self-organizing behavior in MDES. The method is based on π-Calculus and allows a highlevel description of interactions among processes. As the most important characteristic of self-organization is the restriction of interactions to neighboring elements (localized interactions), we extend the π-Calculus with locality awareness, a necessary abstraction to allow the modeling of self-organization in MDES. To get full locality awareness in π-Calculus, we extended it with concepts for modeling spatiality, probability and time. Moreover, new types of channels are included to cover various types of communication such as distribution, broadcast and aggregation. In order to validate this new PA, we successfully model a self-organizing clustering algorithm for WSNs.