  While mesh networking for edge settings (e.g., smart buildings, farms,
battlefields, etc.) has received much attention, the layer of control over such
meshes remains largely centralized and cloud-based. This paper focuses on
applications with sense-trigger-actuate (STA) workloads -- these are similar to
the abstraction of routines popular in smart homes, but applied to larger-scale
edge IoT deployments. We present CoMesh, which tackles the challenge of
building local, non-cloud, and decentralized solutions for control of
sense-trigger-actuate applications. At its core CoMesh uses an abstraction
called k-groups to spread in a fine-grained way, the load of STA actions.
Coordination within the k-group uses selective fast and cheap mechanisms rather
than expensive off-the-shelf solutions. k-group selection is proactively
dynamic, and occurs by using a combination of zero-message-exchange mechanisms
(to reduce load) and locality sensitive hashing (to be aware of physical layout
of devices). We analyze and theoretically prove the safety of CoMesh's
mechanisms. Our evaluations using both simulation and Raspberry Pi lab
deployments show that CoMesh is load-balanced, fast, and fault-tolerant.
