Future Internet-of-Things (IoT) systems need to combine heterogeneous IoT components and support weak connectivity. This paper introduces ComPOS, a domain-specific language for composing IoT services into systems. ComPOS is a small language but supports powerful message mediation, using stateful reactions with nested and parallel message sequences and anonymous futures. To deal with weak connectivity, we introduce the notion of abort semantics, i.e., aborting old reactions when a newer message arrives. Alternatives to the abort semantics can be obtained by adding strategy services. We evaluated our approach by implementing seven home automation scenarios.