This is a service you can install from my deb repo on a Raspberry Pi. It has two reasons to exist: Pi4J 4.x is published as a Java 25 artifact to use the new FFM capabilities but if you're not able to use JDK 25 yet I publish an artifact client to maven compiled with 21. Second it's just a handy service for exposing pi hardware to gRPC.
I maintain a project where Raspberry Pis or other Debian Systems advertise themselves on a LAN with UDP beacons and auto-discover each other, pair and sync with Ktor SSE. I built it in Kotlin Multiplatform so there's android, ios, desktop and web front ends.
Similar concept where it's decentralized with a Web (WASM) front end showing all of your sensors and devices as "nodes" with state machines and a bunch of functions like alerts, python lambas, cron tasks, mqtt - it's a beast: https://krillswarm.com
Syncing was the hard part so I with you, I can either pull out that part into a library you can use or i'll use yours when it's ready. Each Pi generates a self signed cert other servers download and trust for https everywhere.
If you're interested I also just put out an OSS gRPC bridge specifically for RPi the essentially wraps pi4j 4.x using the new PPE and exposes it's apis over gRPC: