The best way I know of is finding a device that’s supported by gadgetbridge: codeberg.org/Freeyourgadget/Gadgetbridge#supporte… (be sure to check the warnings, some devices require you to pair with the OEM app first or possibly even keep the OEM app around)
Though, I used this with an Amazfit Bip and didn’t find the data particularity insightful. It often was just straight up wrong about whether I was sleeping or not. So, I too am curious to see what other answers come in.