Wireless sensor and actuator networks are comprised of embedded systems with sensing, actuation, computation, and wireless communication capabilities. Their untethered character provides installation flexibility and has in consequence led to their application in a large range of domains, e.g. environmental and habitat monitoring, or industrial process surveillance and control. Besides these traditional application areas, the vision of smart spaces foresees the transparent integration of sensing and actuation components into everyday environments. Smart services that rely on information about the current situation and the possibility of physical interaction are envisioned to emerge in versatile ways, such as context-aware building automation or support for ambient assisted living. From a technological perspective, wireless sensor and actuator networks represent an adequate infrastructure for the realization of smart spaces. As a result of the different application scenarios however, concepts resulting from research on traditional sensor and actuator networks can only be applied to a limited extent. Most prominently, the heterogeneous nature of devices in smart environments necessitates dedicated means to cater for their interoperability. At the same time, the need for small-sized devices entails tight resource and energy constraints, which need to be carefully regarded during application design. Finally, the collection and wireless transmission of data from mobile entities play a vital role in smart environments, whereas they are rarely considered in traditional sensor network deployments. We address the requirements of smart environments by presenting the Sensor-RPC framework, which enables the generic interoperability between diverse wireless sensor and actuator devices. The presented solution applies the remote procedure call paradigm to abstract from the underlying hardware platforms, i.e. sensing, processing, and actuation functionalities are encapsulated into remotely invocable functions. Sensor-RPC makes use of binary packet representations and a modular parameter serialization concept in order to ensure its efficient applicability on resource-constrained embedded systems. In order to maximize the utilization of the available energy budget, Sensor-RPC is complemented by Squeeze.KOM, a framework for lossless packet payload compression. Squeeze.KOM takes temporal correlations between successive data packets into account and exploits the observed similarities in order to reduce the size of transmitted packets, and thus the energy demand of their transmission. Depending on the characteristics of the underlying data, the actual data compression step is realized by means of binary distance coding of packet differences, or by applying adaptive Huffman coding with a code tree of limited size. Both take advantage of the specific properties of real-world sensor data sets, in which strongly biased symbol distributions are frequent. Besides the lossless compression of packet payloads, the further reduction of packet sizes by means of header compression is presented. Our stateful header compression mechanism SFHC.KOM omits header fields with constant or deterministically changing values from their transmission by encapsulating them into so called compression contexts. Tailored to its application in smart spaces, SFHC.KOM adapts to the presence of both static and mobile nodes. The practicality of the devised solutions is investigated through prototypical implementations and the validation of their function on widely adopted wireless sensor and actuator node platforms. We substantiate the evaluations of the presented solutions by detailed analyses of their resource and energy demands. In order to assess the applicability of the contributions in smart environments, real-world data traces from the envisioned application scenario have been collected and extensively used in simulations.