Quick disclosure up front: I build a health app, so I've spent an embarrassing number of hours on this specific problem. I'm posting because it's the kind of thing this sub actually finds interesting, not to pitch anything.
When I started, I assumed the hard part of combining data from multiple wearables would be the integrations: OAuth, Health Connect, Apple Health, parsing everyone's slightly different formats. That part is tedious but solved. The genuinely hard part is something nobody warns you about: the same real-world event shows up multiple times, and if you add it all up you get numbers that never happened.
The clearest example is steps. Your phone counts a walk. Your watch counts the same walk. Both write it to the platform. Naively sum them and you've just taken a walk you never took. So the app has to recognise that these two records describe one event and keep only one. Easy to say, annoying to get right, because the timestamps rarely line up perfectly and the sources disagree on the total.
Sleep is worse. One user reported the app showing them a "nap" that they never took, sitting inside their normal overnight sleep. What actually happened: a slice of one continuous night got split off and counted a second time, inflating their total. Another user, on Android, had the opposite failure: an afternoon nap and a night's sleep got merged into one impossible 15-hour session. Same subsystem, opposite symptoms, and both are just the algorithm being wrong about where one sleep ends and another begins.
Then there's the echo problem. If a device writes to Apple Health, and you also connect that device directly, the same night of sleep arrives through two different doors. To the app it looks like two sources agreeing, but it's one measurement wearing two hats. Dedup has to catch that too.
The approach that's held up: reduce everything to small time buckets, and where two sources overlap, don't average them, pick the one you trust more per metric. For heart rate that ordering is chest strap, then watch, then ring, because that's the actual accuracy hierarchy. A secondary source only fills gaps the primary one left. Averaging is the tempting shortcut and it's almost always wrong, because it turns one good reading and one bad reading into a mediocre reading.
The honest limit: I do not do the thing Whoop does, stitching the GPS track from one device onto the heart rate from another inside a single workout. Outside of that trick, "two records, correctly deduplicated" is roughly the state of the art, and getting even that right is more work than it sounds.
If anyone here has solved the sleep-boundary problem more elegantly than "gap threshold plus source priority," I'd genuinely love to hear it, because it's the part I'm least happy with. (The app is FitMesh if you're curious, but the problem is the interesting bit, not the app.)